Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
; A couple of ways to check for Task Manager. ; ; 1 - This sorta works for closing Task Manager ; once Ctrl + Alt + Del is pressed. It works ; better if the timedelay is removed. But ; then CPU goes up to 99%. ; ; 2 - Just wait for Task Manager to exist and ; close it. ; ; Of course, there is a policy you could use to ; do the same thing. Goto two :one #DefineFunction GetKeyboardState(buf) sDLLName = StrCat(DirWindows(1), "user32.dll") DllCall(sDLLName, long:"GetKeyboardState", lpbinary:buf) BinaryEodSet(buf, 256) Return buf #EndFunction ;============================== ;start ;============================== ;boxopen("","Press any key.") buf1 = BinaryAlloc(256) While @TRUE kb = GetKeyboardState(buf1) control = BinaryPeek(buf1,17) alt = BinaryPeek(buf1,18) del = BinaryPeek(buf1,46) a = BinaryPeek(buf1,65) If control & 128 && alt & 128 && del & 128 ; message("test","Ctrl + Alt + Delete pressed") If WinWaitExist("Windows Task Manager",1) Then SendKeysTo("Windows Task Manager","{ESC}") ; break EndIf TimeDelay(.001) If IsKeyDown(@CTRL & @SHIFT) Then Break EndWhile BinaryFree(buf1) Exit :two If WinWaitExist("Windows Task Manager",-1) Then SendKeysTo("Windows Task Manager","{ESC}") If IsKeyDown(@CTRL & @SHIFT) Then Exit Goto two
Article ID: W16489
File Created: 2014:07:18:09:51:38
Last Updated: 2014:07:18:09:51:38