| |
|
|
Julian Schmidt |
CLS
Pop "&Datei"
AppendMenu 101,"Option1"
Pop "&Bearbeiten"
AppendMenu 201,"Option1"
Var Menu&=External("USER32","GetMenu",%hwnd)
ShowMenu(%hwnd, 0)
While 1
If iskey(18)
ShowMenu(%hwnd, 1)
Waitinput
Case menuitem(101) or menuitem(201) : Messagebox("Menü Angeklickt","INFO",64)
ShowMenu(%hwnd, 0)
EndIf
EndWhile
Proc ShowMenu
Parameters hdl&, modus&
If (modus&=1)
External("USER32","SetMenu",hdl&,Menu&)
ElseIf (modus&=0)
External("USER32","SetMenu",hdl&, 0)
EndIf
ENDPROC
|
|
|
| |
|
|
|
Nico Madysa | The code is a bisschen clumsy, because as long as old not is pressed, rattert The Endlosschleife incessantly round circa round through, what Systemressourcen lavish. rather:
CLS
Pop "&Datei"
AppendMenu 101,"Option1"
Pop "&Bearbeiten"
AppendMenu 201,"Option1"
Var hMenu&=External("USER32","GetMenu",%hwnd)
ShowMenu(%hwnd, hMenu&, 0)
User Messages 261'WM_SYSKEYUP
declare e%, menustatus%
clear e%, menustatus%
Whilenot e%
waitinput
if 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
Parameters hdl&, menu&, mode%
return External("USER32","SetMenu",hdl&,if(mode%, Menu&, 0))
ENDPROC
|
|
|
| |
|
|