 |
AutoHotkey Community Wir helfen uns gegenseitig aus der Patsche
|
| Vorheriges Thema anzeigen :: Nächstes Thema anzeigen |
| Autor |
Nachricht |
MySystem Gast
|
Verfasst am: Di Aug 19, 2008 6:58 pm Titel: Text farbe wachseln |
|
|
moin,
also ich habe schon ein kleines script fertig nur hebkomm ichs nicht hin der der text sein farbe ändert.
d.h.
| Code: |
Gui, font, s12 w20, Arial
Gui, Add, Text, h18, Firmware update in progress
Gui, Add, Text, h18, Flashing sector 0
Gui, Add, Text, h18, Verify sector 0
Gui, Add, Text, h18, Flashing sector 1
Gui, Add, Text, h18, Verify sector 1
Gui, Add, Text, h18, Flashing sector 2
Gui, Add, Text, h18, Verify sector 2
Gui, Add, Text, h18, Flashing sector 3
Gui, Add, Text, h18, Verify sector 3
Gui, Add, Text, h18, Flashing sector 4
Gui, Add, Text, h18, Verify sector 4
Gui, Add, Text, h18, Flashing sector 5
Gui, Add, Text, h18, Verify sector 5
Gui, Add, Text, h18, Flashing sector 6
Gui, Add, Text, h18, Verify sector 6
Gui, Add, Text, h18, Flashing sector 7
Gui, Add, Text, h18, Verify sector 7
Gui, Font, cRed Blod, Arial
Gui, Add, Text,ym y42 h18 Hwndflash1 cRed, incomplete
Gui, Add, Text, h18 Hwndverify1 cRed, incomplete
Gui, Add, Text, h18 Hwndflash2 cRed, incomplete
Gui, Add, Text, h18 Hwndverify2 cRed, incomplete
Gui, Add, Text, h18 Hwndflash3 cRed, incomplete
Gui, Add, Text, h18 Hwndverify3 cRed, incomplete
Gui, Add, Text, h18 Hwndflash4 cRed, incomplete
Gui, Add, Text, h18 Hwndverify4 cRed, incomplete
Gui, Add, Text, h18 Hwndflash5 cRed, incomplete
Gui, Add, Text, h18 Hwndverify5 cRed, incomplete
Gui, Add, Text, h18 Hwndflash6 cRed, incomplete
Gui, Add, Text, h18 Hwndverify6 cRed, incomplete
Gui, Add, Text, h18 Hwndflash7 cRed, incomplete
Gui, Add, Text, h18 Hwndverify7 cRed, incomplete
Gui, Add, Text, h18 Hwndflash8 cRed, incomplete
Gui, Add, Text, h18 Hwndverify8 cRed, incomplete
Gui, Add, Button, h29 x20 w280 default gCencel2, Cencel
Gui, Show,, Autoupdater
MsgBox, 1, Firmware Updater 8116, 1,
Control_Colors(flash1, "Set", Green)
MsgBox, 1, Firmware Updater 8116, 1,
Control_Colors(verify1, "Set", Green)
MsgBox, 1, Firmware Updater 8116, 2,
Control_Colors(flash1, "Set", Green)
MsgBox, 1, Firmware Updater 8116, 2,
Control_Colors(verify1, "Set", Green)
MsgBox, 1, Firmware Updater 8116, 3,
Control_Colors(flash1, "Set", Green)
MsgBox, 1, Firmware Updater 8116, 3,
Control_Colors(verify1, "Set", Green)
MsgBox, 1, Firmware Updater 8116, 4,
Control_Colors(flash1, "Set", Green)
MsgBox, 1, Firmware Updater 8116, 4,
Control_Colors(verify1, "Set", Green)
MsgBox, 1, Firmware Updater 8116, 5,
Control_Colors(flash1, "Set", Green)
MsgBox, 1, Firmware Updater 8116, 5,
Control_Colors(verify1, "Set", Green)
MsgBox, 1, Firmware Updater 8116, 6,
Control_Colors(flash1, "Set", Green)
MsgBox, 1, Firmware Updater 8116, 6,
Control_Colors(verify1, "Set", Green)
MsgBox, 1, Firmware Updater 8116, 7,
Control_Colors(flash1, "Set", Green)
MsgBox, 1, Firmware Updater 8116, 7,
Control_Colors(verify1, "Set", Green)
Control_Colors(Hwnd, Msg, wParam, lParam = 0)
{
Critical
Static OldWinProc := "" ; Ursprüngliche Fensterprozedur
Static NewWinProc := "" ; Neue Fensterprozedur
Static SetValue := "Set" ; Werte übernehmen
Static Register := "RCB" ; RegisterCallBack
Static ValueList := "" ; WerteListe
; Aufruf als Fensterprozedur?
If (A_EventInfo <> NewWinProc) {
If (Msg = SetValue) {
If (RegExMatch(ValueList, "m)^" . (Hwnd +0) . "\|")) {
If (wParam = "Default") {
ValueList := RegExReplace(ValueList
, "m)^" . (Hwnd + 0) . "\|.*$"
, "")
} Else {
ValueList := RegExReplace(ValueList
, "m)^" . (Hwnd + 0) . "\|.*$"
, (Hwnd + 0) . "|"
. (wParam + 0) . "|"
. (lParam + 0))
}
} Else {
ValueList .= (Hwnd + 0) . "|"
. (wParam + 0) . "|"
. (lParam + 0) . "`r`n"
}
Return
}
If (Msg = Register) {
If (NewWinProc = "") {
NewWinProc := RegisterCallback("Control_Colors","",4)
OldWinProc := DllCall("SetWindowLong"
, UInt, Hwnd
, Int, -4
, Int, NewWinProc
, UInt)
}
Return
}
Return
}
; 0x0133 : WM_CTLCOLOREDIT
; 0x0138 : WM_CTLCOLORSTATIC
If (Msg = 0x0133 Or Msg = 0x0135 Or Msg = 0x0138) {
If (RegExMatch(ValueList, "m)^"
. (lParam + 0) . "\|(?P<BG>\d+)\|(?P<TX>\d+)$"
, C)) {
DllCall("SetTextColor", UInt, wParam, UInt, CTX)
DllCall("SetBkColor", UInt, wParam, UInt, CBG)
Return, DllCall("CreateSolidBrush", UInt, CBG)
}
}
Return DllCall("CallWindowProcA"
, UInt, OldWinProc
, UInt, Hwnd
, UInt, Msg
, UInt, wParam
, UInt, lParam)
}
|
frage wo ist der fehler und geht das auch einfacher ohne die control_clore fuktion.
Mfg MySystem
Moderator AGermanUser: Thread verschoben. Ins "Skripte & Funktionen" Unterforum gehören nur funktionsfähige Skripte |
|
| Nach oben |
|
 |
