Beitrag, 15.07.2007 23:26: ;createCode()'Source wurde am 15.07.2007 aus der MMJ-Quellcodesammlung (Dietmar Horn) in die Babyklappe auf XProfan.Com abgelegt:
'Farbauswahldialog anzeigen und abfragen
Def Choosecolor(1) !"COMDLG32","ChooseColorA"
Declare Choosecolor#,Customcolors#,Colors&[16],Button&,Ok&
Proc Colordialog
Parameters Color&,Options&,Inifile$,Result&,Name$
Declare I%
Dim Choosecolor#,36
Dim Customcolors#,64
Settruecolor 1
While Lt(I%,16)
Long Customcolors#,Mul(I%,4)= Colors&[I%]
Inc I%
Wend
Long Choosecolor#,0=36
Long Choosecolor#,4=Getactivewindow()
Long Choosecolor#,8=0
Long Choosecolor#,12=Rgb(192,192,192)
Long Choosecolor#,16=Customcolors#
Long Choosecolor#,20=3'CC_RGBINIT(1) + CC_FULLOPEN(2)
Long Choosecolor#,24=0
Long Choosecolor#,28=0
Let Name$="Fensterfarbe wählen!"
Long Choosecolor#,32=0
Let Ok&=@Choosecolor(Choosecolor#)
If Ok&0
Let I%=0
While Lt(I%,16)
Let Colors&[I%]=Long(Customcolors#,Mul(I%,4))
Inc I%
Wend
Endif
Let Result&=@Long(Choosecolor#,12)
Dispose Choosecolor#
Dispose Customcolors#
Return Result&
Endproc
Windowstyle 31
Windowtitle "Farbe auswählen"
Window 0,0-640,440
Settruecolor 1
Let Button&=@Createbutton(%Hwnd,"Farbe wählen",20,300,200,30)
While 0=0
Waitinput
If @Getfocus(Button&)
Colordialog
Case Ok&0 : Cls @&(0)
Endif
Wend
Dies ist die Offlinevariante vom Thread [Farbauswahldialog anzeigen und abfragen].
©2006 XProfan.Com