Click here to Skip to main content
15,902,189 members
Home / Discussions / Mobile
   

Mobile

 
Questionhow i can print from ppc (windows mobile) to usb printer ? Pin
E_Gold13-Oct-09 1:11
E_Gold13-Oct-09 1:11 
AnswerRe: how i can print from ppc (windows mobile) to usb printer ? Pin
Joel Ivory Johnson8-Nov-09 3:01
professionalJoel Ivory Johnson8-Nov-09 3:01 
QuestionMaking a program act the same way when a phone call is received? Pin
Ayman Alterawi12-Oct-09 22:16
Ayman Alterawi12-Oct-09 22:16 
Questionhow to use atlhttp in the atl based activex control project? Pin
cnflat11-Oct-09 22:31
cnflat11-Oct-09 22:31 
QuestionVS 2008 for mobile - first steps - how to test with data from local pc Pin
juergjakob11-Oct-09 22:25
juergjakob11-Oct-09 22:25 
AnswerRe: VS 2008 for mobile - first steps - how to test with data from local pc Pin
Joel Ivory Johnson8-Nov-09 3:00
professionalJoel Ivory Johnson8-Nov-09 3:00 
QuestionUsing Listbox. Pin
renoma11-Oct-09 17:28
renoma11-Oct-09 17:28 
QuestionWindows Mobile "Service like" App. Pin
jakeshelm10-Oct-09 12:09
jakeshelm10-Oct-09 12:09 
Hi All

I am having a little trouble with the code below. I am trying to create an application that acts kind of like a service for windows mobile, but everytime I debug, it simply end and it should remain resident in the memory to intercept the sms and check if it meets a certain criteria.

Please help meConfused | :confused:

Imports Microsoft.WindowsMobile.PocketOutlook.MessageInterception<br />
Imports HWButton.TAPI<br />
Imports Microsoft.WindowsMobile.PocketOutlook<br />
Imports Microsoft.Win32<br />
Imports System.Runtime.InteropServices<br />
<br />
<br />
Module Module1<br />
    Public SMSCap As MessageInterceptor = Nothing<br />
    Dim imsi As String<br />
    Dim Recipient As String<br />
    Const RegKey As String = "Software\InterCept\WM65"<br />
    Public SMSSend As SmsMessage<br />
    Dim ResponseNum As String<br />
    Dim oldimsi As String<br />
    Public Class ProcessInfo<br />
        Public hProcess As IntPtr<br />
        Public hThread As IntPtr<br />
        Public ProcessID As IntPtr<br />
        Public ThreadID As IntPtr<br />
    End Class<br />
<br />
    <DllImport("CoreDll.DLL", SetLastError:=True)> _<br />
    Private Function CreateProcess(ByVal imageName As [String], ByVal cmdLine As [String], ByVal lpProcessAttributes As IntPtr, ByVal lpThreadAttributes As IntPtr, ByVal boolInheritHandles As Int32, ByVal dwCreationFlags As Int32, _<br />
    ByVal lpEnvironment As IntPtr, ByVal lpszCurrentDir As IntPtr, ByVal si As Byte(), ByVal pi As ProcessInfo) As Integer<br />
    End Function<br />
<br />
    <DllImport("coredll")> _<br />
    Private Function CloseHandle(ByVal hObject As IntPtr) As Boolean<br />
    End Function<br />
<br />
    <DllImport("coredll")> _<br />
    Private Function WaitForSingleObject(ByVal hHandle As IntPtr, ByVal dwMilliseconds As UInteger) As UInteger<br />
    End Function<br />
<br />
    <DllImport("coredll.dll", SetLastError:=True)> _<br />
    Private Function GetExitCodeProcess(ByVal hProcess As IntPtr, ByRef lpExitCode As Integer) As Integer<br />
    End Function<br />
<br />
    Private Sub LaunchApp(ByVal strPath As String, ByVal strParms As String)<br />
        Dim pi As New ProcessInfo()<br />
        Dim si As Byte() = New Byte(127) {}<br />
        CreateProcess(strPath, strParms, IntPtr.Zero, IntPtr.Zero, 0, 0, _<br />
        IntPtr.Zero, IntPtr.Zero, si, pi)<br />
        ' This line can be commented out if you do not want <br />
        ' to wait for the process to exit<br />
        'WaitForSingleObject(pi.hProcess, &HFFFFFFFF)<br />
        Dim exitCode As Integer = 0<br />
        GetExitCodeProcess(pi.hProcess, exitCode)<br />
        CloseHandle(pi.hProcess)<br />
        CloseHandle(pi.hThread)<br />
        Exit Sub<br />
    End Sub<br />
