Tankbuster Posted April 15, 2011 Posted April 15, 2011 (edited) //edit : Solution is in post #3 followHello,I tried to use the keyboard lights as an progress indicator (without caps lock of course), but it turned out in Locked user session (user is locked out because of screensaver for example)the lights are not flashing anymore.sample of my Code uses the SENDexpandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> global $LastStateNum=0 global $LastStateScroll=0 local $msg send("{NUMLOCK off}") send("{SCROLLLOCK off}") GUICreate("dummy",100,100) GUISetState() Do $msg = GUIGetMsg() consolewrite($msg) If $msg = $GUI_EVENT_CLOSE Then ExitLoop FlashKeyboard(2) sleep(100) Until $msg = $GUI_EVENT_CLOSE send("{NUMLOCK on}") send("{SCROLLLOCK off}") exit func FlashKeyboard($type) Select case $type = 2 if $LastStateNum=0 Then send("{NUMLOCK on}") send("{SCROLLLOCK off}") $LastStateNum=1 Else send("{NUMLOCK off}") send("{SCROLLLOCK on}") $LastStateNum=0 EndIf EndSelect EndFuncI wondered if it may work in locked out state with USER32.DLL and SetKeyboardState.But I got no idea how to get the USER32.dll call done.I found that with DllCall("user32.dll","long","GetKeyState","int",$VK_NUMLOCK)it is possible to query the state, but what does the setkeyboardstate looks like???Or is there a better way to flash the lights in locked state? I'm not sure if user32.dll really does work on my issue, I'm just guessing...Could someone help me out? Or if you already know that the lights won't flash in locked mode, please tell me too.BTW: I tested this on Win7(x86). Edited April 15, 2011 by Tankbuster
Bert Posted April 15, 2011 Posted April 15, 2011 controlsend The Vollatran project My blog: http://www.vollysinterestingshit.com/
AdmiralAlkex Posted April 15, 2011 Posted April 15, 2011 monoceres did it .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
Tankbuster Posted April 15, 2011 Author Posted April 15, 2011 monoceres did it Yep, this worked (exept with the Logitech limitation, but that does not matter for the target pc)I tried now to search for the topic and even by knowing the right word the forum search did not return the topic, simply because it is in the example forum. (note for myself next search: Hey, big brain, search always everywhere... )Anyway. This (monoceres) was exactly what I'm searching for.I didn't take a look to controlsend, simply because I think it will also not work because of the User Lock out limitation. But this is just my guess.Thank you very much.
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