| |
|
|
Uwe ''Pascal'' Niemeier | Hi people!
another News Snippet: One dialog to Farbauswahl. CompileMarkSeparationwindow 400,400
$H Windows.ph
usermessages 16
var Ini$="X:Test.ini"************************* Pfad bitte anpassen!
proc ChooseColor2---------------------------------------ChooseColor2
parameters rgb#
declare a#:dim a#,36--CHOOSECOLOR
var Color&=long(rgb#,64)
long a#,0=36,%hwnd,0,Color&,rgb#,11
Color&=if(external("comdlg32","ChooseColorA",a#),long(a#,12),-1)
case Color&>=0:long rgb#,64=Color&
dispose a#
return Color&
endproc-------------------------------------------------------------
declare b#:dim b#,64+4--Array für 16 benutzerdefinierte Farben + gewählte Farbe
var Result&=~GetPrivateProfileStruct("Config","Color",b#,68,addr(Ini$))
ifnot Result&----------Vorgaben, falls Ini noch nicht vorhanden
long b#,0=$FFDDDD,$DDFFDD,$DDDDFF,$FFFFDD,$FFDDFF,$DDFFFF--Definierte Farben
long b#,64=$F0F0F0--Aktuelle Farbe
endif
cls long(b#,64)--zuletzt gewählte Farbe, gelesen aus Ini
while 1
waitinput
case %umessage=16:break
Result&=ChooseColor2(b#)
case Result&>=0:cls Result&
endwhile
~WritePrivateProfileStruct("Config","Color",b#,68,addr(Ini$))
in the Contrast to that profanen ChooseColor becomes here a Memory-Variable transfer, in the as LongInts 16 colours for "Benutzerdefinierte Farben"-boxes + The vorgewählte colour stored are. with verify becomes this aray aktualisiert; The chosen colour becomes additional directly zurückgegeben. with terminate becomes the aray with all colours by API in a Ini written, so it at next Start again read go kann; any colours stand then again available
PS: If one a# and b# To Beginn the Program global "zur general Verwendung" declared/dimensioniert, The whole thing is yet something plainer
Happy solid you all! Pascal |
|
|
| |
|
|
|
Frank Abbing | Hi,
I sustain unfortunately only one leeres Window. |
|
|
| |
|
|
|
Frank Abbing | Ah, Extraklick necessary... then GEHTS. |
|
|
| |
|
|