How to programmatically open the application menu in a .NET CF 2.0 application

Posted by PabloG on Stack Overflow See other posts from Stack Overflow or by PabloG
Published on 2010-05-20T16:00:13Z Indexed on 2010/05/23 7:10 UTC
Read the original article Hit count: 637

Filed under:
|
|

I'm developing an C# / .NET CF 2.0 application: it's supposed to be used with the touchscreen deactivated, then, I'm looking for a way to programmatically open the application menu (not the Windows menu).

Looking here I tried to adapt the code to the .NET CF 2 but it doesn't work (no error messages neither)

public const int WM_SYSCOMMAND = 0x0112;
public const int SC_KEYMENU = 0xF100;

private void cmdMenu_Click(object sender, EventArgs e)
{
        Message msg = Message.Create(this.Handle, WM_SYSCOMMAND, 
            new IntPtr(SC_KEYMENU), IntPtr.Zero);

        MessageWindow.SendMessage(ref msg);
}

Any ideas?

TIA, Pablo


After Hans answer, I edited the code to

Message msg = Message.Create(this.Handle, WM_SYSCOMMAND, 
    new IntPtr(SC_KEYMENU), new IntPtr(115));  // 's' key

and added a submenu option as &Search, but it doesn't make any difference

© Stack Overflow or respective owner

Related posts about c#

Related posts about windows-mobile