Hallo to XDA DEVELOPERS,
Please very much, I want ask for trouble, which I cant solve for many days.
I read many informations about receiving SMS, I tryed many examples of code and I build many codes which are from my head, but it not functioned.
Please, I have very big trouble. Many days I try develope application for receiving SMS, but I cant this.
I can send sms and use mobile and outlook functions, but I CANT RECEIVE SMS.
This is one of my code:
Imports Microsoft.WindowsMobile.PocketOutlook.MessageInterception
Imports Microsoft.WindowsMobile.Telephony
Imports Microsoft.WindowsMobile
Imports Microsoft.WindowsMobile.PocketOutlook
Imports System.Messaging
Imports System
Imports System.Collections.Generic
Imports System.Drawing
Imports System.Text
Imports System.Windows.Forms
Imports Microsoft.WindowsMobile.Status
PublicClass Form1
Private _smsInterceptor As MessageInterceptor
PrivateSub Form1_Load(ByVal sender AsObject, ByVal e As System.EventArgs) HandlesMyBase.Load
If MessageInterceptor.IsApplicationLauncherEnabled(_appId) Then
_smsInterceptor = New MessageInterceptor(_appId)
Else
_smsInterceptor = New MessageInterceptor(InterceptionAction.Notify)
_smsInterceptor.MessageCondition = New MessageCondition(MessageProperty.Body, _
MessagePropertyComparisonType.StartsWith, "www")
EndIf
AddHandler _smsInterceptor.MessageReceived, New MessageInterceptorEventHandler(AddressOf SmsInterceptor_MessageReceived)
Display("Event Wired")
EndSub
Sub Display(ByVal text AsString)
TextBox1.Text &= text & vbCrLf
EndSub
PrivateSub SmsInterceptor_MessageReceived(ByVal sender AsObject, ByVal e As MessageInterceptorEventArgs)
Display("Received")
Dim theMessage As SmsMessage = TryCast(e.Message, SmsMessage)
IfNot theMessage IsNothingThen
Display("Msg: " & theMessage.From.Address & " - " & theMessage.Body)
EndIf
EndSub
Const _appId AsString = "sms"
PrivateSub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If MessageInterceptor.IsApplicationLauncherEnabled(_appId) Then
_smsInterceptor = New MessageInterceptor(_appId)
Else
_smsInterceptor = New MessageInterceptor(InterceptionAction.Notify)
_smsInterceptor.MessageCondition = New MessageCondition(MessageProperty.Body, _
MessagePropertyComparisonType.StartsWith, "www")
EndIf
AddHandler _smsInterceptor.MessageReceived, New MessageInterceptorEventHandler(AddressOf SmsInterceptor_MessageReceived)
EndSub
PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
_smsInterceptor.EnableApplicationLauncher(_appId)
EndSub
PrivateSub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
_smsInterceptor.DisableApplicationLauncher()
EndSub
EndClass
' ------------------------------------------------------------------------
But trouble is, that this:
AddHandler _smsInterceptor.MessageReceived, New MessageInterceptorEventHandler(AddressOf SmsInterceptor_MessageReceived)
I thing that this not see incomming message....and I dont know why.....???
When I see registers then in folder INBOX/RULES I see Rules which set this code, but when comes SMS then nothing is happen...
Idont know , what can I do, please very much, very,very, I need help, please for advice.
I have windows mobile 6.3
HTC mobile phone
All is functioned, but receiving sms I cant solve,
please very much for advice
Thank you and nice day
Related
Hi there!
Does anyone here uses the GSmart i120 from Gigabyte?
If so, I've got alot of questions about it.
I'm so used to using a phone with a numeric keypad, Like Nokia to compose SMS using one hand.
Now that I have this GSmart i120, I thought it works the same as a Nokia when typing SMS using the keypad..But I was wrong.
It has this input thing called "Smart Keypad" which is not so Smart as I find it really dumb and stupid.
It lets you type in the text or characters using the keypad alright, but it has this lag or wait time that is really slow that you have to wait maybe 1.5 seconds just to be able to type-in the next character. and if you press another key, then it will type-in the letter or character of that key.
I've found this CAB file for the Phone Pad from another PPC-Phone device (i forgot where it was extracted from) and it sort of works like a Nokia keypad when typing SMS. but it uses the touch-screen LCD. what I'd like to do is maybe modify that CAB file so that it will instead MAP the numeric keypad of my device.
So, my question is can anyone help me in finding a solution to this?
I Have here the code to MAP the hardware keypad, but i don't know how to do it and integrate it with the Phone Pad.
Paste the following code into a module, and call in in the form_load as follows:-
Dim messageWindow As Hwbuttons.hwMessageWindow
Me.messageWindow = New Hwbuttons.hwMessageWindow(Me)
RegisterHKeys.RegisterRecordKey(Me.messageWindow.H wnd)
Imports Microsoft.WindowsCE.Forms
Imports System.Runtime.InteropServices
Public Enum KeyModifiers As Integer
None = 0
Alt = 1
Control = 2
Shift = 4
Windows = 8
Modkeyup = &H1000
End Enum
Public Enum KeysHardware As Integer
Hardware1 = 193
Hardware2 = 194
Hardware3 = 195
Hardware4 = 196
Hardware5 = 202
End Enum
Public Module RegisterHKeys
<DllImport("coredll.dll", Entrypoint:="RegisterHotKey", setLastError:=True)> _
Public Function RegisterHotKey( _
ByVal hWnd As IntPtr, _
ByVal id As Integer, _
ByVal Modifiers As KeyModifiers, _
ByVal key As Integer) As Boolean
End Function
<DllImport("coredll.dll")> _
Private Function UnregisterFunc1( _
ByVal modifiers As KeyModifiers, _
ByVal keyID As Integer) As Boolean
End Function
Public Sub RegisterRecordKey(ByVal hWnd As IntPtr)
UnregisterFunc1(KeyModifiers.Windows, CType(KeysHardware.Hardware1, Integer))
RegisterHotKey(hWnd, CType(KeysHardware.Hardware1, Integer), KeyModifiers.Windows, CType(KeysHardware.Hardware1, Integer))
UnregisterFunc1(KeyModifiers.Windows, CType(KeysHardware.Hardware2, Integer))
RegisterHotKey(hWnd, CType(KeysHardware.Hardware2, Integer), KeyModifiers.Windows, CType(KeysHardware.Hardware2, Integer))
UnregisterFunc1(KeyModifiers.Windows, CType(KeysHardware.Hardware3, Integer))
RegisterHotKey(hWnd, CType(KeysHardware.Hardware3, Integer), KeyModifiers.Windows, CType(KeysHardware.Hardware3, Integer))
UnregisterFunc1(KeyModifiers.Windows, CType(KeysHardware.Hardware4, Integer))
RegisterHotKey(hWnd, CType(KeysHardware.Hardware4, Integer), KeyModifiers.Windows, CType(KeysHardware.Hardware4, Integer))
UnregisterFunc1(KeyModifiers.Windows, CType(KeysHardware.Hardware5, Integer))
RegisterHotKey(hWnd, CType(KeysHardware.Hardware5, Integer), KeyModifiers.Windows, CType(KeysHardware.Hardware5, Integer))
End Sub
Public Class Hwbuttons
Inherits System.Windows.Forms.Form
Public Shared messageWindow As hwMessageWindow
Public Class hwMessageWindow
Inherits messageWindow
Public Const WM_HOTKEY = &H312
Dim example As frmComms
Public Sub New(ByVal example As frmComms)
Me.example = example
End Sub
Protected Overrides Sub WndProc(ByRef msg As Message)
Select Case msg.Msg
Case WM_HOTKEY
'ButtonPressed(msg.WParam.ToInt32())
Return
End Select
MyBase.WndProc(msg)
End Sub
Public Sub ButtonPressed(ByVal button As Integer)
Select Case button
Case KeysHardware.Hardware1
MessageBox.Show("Button 1 pressed!")
Exit Sub
Case KeysHardware.Hardware2
MessageBox.Show("Button 2 pressed!")
Exit Sub
Case KeysHardware.Hardware3
MessageBox.Show("Button 3 pressed!")
Exit Sub
Case KeysHardware.Hardware4
MessageBox.Show("Button 4 pressed!")
Exit Sub
Case KeysHardware.Hardware5
MessageBox.Show("Button 5 pressed!")
Exit Sub
End Select
End Sub
End Class
End Class
End Module
Also, the phone has a TV-recording function, but it records only in 3GP instead of the more decent Mpeg format. Can anyone also help me out with this? I'd sure appreciate it! Thanks.
And also, I think the device doesn't support or doesn't have the AVRCP Bluetooth profile, is there a Hack or a CAB file that I can download so I can have AVRCP support on the GSmart i120?
hello !!
i also use i120 ! can you find a solution for it???
I'm trying to hide the incoming call window, but it's not working.
I declare the functions
Public Declare Function ShowWindow Lib "Coredll" (ByVal hWnd As IntPtr, ByVal iVisible As Integer) As Boolean
Public Declare Function FindWindow Lib "Coredll" (ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr
Then call
ShowWindow(FindWindow("", "Phone - Incoming"), 0)
But the window is still there. And yes the window title is correct. I've been trying to debug for over an hour. I don't get any errors it just doesn't work. Any help is greatly appreciated.
Hi guys,
Anyone know how to do this:
I open Form2 when a button is clicked on Form1. To return back to Form1 I have a button to do so on Form2. However, is it possible to return back to Form1 automatically after Form2 has displayed for a set amount of time - lets say 2 seconds? This way I could do away with the button on Form2 - which is my goal.
Thanks much, magohn
Drop a timer from the tool box on to Form2 and set its interval to 2000 (2 sec). Then insert the following code into the Form.Activated() and Timer.Tick() events
private void Form2_Activated(object sender, EventArgs e)
{
this.timer1.Enabled = true;
}
private void timer1_Tick(object sender, EventArgs e)
{
this.timer1.Enabled = false;
this.Close();
}
Thank you SO much...
Thanks again stephj - I modified your code a little as I needed Form2 to be "re-useable" and repro the same action over and over. Thanks!
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Timer1.Enabled = False
Me.Hide()
Timer1.Enabled = True
End Sub
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Enabled = True
End Sub
I did think afterwards that my example was a bit resource hungry as the Form.Close() method actually destroys the form rather than 'deactivate' it. I threw it together as a quick test, just to prove the point.
Glad it all works.
"I love it when a plan comes together." John "Hannibal" Smith
Hi,
I try to install a Keyboard Hook to get volume key presses in .NET 3.5.
But it fails. Does someone know how to do it?
This is my VB .NET code:
Code:
Imports System.Runtime.InteropServices
Public Delegate Function HookCallback(ByVal nCode As Integer, ByVal wParam As IntPtr, ByVal lParam As intptr) As Integer
Public Class Form1
<MarshalAs(UnmanagedType.FunctionPtr)> _
Private callbackKeyboard As HookCallback
Private Shared hHookKeyboard As Integer = 0
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If hHookKeyboard.Equals(0) Then
callbackKeyboard = New HookCallback(AddressOf KeyboardHookProc)
hHookKeyboard = WinApi.SetWindowsHookEx(WinApi.WH_KEYBOARD_LL, callbackKeyboard, WinApi.GetModuleHandle(Nothing), 0)
If hHookKeyboard.Equals(0) Then
MessageBox.Show("Keyboard Hook Failed:" & vbCrLf & hHookKeyboard.ToString() & vbCrLf & Marshal.GetLastWin32Error(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1)
End If
End If
End Sub
End Class
'API Functions
Public Class WinApi
Public Const WH_KEYBOARD_LL As Integer = 13
Public Structure KBDLLHOOKSTRUCT
Public vkCode As Integer
Public scanCode As Integer
Public flags As Integer
Public time As Integer
Public dwExtraInfo As Integer
End Structure
<DllImport("coredll.dll")> _
Public Shared Function SetWindowsHookEx( _
ByVal idHook As Integer, ByVal HookProc As HookCallback, _
ByVal hInstance As IntPtr, ByVal wParam As Integer) As Integer
End Function
<DllImport("coredll.dll")> _
Public Shared Function GetModuleHandle(ByVal mod2 As String) As IntPtr
End Function
<DllImport("coredll.dll")> _
Public Shared Function CallNextHookEx( _
ByVal idHook As Integer, ByVal nCode As Integer, _
ByVal wParam As IntPtr, ByVal lParam As IntPtr) As Integer
End Function
End Class
glad to claim not vb knowlege at all but I can advice you to search
for c# solutions as everything which can be don in c# can be don as
far as I know in vb.net even if the syntes is horrid
thing is most people who you want to get advice from would never
use vb but if you read their stuff you can with a bit of skill convert it
from c# to vb.net even if it makes baby jesus cry
Well, this Code is inspired by C# code from here.
I know that most .NET developers use C# and not VB so I searched for C# code too. I've already used keyboard hooks in desktop apps but this does not work for .NET CF.
Very strange, I tried the same code in C# and it worked!
So I'll write my app in C#
Whatever language you have written the code in should not make any difference. Take the C# generated .EXE file or .DLL that works, and load it into RED GATE's .NET Reflector.
http://www.red-gate.com/products/reflector/
A freeware download, just agree to the disclaimer etc.
Load your program in it and navigate down until the code appears in the main window. It will show you the C# code that was used to create it. It won't know the variable names but it will replace them with int1,int2,string1,float1 etc.
Here's the clever bit, use the drop down box to switch the language to VB, and it will display the VB code to do the same job. You should be able to spot the difference in the code compared to your own VB original.
Hi ,
I am looking for someone to assist me with a problem that i have with multiple alerts .
i have created pending intents with different requestCode but i do not know how to catch this code in my broadcast handler
here is the relevant code :
Intent intent = new Intent(PROXIMITY_ALERT);
PendingIntent pendingIntent = PendingIntent.getBroadcast(getApplicationContext(), 123, intent , PendingIntent.FLAG_CANCEL_CURRENT);
lm.addProximityAlert(30.28006245, 31.85403462, 200, -1, pendingIntent);
thanks !