Code: Select all
pToken := Gdip_Startup()
OnMessage(0x0201, "WM_LBUTTONDOWN")
; Create a layered window (+E0x80000 : must be used for UpdateLayeredWindow to work!) that is always on top (+AlwaysOnTop), has no taskbar entry or caption
Gui, +E0x80000 +LastFound +AlwaysOnTop +OwnDialogs
Gui, Show, NA
gui_hwnd := WinExist()
createWindow(file,gui_hwnd)
return
createWindow(file,hwnd) {
pBitmap := Gdip_CreateBitmapFromFile(file)
W := Gdip_GetImageWidth(pBitmap) , H := Gdip_GetImageHeight(pBitmap)
hbm := CreateDIBSection(W, H) , hdc := CreateCompatibleDC() , obm := SelectObject(hdc, hbm) , G := Gdip_GraphicsFromHDC(hdc)
Gdip_DrawImage(G, pBitmap, 0, 0, W, H, 0, 0, W, H)
UpdateLayeredWindow(hwnd, hdc, 0, 0, W, H)
DeleteDC(hdc) , DeleteObject(hbm) , Gdip_DeleteGraphics(G)
}
WM_LBUTTONDOWN() {
If (A_Gui) {
PostMessage, 0xA1, 2
}
}