I tried two approaches to reading the state of a keyboard's CapsLock key.
The first: http://msdn.microsoft.com/en-us/library/system.windows.forms.control.iskeylocked.aspx
And the second: k_bb2fe024f8a71424996db6d9af08c1fc_settingNewSkin_19">http://www.rohitab.com/discuss/topic/38617-get-the-state-of-capslock/page_k_bb2fe024f8a71424996db6d9af08c1fc_settingNewSkin_19
Now both of these approaches work on my local Windows machine. That is, they show the Keyboard's CapsLock state accurately.
Running the same programs on a computer that connects to windows remote desktop using rdp, the program doesn't work, and only shows the CapsLock key to be off.
Is there a special windows method I have to call when checking the CapsLock key over RDP?
Further investigation has shown that it's rdesktop, not RDP that's responsible for the CapsLock failure.
Related
I'm trying to script a basic code for use on a company computer (so no extra downloads) to simulate pressing Ctrl + Shft + Win + B. Basically, our users when working remote will use Citrix to tunnel into their office desktops, and when they need to reset their graphics driver they cannot do so remotely. I'm trying to make a simple script to do so.
Is there any ways for PowerShell to recognize the windows key as a modifier so I can hit that key combo while remotely connected?
I have been trying to get windows 8.1 to force into a blue screen, but all of my attempts have failed. I don't really want to go into driver code or anything to do it, but just crash it using some sort of silly loop hole.
I tried creating the CrashOnCtrlScroll registry and it doesn't seem to work, even after restarting my computer. I also tried ending csrss, but microsoft has decided to let the user have no control and denies access at all costs (even after an informative prompt window).
I looked online for a while, but can't find anything on blue screening 8.1. It seems that everything out there is for 8 and below.
Notmyfault , a portable tool created by Microsoft's Mark Russinovich for the Windows Internals book will help you get a BSOD with more than a couple of ways (i.e High IRQ fault, hang IRP, stack trash, deadlock, etc)
Which registry key have you tried? There is different key location for PS2 and USB Keyboard.
USB Registry Key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\kbdhid
Add DWORD32, name= CrashOnCtrlScroll, value =0x1
PS2 Registry Key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\i8042prt
Add DWORD32, name= CrashOnCtrlScroll, value =0x1
Restart. Hold the RIGHT CTRL key and press SCROLL LOCK twice quicky.
I'm doing some driver development on my Windows machine and I've been wondering why pressing the PrtSc (print screen) button to take a screen capture seems to hang my machine. There are some forums that suggest this happens when the DEBUG boot option is set in Windows and that this is a panic/bug-check in the Windows kernel.
Is this a Windows bug? Or is this actually useful in some way, like in Linux where PrtSc/SysRq is actually a kernel interrupt key?
UPDATE #1: I'm using Windows 7 x64 Professional Build 7601.
https://msdn.microsoft.com/en-us/library/windows/hardware/ff541727(v=vs.85).aspx
You can disable the SYSRQ key by editing the registry. In the HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\i8042prt\Parameters registry key, create a value named BreakOnSysRq and set it equal to DWORD 0x0. Then, restart the computer. After you have restarted the computer, you can press the SYSRQ key on the target computer's keyboard and it will not break into the kernel debugger.
Obviously, you're likely using a usb keyboard, so make sure to add the BreakOnSysRq = 0 value data pair to kbdhid\Parameters (and for good measure hidusb and kbdclass, not i8042prt. This will prevent the PrntScr key from being interpreted as SysRq.
I have a requirement of simulating Ctrl+Alt+Del in remote system.I loaded sas.dll and called sendsas function but it is not working.How to display winlogon screen on remote system.
Thanks
As discussed here, you can try using Ctrl+Alt+End instead. This will bring up the Task Manager.
If this doesn't work for what you need, you can open the on-screen keyboard in the remote desktop, and click the Ctrl+Alt+Delete keys with the mouse.
How can I unlock the windows lockscreen with Delphi? I didn't found anything on Google or Stackoverflow. I already tried to enter my password using keybd_event but it seems like the events dont work on the lockscreen.
You cannot unlock the lock screen programmatically from user space. That is by design.
OK, let's clarify that. Using documented APIs, you cannot do this. You need to reverse engineer undocumented APIs as #Remko has done for his SasLibEx product.
Remko Weijnen has very interesting projects in this direction. He has released a command-line tool (Winstation Locker) which is capable to unlock local/remote Windows XP station, without knowing the password of the user who has locked the computer.
For Windows Vista and later he has developed SasLibEx** library which can unlock even specific terminal services sessions, again without username/password.
Both methods require you to have Administrative privileges/account at the destination computer.
PLEASE NOTE, all these tools use nasty hacks that may be considered illegal, inappropriate, intolerant or criminal(?). It should be discussed with your Clients/Employer and should be used with caution!
** SasLibEx is a commercial product
Steamlink (a piece of hardware that allows you to stream your steam games to a big screen) currently has an issue, that if your screen is in a different part of the house, in order to play you need to walk to your PC unlock it and then walk back to your big screen.
In order to make it less painful, people in the community came up with this script:
#powershell -NoProfile -ExecutionPolicy unrestricted -Command "$sessionid=((quser $env:USERNAME | select -Skip 1) -split '\s+')[2]; tscon $sessionid /dest:console" 2> UnlockErrors.log
It can unlock your PC remotely. You can call tscon.exe from Delphi to emulate the same.
This actually can be done using powershell, psexec and windows onscreen keyboard. While a program cannot send input to winlogon, the windows osk can, and sure enough a program can send input to osk.
NOTE: The following is a remote solution.
As far as i know, Keyboard events wont work on lock screen unless you switch from Default Desktop to Winlogon desktop(Desktop referring to a container of all activities)
[Background]
Default desktop is the one you use when reading this post.
Winlogon would be the one that is set as active when you press Ctrl+Alt+Del
[XP]
You would need to Switch from Default to WinLogon Desktop[Check reference] and then you would be able to unlock machine by getting Window handle for Unlock Computer
IntPtr windowHandle = (IntPtr)FindWindow(null, "Unlock Computer");//Getting Window handle
Send username and password to respective edit boxes.
Reference
http://www.codeproject.com/Articles/16197/Remotely-Unlock-a-Windows-Workstation
[Win7]
Run tsdiscon.exe from remote. Not sure how this works; but for me, it unlocks the Locked Screen.