| |
|
|
Julian Schmidt |
CLS
Popup "&Datei"
AppendMenu 101,"Option1"
Popup "&Bearbeiten"
AppendMenu 201,"Option1"
Var Menu&=Externo("USER32","GetMenu",%hwnd)
ShowMenu(%hwnd, 0)
Mientras que 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
Parámetros hdl&, modus&
If (modus&=1)
Externo("USER32","SetMenu",hdl&,Menu&)
ElseIf (modus&=0)
Externo("USER32","SetMenu",hdl&, 0)
EndIf
ENDPROC
|
|
|
| |
|
|
|
Nico Madysa | Der Code es una bisschen ungeschickt, porque solange Alt no gedrückt es, rattert el Endlosschleife pausenlos Runde en Runde por, qué Systemressourcen verschwendet. Besser:
CLS
Popup "&Datei"
AppendMenu 101,"Option1"
Popup "&Bearbeiten"
AppendMenu 201,"Option1"
Var hMenu&=Externo("USER32","GetMenu",%hwnd)
ShowMenu(%hwnd, hMenu&, 0)
Mensajes del usuario 261'WM_SYSKEYUP
declarar e%, menustatus%
clear e%, menustatus%
Sinestar encargado 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
Parámetros hdl&, menu&, modus%
volver Externo("USER32","SetMenu",hdl&,if(modus%, Menu&, 0))
ENDPROC
|
|
|
| |
|
|