.: MIG33PENAJAM.TK :.

Forum Komunitas Mig33 Penajam Paser Utara
 
IndeksPortalFAQPencarianAnggotaGroupPendaftaranLogin

Share | 
 

 Color Coding ( AHK )

Topik sebelumnya Topik selanjutnya Go down 
PengirimMessage
boystars
ADMINISTRATOR
ADMINISTRATOR


Male
Jumlah posting : 526
Lokasi : Penajam Kota tercinta. Petung Desa damai nan permai
Nick mig : boystars, dai4,ocal
Room : Masih sekitar Indonesia juga Very Happy

PostSubyek: Color Coding ( AHK )   Mon 20 Jul 2009 - 23:14

buat yg mau nyoba coloring di AHK silahkan

Code:
#NoEnv
; created by ae.1
; based upon the RCB example from helpfile

; Description: It works with a redirection of the CallWindowProc to a UserDefinedFunction
; Within the script. Right after execution the Call will be directed to the
; origin address.

; HTML Colors in BGR-format
Black = 0x000000
Green = 0x008000
Silver = 0xC0C0C0
Lime = 0x00FF00
Gray = 0x808080
Olive = 0x800080
White = 0xFFFFFF
Yellow = 0x00FFFF
Maroon = 0x000080
Navy = 0x800000
Red = 0x0000FF
Blue = 0xFF0000
Purple = 0x800080
Teal = 0x808000
Fuchsia = 0xFF00FF
Aqua = 0xFFFF00

Gui, Margin, 10, 10
Gui, Font, s12
Gui, Color, Black
Gui, Add, Text, vTXT1 HwndTX1ID w300, A little Text`nwith colored Background
Control_Colors("TXT1", "Set", Teal, White)
Gui, Add, CheckBox, HwndCB1ID wp vCB1 gCB1Clicked, A Checkbox
Control_Colors("CB1", "Set", Silver)
Gui, Add, Radio, HwndRB1ID xp y+0 wp vRB1 gRB1Clicked, Radiobutton used as Checkbox
RB1 := False
Control_Colors("RB1", "Set", Silver)
Gui, Add, Edit, vROED1 HwndED1ID ReadOnly wp, This is a Readonly Edit!
Control_Colors("ROED1", "Set", Red, Yellow)
Gui, Add, Text, vDTXT1 HwndTX2ID Disabled wp, This Text is disabled.
Control_Colors("DTXT1", "Set", Maroon, Black)
Gui, Add, Edit, vED1 HwndED2ID r2 wp, A normal editfield
Control_Colors("ED1", "Set", Navy, White)
Gui, Add, Button, vBTChange gBTChange wp, Change that Colors!

Gui, +LastFound
GuiID := WinExist()
Control_Colors(GuiID, "RCB", 0, 0)
Gui, Show, , Colors by ae.1
Return

GuiEscape:
GuiClose:
ExitApp

BTChange:
Control_Colors(TX1ID, "Set", Red, Teal)
Control_Colors(ED1ID, "Set", Maroon, Yellow)
Control_Colors(TX2ID, "Set", Aqua, White)
Control_Colors(ED2ID, "Set", Silver, Navy)
Gui, +LastFound
WinSet, Redraw
GuiControl, Hide, BTChange
Gui, Show, AutoSize
Return

CB1Clicked:
GuiControlGet, CB1
Control_Colors(CB1ID, "Set", (CB1 ? Yellow : Silver))
WinSet, Redraw, , ahk_id %CB1ID%
Return

RB1Clicked:
RB1 ^= True
Control_Colors(RB1ID, "Set", (RB1 ? Green : Silver))
WinSet, Redraw, , ahk_id %RB1ID%
GuiControl, , RB1, %RB1%
Return

Control_Colors(Hwnd, Msg, wParam, lParam = 0)
{
Critical

If !(Hwnd+0) {
GuiControlGet, nHwnd, Hwnd, %Hwnd%
Hwnd := nhwnd
}

Static OldWinProc := "" ; origin Windowprocedure
Static NewWinProc := "" ; new Windowprocedure
Static SetValue := "Set" ; take over Values
Static Register := "RCB" ; RegisterCallBack
Static ValueList := "" ; Values

; Aufruf als Fensterprozedur?
If (A_EventInfo <> NewWinProc) {
If (Msg = SetValue) {
If (RegExMatch(ValueList, "m)^" . (Hwnd +0) . "\|")) {
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\d+)\|(?P\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)
}
Kembali Ke Atas Go down
Lihat profil user http://www.mig33penajam.tk, www.rikie.co.cc
Kha-riem
A J U D A N
A J U D A N


Male
Jumlah posting : 35
Lokasi : Balikpapan_gc
Nick mig : Kha-riem
Room : lndonesia all

PostSubyek: Re: Color Coding ( AHK )   Mon 31 Aug 2009 - 20:57

ngbuat nya dmn?
Kembali Ke Atas Go down
Lihat profil user
boystars
ADMINISTRATOR
ADMINISTRATOR


Male
Jumlah posting : 526
Lokasi : Penajam Kota tercinta. Petung Desa damai nan permai
Nick mig : boystars, dai4,ocal
Room : Masih sekitar Indonesia juga Very Happy

PostSubyek: Re: Color Coding ( AHK )   Sun 6 Sep 2009 - 18:20

tanya ma ae.1 aja boss
Kembali Ke Atas Go down
Lihat profil user http://www.mig33penajam.tk, www.rikie.co.cc
Sponsored content




PostSubyek: Re: Color Coding ( AHK )   Today at 10:10

Kembali Ke Atas Go down
 
Color Coding ( AHK )
Topik sebelumnya Topik selanjutnya Kembali Ke Atas 
Halaman 1 dari 1
 Similar topics
-
» [color=yellow]ALV-Projet ( cover engine, cover reservoir brake fluid n manny more.... Up date )[/color]
» [WTB] Supersprox Sprocket 46T (Gold Color) Wilayah Jakarta
» WTS Range Rover Evoque (TWO COLOR SILVER BLACK)
» WTS : Bikers Accesories, Kevlar Parts, Jasa lapis Kevlar Multi Color
» [color=blue]CUTTING STIKER MURAH[/color]

Permissions in this forum:Anda tidak dapat menjawab topik
.: MIG33PENAJAM.TK :. :: ALL ABOUT MIG33 :: I--PEMROGRAMAN (MEMPELAJARI MIG33 PC)-
Navigasi: