Contacts application and event handling

Hi,

i have an app that opens the contacts application and sends WM_CHAR messages to the listview. WHen tracing through the code, i see that the lookup works. For instance, if i send "j" followed by "o", my list will filter with each send character and i will see, for example, only names that contain "jo".

HOWEVER, when i am not in debug mode and stepping through, this does not work. Is ee the text "jo" in the text box, but the listview shows all contacts. I ahve tried adding DOEVENTS and sending WM_PAINT as well as warrping the WM_CHAR with WM_LBUTTONDOWN and WM_LBUTTONUP...all to no avail.

cany anyone please assist me with coming up with a solution




Answer this question

Contacts application and event handling

  • Tom Laird-McConnell

    For the issue in my first post, i have had to use keybd_event api to resolve.  It would be great to know if there is a package or api to do this without having to use p/invoke, but for not, although quite slow, the keybd_event solution works.   I have a different issue related to the the contacts app however:

    From the Phone dialpad screen, this is the code i am using to open the contact summary screen:

    //wrapper to p/invoke GetForeGroundWindow API, but makes sure the app  that is in the foreground is indeed the phone phone app

    IntPtr hWnd =GetForegroundWindow(); 
    XAPI.SendMessage(hWnd , WM_COMMAND, 0x000057FC, 0);

    The above code does indeed open the contact summary screen, however, the app freezes, no code after the above line is executed.  Almost as though the summary screen is being opened modally.  the problem is i cannot dismiss it and none of the hardware keys work...seems to be waiting for something, and i don't know what.  

    Can someone try this to see if they are experiencing the same issue



  • BostonBakedBean

    or, can i use Windows Microsoft.WindowsMobile.PocketOutlook or Microsoft.WindowsMobile.Forms to show the Contacts form and filter it

    I notice that there is a "Microsoft.WindowsMobile.Forms.ChooseContactDialog" available, this seems to show the form modally...so if my the purpose of my app is to launch and filter the contact list then exit, it is not really useful.



  • Contacts application and event handling