| |
|
|
Julian Schmidt |
CLS
Popup "&Datei"
AppendMenu 101,"Option1"
Popup "&Bearbeiten"
AppendMenu 201,"Option1"
Var Menu&=Externe("User32","GetMenu",%hwnd)
ShowMenu(%hwnd, 0)
Tandis que 1
Si iskey(18)
ShowMenu(%hwnd, 1)
Waitinput
Cas menuitem(101) or menuitem(201) : Messagebox("Menü Angeklickt","INFO",64)
ShowMenu(%hwnd, 0)
EndIf
Endwhile
Proc ShowMenu
Paramètres hdl&, modus&
Si (modus&=1)
Externe("User32","SetMenu",hdl&,Menu&)
ElseIf (modus&=0)
Externe("User32","SetMenu",hdl&, 0)
EndIf
ENDPROC
|
|
|
| |
|
|
|
Nico Madysa | qui Code est un bisschen ungeschickt, car solange vieux pas gedrückt ist, rattert qui Endlosschleife pausenlos Runde um Runde par, quoi Systemressourcen verschwendet. Besser:
CLS
Popup "&Datei"
AppendMenu 101,"Option1"
Popup "&Bearbeiten"
AppendMenu 201,"Option1"
Var hMenu&=Externe("User32","GetMenu",%hwnd)
ShowMenu(%hwnd, hMenu&, 0)
Utilisateur Messages 261'WM_SYSKEYUP
declare e%, menustatus%
clear e%, menustatus%
Whilenot e%
waitinput
si IsKey(27)
e% = 1
elseif MenuItem(101) or MenuItem(201)
Messagebox("Menü Angeklickt","INFO",64)
elseif iskey(18)
menustatus% = 1
ShowMenu(%hwnd, hMenu&, 1)
elseif menustatus%
menustatus% = 0
ShowMenu(%hWnd, hMenu&, 0)
EndIf
Endwhile
end
Proc ShowMenu
Paramètres hdl&, menu&, modus%
return Externe("User32","SetMenu",hdl&,si(modus%, Menu&, 0))
ENDPROC
|
|
|
| |
|
|