BoBo² Gast
|
Verfasst am: Di Aug 19, 2008 7:44 pm Titel: |
|
|
| Zitat: | | ohne die control_clore fuktion | Ja, die control_clore fuktion ist hier gänzlich sinnlos. Macht aber nix, die gibts ja eh nicht in 'Deinem' Code ... |
|
| Nach oben |
|
 |
denick
Anmeldedatum: 15.09.2006 Beiträge: 1230 Wohnort: Berlin
|
Verfasst am: Mi Aug 20, 2008 5:04 am Titel: |
|
|
Moin,
wenn Du nur die Textfarbe der Textfelder ändern willst, geht es in der Tat auch ohne die Funktion:
| Code: | #NoEnv
Gui, +OwnDialogs
Gui, font, s12 w20, Arial
Gui, Add, Text, h18, Firmware update in progress:
Gui, Add, Text, Section h18, Flashing sector 0
Gui, Add, Text, h18, Verify sector 0
Gui, Add, Text, h18, Flashing sector 1
Gui, Add, Text, h18, Verify sector 1
Gui, Add, Text, h18, Flashing sector 2
Gui, Add, Text, h18, Verify sector 2
Gui, Add, Text, h18, Flashing sector 3
Gui, Add, Text, h18, Verify sector 3
Gui, Add, Text, h18, Flashing sector 4
Gui, Add, Text, h18, Verify sector 4
Gui, Add, Text, h18, Flashing sector 5
Gui, Add, Text, h18, Verify sector 5
Gui, Add, Text, h18, Flashing sector 6
Gui, Add, Text, h18, Verify sector 6
Gui, Add, Text, h18, Flashing sector 7
Gui, Add, Text, h18, Verify sector 7
Gui, Add, Text, ys h18 vflash0 cRed, incomplete
Gui, Add, Text, h18 vverify0 cRed, incomplete
Gui, Add, Text, h18 vflash1 cRed, incomplete
Gui, Add, Text, h18 vverify1 cRed, incomplete
Gui, Add, Text, h18 vflash2 cRed, incomplete
Gui, Add, Text, h18 vverify2 cRed, incomplete
Gui, Add, Text, h18 vflash3 cRed, incomplete
Gui, Add, Text, h18 vverify3 cRed, incomplete
Gui, Add, Text, h18 vflash4 cRed, incomplete
Gui, Add, Text, h18 vverify4 cRed, incomplete
Gui, Add, Text, h18 vflash5 cRed, incomplete
Gui, Add, Text, h18 vverify5 cRed, incomplete
Gui, Add, Text, h18 vflash6 cRed, incomplete
Gui, Add, Text, h18 vverify6 cRed, incomplete
Gui, Add, Text, h18 vflash7 cRed, incomplete
Gui, Add, Text, h18 vverify7 cRed, incomplete
Gui, Add, Button, h29 x20 w280 default gCencel2, Cencel
Gui, Show,, Autoupdater
Gui, Font, cGreen Norm
Loop, 8
{
Sector := A_Index - 1
MsgBox, 1, Firmware Updater 8116, Flash Sector %Sector%
IfMsgBox, Cancel
Break
GuiControl, , flash%Sector%, Done!
GuiControl, Font, flash%Sector%
MsgBox, 1, Firmware Updater 8116, Verify Sector %Sector%
IfMsgBox, Cancel
Break
GuiControl, , verify%Sector%, Done!
GuiControl, Font, verify%Sector%
}
Return
GuiClose:
Cencel2:
ExitApp
|
Übrigens ein mutiges Unterfangen. Ich hoffe, Du hast die ursprüngliche Firmware vorher gesichert!?  _________________ Hilfe zur Hilfe
(de)nick |
|
| Nach oben |
|
 |
|
|
Du kannst Beiträge in dieses Forum schreiben. Du kannst auf Beiträge in diesem Forum antworten.
|
Powered by phpBB © 2001, 2005 phpBB Group Deutsche Übersetzung von phpBB.de
|