OnMessage(0x201,"wm_Lbuttondown")
SplashImage ,% "HBITMAP:" CreateColoredBitmap(20, 20, 0xe81010),B M x100 y300 W20 H20 , , , TipImage_1
wm_Lbuttondown( p_w, p_l, p_m, p_hw){
if WinExist("TipImage_1"){
;MsgBox ,窗口TipImage_1
}
PostMessage, 0xA1, 2
}
CreateColoredBitmap(width, height, color) {
hBitmap := CreateDIBSections(width, -height,, pBits)
Loop % height {
i := A_Index - 1
Loop % width
NumPut(color, pBits + width*4*i + (A_Index - 1)*4, "UInt")
}
Return hBitmap
}
CreateDIBSections(w, h, bpp := 32, ByRef ppvBits := 0)
{
hdc := DllCall("GetDC", "Ptr", 0, "Ptr")
VarSetCapacity(bi, 40, 0)
NumPut( 40, bi, 0, "UInt")
NumPut( w, bi, 4, "UInt")
NumPut( h, bi, 8, "UInt")
NumPut( 1, bi, 12, "UShort")
NumPut( 0, bi, 16, "UInt")
NumPut(bpp, bi, 14, "UShort")
hbm := DllCall("CreateDIBSection", "Ptr", hdc, "Ptr", &bi, "UInt", 0, "PtrP", ppvBits, "Ptr", 0, "UInt", 0, "Ptr")
DllCall("ReleaseDC", "Ptr", 0, "Ptr", hdc)
return hbm
}
暂无讨论,说说你的看法吧