Sign in to follow this  
Followers 0
danishmo

Hotkeyset

3 posts in this topic

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.

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 by BPBNA

Share this post


Link to post
Share on other sites

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]

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0