Source wurde am 15.07.2007 aus der MMJ-Quellcodesammlung (Dietmar Horn) in die Babyklappe auf XProfan.Com abgelegt:
Toolbar erstellen (2)
------------------------------------------------------------------------------
Toolbar mit Buttons und Icons Win95 (P)Fairware, Freeware...
Sind zwar noch keine echten Toolbarbuttons, dürfte aber für die meisten
Applikationen ausreichen.
(c) 1998 Richard Maurukas
------------------------------------------------------------------------------
DEF ImageList_Create(5) !COMCTL32,ImageList_Create
DEF ImageList_AddIcon(2) !COMCTL32,ImageList_AddIcon
DEF ExtractIcon(3) !SHELL32,ExtractIconA
Def DestroyIcon(1) !USER32.DLL,DestroyIcon
DEF ImageList_Destroy(1) !COMCTL32,ImageList_Destroy
DEF IMAGEList_GetIcon(3) !COMCTL32,ImageList_GetIcon
declare Datei#
dim datei#,255
declare e%,Ende%
declare hImagelist&,ImageHandle&
Hier Zehn Toolbarbuttons
declare Toolbar&,ToolbarEin%
declare Toolbut1%,Toolbut2%,Toolbut3%,Toolbut4%,Toolbut5%
declare Toolbut6%,Toolbut7%,Toolbut8%,Toolbut9%,Toolbut10%
Let hImagelist&=ImageList_Create(16,16,$0001,74,74)Imglist erz.
String datei#,0=shell32.dll
let e%=0
whilenot equ(e%,74)
let ImageHandle&=ExtractIcon(%HINSTANCE,datei#,e%) ORDNER
ImageList_AddIcon(hImagelist&,ImageHandle&)
inc e%
wend
PROC CREATE_TOOLBAR
Toolbar mit allen Elemente erzeugen
let Toolbar&=@control(ToolbarWindow32,,$50800000,0,0,0,0,%Hwnd,200,%Hinstance)
let Toolbut1%=@control(BUTTON,,$50000040, 0,0, 26,26,Toolbar&,201,%HINSTANCE)
let Toolbut2%=@control(BUTTON,,$50000040, 27,0, 26,26,Toolbar&,202,%HINSTANCE)
let Toolbut3%=@control(BUTTON,,$50000040, 53,0, 26,26,Toolbar&,203,%HINSTANCE)
let Toolbut4%=@control(BUTTON,,$50000040, 84,0, 26,26,Toolbar&,204,%HINSTANCE)
let Toolbut5%=@control(BUTTON,,$50000040,110,0, 26,26,Toolbar&,205,%HINSTANCE)
let Toolbut6%=@control(BUTTON,,$50000040,137,0, 26,26,Toolbar&,206,%HINSTANCE)
let Toolbut7%=@control(BUTTON,,$50000040,168,0, 26,26,Toolbar&,207,%HINSTANCE)
let Toolbut8%=@control(BUTTON,,$50000040,195,0, 26,26,Toolbar&,208,%HINSTANCE)
let Toolbut9%=@control(BUTTON,,$50000040,222,0, 26,26,Toolbar&,209,%HINSTANCE)
let Toolbut10%=@control(BUTTON,,$50000040,400,0, 26,26,Toolbar&,210,%HINSTANCE)
let ImageHandle&=ImageList_GetIcon(himagelist&,20,$0001)
sendmessage(Toolbut1%,$0F7,1,Imagehandle&) BM_SETIMAGE
let ImageHandle&=ImageList_GetIcon(himagelist&,69,$0001)
sendmessage(Toolbut2%,$0F7,1,Imagehandle&) BM_SETIMAGE
let ImageHandle&=ImageList_GetIcon(himagelist&,4,$0001)
sendmessage(Toolbut3%,$0F7,1,Imagehandle&) BM_SETIMAGE
let ImageHandle&=ImageList_GetIcon(himagelist&,63,$0001)
sendmessage(Toolbut4%,$0F7,1,Imagehandle&) BM_SETIMAGE
let ImageHandle&=ImageList_GetIcon(himagelist&,62,$0001)
sendmessage(Toolbut5%,$0F7,1,Imagehandle&) BM_SETIMAGE
let ImageHandle&=ImageList_GetIcon(himagelist&,59,$0001)
sendmessage(Toolbut6%,$0F7,1,Imagehandle&) BM_SETIMAGE
let ImageHandle&=ImageList_GetIcon(himagelist&,43,$0001)
sendmessage(Toolbut7%,$0F7,1,Imagehandle&) BM_SETIMAGE
let ImageHandle&=ImageList_GetIcon(himagelist&,13,$0001)
sendmessage(Toolbut8%,$0F7,1,Imagehandle&) BM_SETIMAGE
let ImageHandle&=ImageList_GetIcon(himagelist&,10,$0001)
sendmessage(Toolbut9%,$0F7,1,Imagehandle&) BM_SETIMAGE
let ImageHandle&=ImageList_GetIcon(himagelist&,39,$0001)
sendmessage(Toolbut10%,$0F7,1,Imagehandle&) BM_SETIMAGE
let Toolbarein%=1
ENDPROC
Window 0,0-640,480
Windowtitle Toolbar mit Profan, 1998 Richard Maurukas
POPUP Datei
Appendmenu 101,Toolbar ein
Appendmenu 102,Toolbar aus
SEPARATOR
Appendmenu 199,Beenden
Settruecolor 1
cls rgb(0,0,128)
CREATE_TOOLBAR
Whilenot Ende%
Waitinput
if Menuitem(101)
case equ(ToolbarEin%,0): CREATE_TOOLBAR
ELSEIF Menuitem(102)
destroywindow(Toolbar&)
Let ToolbarEin%=0
ELSEIF Menuitem(199)
let Ende%=1
ELSEIF equ(Toolbarein%,1)
Die Toolbar nur abfragen wenn sie eingeschaltet ist.
If getfocus(Toolbut10%)
let Ende%=1
endif
Endif
wend
dispose datei#
ImageList_Destroy(Himagelist&)