<br />
    Private Sub SMSCap_MessageReceived(ByVal sender As Object, ByVal e As MessageInterceptorEventArgs)<br />
        Dim sender1<br />
        Dim comms<br />
        Dim command As String<br />
        Dim req As String<br />
        sender1 = ((DirectCast(e.Message, SmsMessage).From.Address))<br />
        Recipient = (sender1.ToString)<br />
        comms = ((DirectCast(e.Message, SmsMessage).Body))<br />
        command = (comms.ToString)<br />
        '*************** Commands ***********<br />
        req = (command.Substring(4, command.Length - 4)).ToLower<br />
        Select Case req<br />
            Case ("prg")<br />
                MsgBox("It works")<br />
        End Select<br />
    End Sub<br />
<br />
    Private Sub VerifyKeys()<br />
        Dim HKCU As RegistryKey = Registry.LocalMachine<br />
        Dim VeriKey As RegistryKey = HKCU.OpenSubKey(RegKey, True)<br />
        ResponseNum = VeriKey.GetValue("RPNum")<br />
    End Sub<br />
    Sub Main()<br />
        If MessageInterceptor.IsApplicationLauncherEnabled("InterCept") Then<br />
            SMSCap = New MessageInterceptor("InterCept")<br />
        Else<br />
            SMSCap = New MessageInterceptor(InterceptionAction.NotifyAndDelete)<br />
            SMSCap.MessageCondition = New MessageCondition(MessageProperty.Body, MessagePropertyComparisonType.StartsWith, "cmd", False)<br />
            SMSCap.EnableApplicationLauncher("InterCept", "\\Program Files\\DeviceApplication1\\DeviceApplication1.exe")<br />
        End If<br />
        AddHandler SMSCap.MessageReceived, AddressOf SMSCap_MessageReceived<br />
        PhoneInfo.Get(Nothing, Nothing, Nothing, Nothing, imsi)<br />
        Dim HKCU As RegistryKey = Registry.LocalMachine<br />
        Dim VeriKey As RegistryKey = HKCU.OpenSubKey(RegKey, True)<br />
        If imsi = VeriKey.GetValue("RegCode") Then<br />
<br />
        Else<br />
            SMSSend = New SmsMessage(ResponseNum, "ATT! Sim changed on phone. Send Tracking commands to this number!")<br />
            SMSSend.Send()<br />
        End If<br />
    End Sub<br />
<br />
End Module<br />

AnswerRe: Windows Mobile "Service like" App. Pin
Joel Ivory Johnson8-Nov-09 2:56
professionalJoel Ivory Johnson8-Nov-09 2:56 
QuestionMigration of a CE 5.0 product to Windows Mobile 6.5 Pin
Noushad Ali8-Oct-09 19:30
Noushad Ali8-Oct-09 19:30 
QuestionKeyboard hook doesn't work with Windows Media Player? Pin
ponchofiesta8-Oct-09 1:53
ponchofiesta8-Oct-09 1:53 
Questionhow to download makeCF utility Pin
pri_skit6-Oct-09 3:16
pri_skit6-Oct-09 3:16 
AnswerRe: how to download makeCF utility Pin
Richard MacCutchan6-Oct-09 4:36
mveRichard MacCutchan6-Oct-09 4:36 
GeneralRe: how to download makeCF utility Pin
pri_skit6-Oct-09 5:00
pri_skit6-Oct-09 5:00 
GeneralRe: how to download makeCF utility Pin
Richard MacCutchan6-Oct-09 5:10
mveRichard MacCutchan6-Oct-09 5:10 
QuestionNokia WRT Plug-in 2.2 for Aptana Studio Pin
mobogeek5-Oct-09 19:12
mobogeek5-Oct-09 19:12 
AnswerRe: Nokia WRT Plug-in 2.2 for Aptana Studio Pin
Nathan Campos10-Oct-09 1:45
Nathan Campos10-Oct-09 1:45 
QuestionActive scan on a WiFi NIC, including flush of old scan results - how ? Pin
amitalonm4-Oct-09 3:14
amitalonm4-Oct-09 3:14 
QuestionReading data from and from phone and PC Pin
Member 8859723-Oct-09 3:19
Member 8859723-Oct-09 3:19 
Question[Message Deleted] Pin
hande543-Oct-09 2:06
hande543-Oct-09 2:06 
AnswerRe: get the data with PDA through usb connection Pin
annathor7-Oct-09 23:03
annathor7-Oct-09 23:03 
QuestionLanguage/Framework choice for Windows Mobile app Pin
nativebyte2-Oct-09 0:33
nativebyte2-Oct-09 0:33 
AnswerRe: Language/Framework choice for Windows Mobile app Pin
Joel Ivory Johnson2-Oct-09 1:38
professionalJoel Ivory Johnson2-Oct-09 1:38 
GeneralRe: Language/Framework choice for Windows Mobile app Pin
nativebyte2-Oct-09 2:06
nativebyte2-Oct-09 2:06 
QuestionPortible Email Client for Embedded OEM system Pin
Kobib1-Oct-09 3:16
Kobib1-Oct-09 3:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.