Code: Select all
MyGui := gui()
MyGui.BackColor := "FFFFFF"
MyGui.add("text","w500 h400")
SB := MyGui.Add("StatusBar", "BackgroundFF0000", "123456789")
;SB := MyGui.Add("StatusBar", "+BackgroundFF0000", "123456789")
MyGui.Show
Code: Select all
MyGui := gui()
MyGui.BackColor := "FFFFFF"
MyGui.add("text","w500 h400")
SB := MyGui.Add("StatusBar", "BackgroundFF0000", "123456789")
;SB := MyGui.Add("StatusBar", "+BackgroundFF0000", "123456789")
MyGui.Show
Code: Select all
hFF9A9A := DllCall("gdi32\CreateBitmap", "int", 1, "int", 1, "uint", 0x1, "uint", 32, "int64*", 0xFF9A9A, "ptr")
Main := Gui()
Main.MarginX := 0
Main.MarginY := 0
Main.BackColor := "FFFFFF"
Main.AddText("xm ym w500 h400")
Main.AddPicture("xm y+0 w500 h20 BackgroundTrans", "HBITMAP:*" hFF9A9A)
Main.OnEvent("Close", Gui_Close)
Main.Show()
Gui_Close(*)
{
if (hFF9A9A)
DllCall("gdi32\DeleteObject", "ptr", hFF9A9A)
ExitApp
}
Code: Select all
Main := Gui()
Main.MarginX := 0
Main.MarginY := 0
Main.BackColor := "FFFFFF"
Main.AddText("xm ym w500 h400")
Main.AddText("xm y+0 w500 h20 0x200 BackgroundFF9A9A", "123456789")
Main.OnEvent("Close", Gui_Close)
Main.Show()
Gui_Close(*)
{
ExitApp
}
Code: Select all
Gui_Size(wParam,lParam,Msg,hWnd){
static SB_SETICON := 1039
static IMAGE_ICON := 1
static cwidth := 0
static cheight := 0
txt.Move (X+(cwidth-xwidth))/2,(Y+(cheight-xheight))/2
win.GetClientPos ,,&cwidth,&cheight
pSize := (lParam & 0xffff)/4
sb.SetParts pSize*.5,pSize*1.8,pSize*.6
sb.SetText "`tStatus 1",1
sb.SetText "`t" StrReplace(FormatTime(,"LongDate")," 0"," "),2
sb.SetText "`t" FormatTime(,"Time"),3
SendMessage SB_SETICON,3,LoadPicture("c:\MyDocs\Images\crapper.ico",,&IMAGE_ICON),sb.hWnd
sb.SetText "`t Exit Icon",4
}
sb_Click(this,indx){
Switch(indx){
Case 1,2,3:MsgBox StatusBarGetText(indx,win.hWnd),"Status Bar " indx " Clicked","iconi t2"
Case 4:ExitApp
}
}
Update_Time(){
sb.SetText "`t" FormatTime(,"Time"),3
}
X := 0,Y := 0,xwidth := 0,xheight := 0
WM_SIZE := 5
SB_SETMINHEIGHT := 1032
GCL_HCURSOR := -12
IMAGE_CURSOR := 2
win := Gui(,"Test StatusBar AHK Version=" A_AHKVERSION (A_PtrSize=8?" 64Bit":" 32Bit"))
win.BackColor := "aqua"
win.OnEvent "Close",ExitApp
win.OnEvent "Escape",ExitApp
txt := win.AddText("center y400 w" A_ScreenWidth/2 " h50","Click Any Status Bar")
txt.SetFont "s32 cnavy underline bold","Times New Roman"
sb := win.AddStatusbar("-Theme Backgroundaqua")
sb.SetFont "s22 bold","Times New Roman"
sb.OnEvent "Click",sb_Click
SendMessage SB_SETMINHEIGHT,50,0,sb.hWnd
DllCall (a_ptrsize=8)?"SetClassLongPtr":"SetClassLong","ptr",sb.hWnd,"int",GCL_HCURSOR,"ptr",LoadPicture("c:\Windows\Cursors\aero_link_xl.cur",,&IMAGE_CURSOR)
win.Opt "+resize"
OnMessage WM_SIZE,Gui_Size
SetTimer Update_Time,999
txt.GetPos &X,&Y
win.Show "w" A_ScreenWidth/2 " h" A_ScreenHeight/2
win.GetClientPos ,,&xwidth,&xheight
Users browsing this forum: a_bolog, Descolada, imstupidpleshelp, ositoMalvado, Rohwedder and 27 guests