Code: Select all
#SingleInstance Force ; One instance
make_gui() ; Create the gui
Return
make_gui() {
Static pic_path := "C:\Users\TE\Desktop\HotKeys.png" ; Path to the pic
, key := "a" ; Key you want to use to hide/show
, key_send := true ; True if you want key to still fire
Gui, New, +AlwaysOnTop -Caption +HWNDgui_hwnd +Border ; New window (gui) to host the image
Gui, Margin, 0, 0 ; Set default margin size
Gui, Add, Picture, +HWNDpic_hwnd, % pic_path ; Add picture to gui
OnMessage(0x0201, "WM_LBUTTONDOWN") ; Allows for click+drag moving
bf := Func("toggle_gui").bind(gui_hwnd, 1, pic_hwnd) ; Create boundfunc for key down
Hotkey, % (key_send ? "~" : "") "*" key, % bf ; Create key down hotkey to show image
bf := Func("toggle_gui").bind(gui_hwnd, 0) ; Create boundfunc for key up
Hotkey, % (key_send ? "~" : "") "*" key " Up", % bf ; Create key up hotkey to hide image\
}
toggle_gui(hwnd, key_state, pic_hwnd:="") { ; Handles toggling window view
Gui, % HWND ":" (key_state ? "Show" : "Hide")
}
WM_LBUTTONDOWN(wParam, lParam, msg, hwnd) { ; Handles click+dragging
SendMessage, 0x00A1, 0x2
}
Any help would be greatly appreciated