Home > Archive > Smartphone Developer Forum > April 2006 > Programatically displaying a softkey sub menu.
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Programatically displaying a softkey sub menu.
|
|
|
| Hi,
I have trapped the softkeys and when the user presses the button I wish to
programatically display the submenu but can't work out how.
(The reason is unimportant but for information I
hide the menus until the key is pressed. So the menu goes from being hidden
to display the menbar and the submenu with one keypress. I then wish to hide
the whole menubar when the softkey is pressed again)
eg
SendMessage (SHFindMenuBar (hDlg), SHCMBM_OVERRIDEKEY, VK_TSOFT2,
MAKELPARAM (SHMBOF_NODEFAULT | SHMBOF_NOTIFY,
SHMBOF_NODEFAULT));
Then (pseudo)
OnKeyDown()
case VK_TSOFT2:
HMENU hPopupMenu = (HMENU) SendMessage(hMenuMB,
SHCMBM_GETSUBMENU, 0,
IDM_POP);
So I have the handle of the submenu, but what to do with it?
IDM_POP is the ID of the popup displayed by <soft2>. But how do I prompt the
submenu to display?
I have tried various ways without success.
eg
SendMessage(hDlg, WM_COMMAND, (WPARAM)IDM_POP, 0);
SendMessage(hDlg, WM_COMMAND, (WPARAM)hPopupMenu , 0);
As you can see I havn't a clue - Any help appreciated.
TIA
| |
| Daniel Moth 2006-04-30, 7:10 pm |
| Try mouse_event:
http://www.danielmoth.com/Blog/2004/11/mouseevent.html
Cheers
Daniel
--
http://www.danielmoth.com/Blog/
"Jo" <test@nothere.com> wrote in message
news:vfydncyCx_xL7dvZRVny0A@pipex.net...
> Hi,
>
> I have trapped the softkeys and when the user presses the button I wish to
> programatically display the submenu but can't work out how.
>
> (The reason is unimportant but for information I
> hide the menus until the key is pressed. So the menu goes from being
> hidden
> to display the menbar and the submenu with one keypress. I then wish to
> hide
> the whole menubar when the softkey is pressed again)
>
> eg
>
> SendMessage (SHFindMenuBar (hDlg), SHCMBM_OVERRIDEKEY, VK_TSOFT2,
> MAKELPARAM (SHMBOF_NODEFAULT | SHMBOF_NOTIFY,
> SHMBOF_NODEFAULT));
>
> Then (pseudo)
>
> OnKeyDown()
> case VK_TSOFT2:
> HMENU hPopupMenu = (HMENU) SendMessage(hMenuMB,
> SHCMBM_GETSUBMENU, 0,
> IDM_POP);
>
> So I have the handle of the submenu, but what to do with it?
> IDM_POP is the ID of the popup displayed by <soft2>. But how do I prompt
> the
> submenu to display?
>
> I have tried various ways without success.
>
> eg
>
> SendMessage(hDlg, WM_COMMAND, (WPARAM)IDM_POP, 0);
> SendMessage(hDlg, WM_COMMAND, (WPARAM)hPopupMenu , 0);
>
> As you can see I havn't a clue - Any help appreciated.
>
> TIA
>
>
>
>
>
>
>
>
>
|
|
|
|
|