Re: Listbox API
- From: "Peter Foot" <feedback@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 6 Aug 2008 10:33:45 +0100
Specifically this page (http://msdn.microsoft.com/en-us/library/aa921561.aspx) lists the supported messages on Windows CE / Mobile. GEtLISTBOXINFO is not supported on devices.
Peter
--
Peter Foot
Microsoft Device Application Development MVP
peterfoot.net | appamundi.com | inthehand.com
APPA Mundi Ltd - Software Solutions for a Mobile World
In The Hand Ltd - .NET Components for Mobility
"Christian Resma Helle" <xtianism@xxxxxxxxx> wrote in message news:04A32CC9-1F59-4336-9316-6F9BAA1F47CD@xxxxxxxxxxxxxxxx
The Windows Mobile Platform SDK documentation is the first place I would check to see what messages are supported or not.
--
Regards,
Christian Resma Helle
http://christian-helle.blogspot.com
"ME" <trash.trash@xxxxxxxxxxxxxxxxxxxxx> wrote in message news:BrGdnQik_KSXhQTVnZ2dnUVZ_rbinZ2d@xxxxxxxxxxxxxxIn the full framework I can use P/Invoke to obtain the values of another process' listbox. Can this be done using the Compact Framework 2.0 on a Win Mobile 6 device? If so how? I have tried using SendMessage to send various LB_XXXXX messages (like LB_GETLISTBOXINFO or LB_GETTEXTLEN) but all I get is a zero result. I checked the Marshal.GetLastWin32Error() method and it reports 87 for every LB_XXXXXXXXX call I make. This indicates (I think) that a parameter is wrong. However I am using the same syntax for the send message that I would do in the full framework (which as I have said works fine). Is there a different set of "messages" that can be sent to a listbox for Windows Mobile devices? Also when looking at the "message syntax" on MSDN it makes no reference to windows mobile devices (just win3.1 and higher), is there a reference provided by Microsoft for the windows Mobile messages that are available? Is obtaining the list items from another process even possible in Windows Mobile via the CF?
My method signature is as follows:
[DllImport("coredll.dll", CharSet = CharSet.Auto, SetLastError = false)]
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
An example call to sendmessage to get the list count is:
IntPtr listBoxPointer = new IntPtr(2080894016); //or some other handle depending on the window
IntPtr result = IntPtr.Zero;
uint LB_GETLISTBOXINFO = 0x01B2;
result = SendMessage(listBoxPointer, LB_GETLISTBOXINFO, IntPtr.Zero, IntPtr.Zero);
//this results in:
//result.ToInt32() == 0;
//Marshal.GetLastWin32Error() == 87;
.
- Follow-Ups:
- Re: Listbox API
- From: ME
- Re: Listbox API
- References:
- Listbox API
- From: ME
- Re: Listbox API
- From: Christian Resma Helle
- Listbox API
- Prev by Date: Re: Listbox API
- Next by Date: Re: Mobile 6 connection to SQL Express
- Previous by thread: Re: Listbox API
- Next by thread: Re: Listbox API
- Index(es):
Relevant Pages
|