Sign in to follow this  
Followers 0
Amen

Disable window keys and alt+tab

7 posts in this topic




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); 
}

Share this post


Link to post
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

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

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

not sure how you can block or redirect keystrokes on a machine from another machine...

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

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

local $win = "Name of window"

while (1)

winActivate($win)

sleep(100)

wEnd

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

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

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