| |
|
|
 |
Description:
CreatePopupMenu created one Popupmenü and gives which lever back.
Deklaration:
DEF @CreatePopupMenu(0) !USER32,CreatePopupMenu
Parameter:
These function has no Parameter.
Return Value:
with failure 0, otherwise the lever the begot Popupmenüs.
Examples:
CompileMarkSeparationWindowstyle 31+512
Windowtitle "Trackmenü mit Checkfunktion über API"
Window 0,0-640,440
DEF @CreatePopupMenu(0) !"USER32","CreatePopupMenu"
DEF @AppendMenuEx(4) !"USER32","AppendMenuA"
DEF @TrackPopupMenu(7) !"USER32","TrackPopupMenu"
DEF @CheckMenuItem(3) !"USER32","CheckMenuItem"
Def @DestroyMenu(1) !"USER32","DestroyMenu"
Declare Checkmerker%
Declare Menuhandle&,ITEM#
Das Menü wird erzeugt
LET Menuhandle&=@CreatePopupMenu()
DIM Item#,255
String Item#,0="&Messagebox"
@AppendMenuEx(Menuhandle&,0,101,ITEM#)
Dispose Item#
DIM Item#,255
String Item#,0="&Check"
@AppendMenuEx(Menuhandle&,0,102,ITEM#)
Dispose item#
While %Menuitem<>-2
Waitinput
IF @equ(%MouseKey,2) Rechte Maustaste gedrückt?
@TrackPopupMenu(Menuhandle&,2,%mousex+5,%Mousey-10,0,%HWND,0) Menü wird angezeigt..
IF @equ(%MENUITEM,102)
LET CHECKMERKER%=@NOT(Checkmerker%) Zustandsänderung merken...
@CheckMenuItem(Menuhandle&,102,@mul(Checkmerker%,8)) Ähnlich wie der Befehl Checkmenü!
ELSEIF @equ(%MENUITEM,101)
@Messagebox("Menüpunkt eins geklickt!","Hinweis",64)
ENDIF
endif
wend
@DestroyMenu(Menuhandle&) Speicher enable
[keywords:20ad1ea429] Menu Popupmemü create produce [/keywords:20ad1ea429] |
|
|
| |
|
|