| |
|
|
| Sortieren muß´man zwar per Hand, sonst aber wohl ganz brauchbar. Will mal hoffen, daß das hier noch nirgendwo steht... KompilierenMarkierenSeparierenDef @InitCommonControlsEx(1) !COMCTL32,InitCommonControlsEx
DEF @ImageList_Create(5) !COMCTL32,ImageList_Create
DEF @ImageList_AddIcon(2) !COMCTL32,ImageList_AddIcon
DEF @ImageList_Destroy(1) !COMCTL32,ImageList_Destroy
DEF @GetModuleHandle(1) !KERNEL32,GetModuleHandleA
DEF @LoadIcon(2) ! USER32,LoadIconA
DEF @GetProcAddress(2) !KERNEL32,GetProcAddress
USERMESSAGES $0010
Declare INITC#,ComoBoxEx&,Imagelist&,Iconname$
Declare ExecuteHandle&,Hicon&,CBINSERT#,M_VORHANDEN&
Declare Proc_Name$,MHandle&,M_NAME$
LET PROC_NAME$=InitCommonControlsEx
LET M_NAME$=COMCTL32.DLL
LET MHANDLE&=@GetModuleHandle(@ADDR(M_NAME$))
LET M_VORHANDEN&=@GetProcAddress(MHANDLE&,@ADDR(PROC_NAME$))
Proc ComBoBoxInsertEx
Parameters Inserttext$,CBHandle&,Icon1&,Icon2&
Declare CBTEXT#
DIM CBINSERT#,36
DIM CBTEXT#,256
Clear CBINSERT#
String CBTEXT#,0=Inserttext$
Long CBINSERT#,0=$1 | $2 | $4 | $8
Long CBINSERT#,8=CBTEXT#
Long CBINSERT#,12=Icon1&
Long CBINSERT#,16=Icon2&
Long CBINSERT#,20=Icon1&
IF M_VORHANDEN&=0
@ADDCHOICE(CBHandle&,Inserttext$)
else
@SendMessage(CBHandle&,$401,0,CBINSERT#)
endif
Dispose CBINSERT#
Dispose CBTEXT#
EndProc
DIM INITC#,8
long INITC#,0=8
long INITC#,4=$200
Windowstyle 31+512
Windowtitle ComboboxEx
Window 0,0-640,440
If M_VORHANDEN&=0
LET ComoBoxEx&=@Control(ComboBox,,$40000000+$10000000+$200000+$100000+2+$40,0,100,150,180,%HWND,2115,%HINSTANCE)
else
@InitCommonControlsEx(INITC#)
Let Imagelist&=@ImageList_Create(16,16,$0001,3,3) Imagelist erzeugen
Let ExecuteHandle&=@GetModuleHandle(0) Handle des laufenden Programms
LET ICONNAME$=Weg
Let Hicon&=@loadicon(Executehandle&,@ADDR(Iconname$)) Handle des Icons ok
@ImageList_AddIcon(Imagelist&,HIcon&)
LET ICONNAME$=Windows
Let Hicon&=@loadicon(Executehandle&,@ADDR(Iconname$)) Handle des Icons ok
@ImageList_AddIcon(Imagelist&,HIcon&)
LET ComoBoxEx&=@Control(ComboBoxEx32,,$40000000+$10000000+$200000+$100000+2+$40,0,100,150,180,%HWND,2115,%HINSTANCE)
@Sendmessage(ComoBoxEx&,$402,0,Imagelist&)
endif
ComBoBoxInsertEx Claudia,ComoBoxEx&,0,0
ComBoBoxInsertEx Andreas,ComoBoxEx&,1,1
ComBoBoxInsertEx Dennis,ComoBoxEx&,0,0
While %UMESSAGE<>$0010
Waitinput
Drawtext 0,0,@Gettext$(ComoBoxEx&)+@Space$(255)
Wend
@ImageList_Destroy(Imagelist&)lass=s4 href='./../../funktionsreferenzen/xprofan/dispose/'>Dispose INITC#
Saluto
AH |
|
|
| |
|
|