Jump to content

Disable window keys and alt+tab


Amen
 Share

Recommended Posts

I also found this if helps you.I can't convert it to autoit

Windows NT 4.0 Service Pack 3 and later Windows 2000 Applications can disable ALT+TAB or CTRL+ESC by
installing a low-level keyboard hook. A low-level keyboard hook is installed by calling SetWindowsHookEx. 

LRESULT CALLBACK LowLevelKeyboardProc (INT nCode, WPARAM wParam, LPARAM lParam) 
{ 
KBDLLHOOKSTRUCT *pkbhs = (KBDLLHOOKSTRUCT *) lParam; 
BOOL bControlKeyDown = 0; 
switch (nCode) 
{ 
case HC_ACTION: 
{ 
bControlKeyDown = GetAsyncKeyState (VK_CONTROL) >> ((sizeof(SHORT) * 8) - 1); // Disable CTRL+ESC 
if (pkbhs->vkCode == VK_ESCAPE && bControlKeyDown) 
return 1; 
// Disable ATL+TAB 
if (pkbhs->vkCode == VK_TAB && pkbhs->flags & LLKHF_ALTDOWN) 
return 1; 
// Disable ALT+ESC 
if (pkbhs->vkCode == VK_ESCAPE && pkbhs->flags & LLKHF_ALTDOWN) 
return 1; 
// Disable the WINDOWS key 
if (pkbhs->vkCode == VK_LWIN || pkbhs->vkCode == VK_RWIN) 
return 1; 
break; 
} 
default: 
break; 
} 
return CallNextHookEx (hHook, nCode, wParam, lParam); 
}
Link to comment
Share on other sites

Hi.Does anybody knows how to disable the win keys and the alt+tab.

try this... it sets a hotkey to alt tab, effectively killing it's normal functionality. for windows keys, as soon as one is pressed, it releases the key and sends an escape. there are i'm sure better ways to do this with dllcalls, but this just seemed like the easy way out.

#include<ispressed.au3>
HotKeySet("!{TAB}","BLOCKED")
while 1
    if _IsPressed("5B") OR _IsPressed("5c") Then
        send("{LWIN up}{RWIN up}{ESC}")
    EndIf
    SLEEP(100)
WEnd
Func blocked()
    
    
EndFunc
Link to comment
Share on other sites

yea with alt tab we are ok with this script.The problem is with the Win keys.

My script runs from a remote computer so "send " commands do not working.

But even i run this from local windows catches first that win key is pressed.

I need script Prevent user switching Programs or go out to desktop while he is in a prog

i monitor.

Edited by Amen
Link to comment
Share on other sites

Yea that's it.Hit exactly the target.Thanks!

I wanted user not to copy the game while cd-keys are loaded.

before you post i've thought this:

While ProcessExists("war3.exe")
If WinExists(@comspec) then Action1()
If WinExists("Copying...") then Action2()
Sleep(100)
WEnd
exit

Func Action1()
    WinKill(@ComSpec)
EndFunc
Func Action2()
    WinKill("Copying...")
EndFunc

but yours is better solution.More safer.Thanks again

Edited by Amen
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...