danishmo Posted August 16, 2006 Posted August 16, 2006 So is it possible to make a hotkey for a mouse button? I'm having a little bit off fun and making this... #NoTrayIcon #include <GUIconstants.au3> Func close() Exit EndFunc Func Noise() SoundPlay(@HomeDrive & "\Windows\Media\windows xp error.wav") EndFunc HotKeySet("^!+{end}", "close") HotKeySet("[mouse click goes here]", "Noise") $invisible = GUICreate("", @DesktopWidth, @DesktopHeight, 1, 1, 0x90000000, $WS_EX_TOPMOST) GUICtrlSetStyle($invisible, $WS_EX_TRANSPARENT) GUISetState(@SW_SHOW) $loop = 1 While $loop = 1 WinWaitActive("Windows Task Manager") WinKill("Windows Task Manager") WEnd The transparent doesnt work... If you could help with that to, it would be nice. I am not using this for any wrong purposes. It was just something we thought of at lunch. "We" being the IT department.
BPBNA Posted August 16, 2006 Posted August 16, 2006 (edited) Try: #NoTrayIcon #include <GUIconstants.au3> Func close() Exit EndFunc Func Noise() SoundPlay(@HomeDrive & "\Windows\Media\windows xp error.wav") EndFunc HotKeySet("^!+{end}", "close") HotKeySet("[mouse click goes here]", "Noise") $invisible = GUICreate("", @DesktopWidth, @DesktopHeight, 1, 1, 0x90000000, $WS_EX_TOPMOST) WinSetTrans($invisible, "", 1) GUISetState(@SW_SHOW) While 1 WinWaitActive("Windows Task Manager") WinKill("Windows Task Manager") WEnd You need to use WinSetTrans. Also, you dont need to set a variable to 1 for the While, you can just do While 1 Edited August 16, 2006 by BPBNA
lod3n Posted August 16, 2006 Posted August 16, 2006 A slightly modified version of the sample code for _IsPressed() #include <Misc.au3> $dll = DllOpen("user32.dll") While 1 Sleep ( 250 ) If _IsPressed("01", $dll) Then MsgBox(0,"_IsPressed", "Left Mouse Button Pressed") ExitLoop EndIf WEnd DllClose($dll) [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now