>>>I was kind of confused reading your answer. I had tested it with _vfp.hwnd and thisform.hwnd prior to posting
>>>
>>>Anyway, glad it helps - when your form has a caption, this is
>>
>>So now I need a good idea how to invoke it. Normaly this should be "Alt"+"-" but VFP for some reasons does not open the menu (that's why I end up trying to open it via code). "Alt"+"-" otoh will not be traceable via KEYPRESS.
>>
>>Any suggestions how to solve this?
>
>If I have understood well -
>
>
>#define WM_COMMAND 0x0111
>#define WM_SYSCOMMAND 0x0112
>
>#define SC_SIZE 0xF000
>#define SC_MOVE 0xF010
>#define SC_MINIMIZE 0xF020
>#define SC_MAXIMIZE 0xF030
>#define SC_NEXTWINDOW 0xF040
>#define SC_PREVWINDOW 0xF050
>#define SC_CLOSE 0xF060
>#define SC_VSCROLL 0xF070
>#define SC_HSCROLL 0xF080
>#define SC_MOUSEMENU 0xF090
>#define SC_KEYMENU 0xF100
>#define SC_ARRANGE 0xF110
>#define SC_RESTORE 0xF120
>#define SC_TASKLIST 0xF130
>#define SC_SCREENSAVE 0xF140
>#define SC_HOTKEY 0xF150
>
>#define SC_DEFAULT 0xF160
>
>#define WM_CHAR 0x0102
>
>#if .f.
>
>=postmessage(m.thisform.hwnd, WM_SYSCOMMAND, SC_KEYMENU, 0)
>=postmessage(m.thisform.hwnd, WM_CHAR , asc(space(1)), 0)
>=postmessage(m.thisform.hwnd, WM_CHAR , asc('x'), 0)
>
>#else
>
>=postmessage(m.thisform.hwnd, WM_SYSCOMMAND, SC_MAXIMIZE, 0)
>
>#endif
>
(@.@ )
If I undersand your code it maximes the form via postmessage.
This is not my problem.
I know (thank you) how to open the windows menu (formerly known as windows system menu).
The problem I have now is the catch the keycombination that should do this.
Windows standard would be "Alt"+"-". A plain VFP form will not act as supposed, the windows menu will not open on this key.
I like to use keypress to read the key and call your code, but Keypress will not be calles if I hit "Alt"+"-".
So this is my problem, how to invoke the windows menu if I hit "Alt"+"-"
Agnes
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord
Weeks of programming can save you hours of planning.
OffThere is no place like [::1]