How to simulate sending 'windows' key + L key for the lock screen?

Dear Sir

I write the code of provider identification information of the recognition device of vein (usb device) to winlogon in Windows 7. I realized the function XP with Gina.

There are two parts of the requirement for the function, must be acknowledged the vein information and control the system startup, the other is that the screen of the machine must be locked when the usb device is connected to.

For the first part, it should be ok with referring to the example provider of microsoft credentials.

However, I have two problems on Windows 7 for the second part. Please help me.

In Gina, I can create the timer to monitor the connection status of device with the machine, if the device is not connected with the machine, Gina will send the sas order and lock the screen.

on Windows 7, the credentials provider dll is load and unload dynamically, I can't create the timer to monition connection of device status, after logon to the system.

question 1: is there a good way to monitior the device status after login the system?

question 2: how to send the command to the system of lock screen?

Thank you

Shinson Yang

A forum script would be a much better place to post this question. Here is a VBScript that will detect the arrival or the removal of a USB mass storage device within 10 seconds:

Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Set colEvents = objWMIService.ExecNotificationQuery _
("Select * from __InstanceOperationEvent within 10 where" _)
& "TargetInstance isa 'Win32_LogicalDisk'")

Do for real
Set objEvent = colEvents.NextEvent
If objEvent.TargetInstance.DriveType = 2 Then
Select the objEvent.Path_ box. Class
Case "__InstanceCreationEvent".
MsgBox objEvent.TargetInstance.DeviceId & "Drive" & "has been added."
Case "__InstanceDeletionEvent".
MsgBox objEvent.TargetInstance.DeviceId & "Drive" & "has been deleted."
Select end
End If
Loop
To lock Windows you must run this command:

RunDll32.exe user32.dll, LockWorkStation

Tags: Windows

Similar Questions

  • How can I change the background image for the lock screen?

    Hi, I just bought a new laptop and I got Windows 7 installed in the store, and I would like to change the background image for the lock screen.  When I went to activate my account, I found out that it has already been activated, but I can't find the settings-> settings more PC in the lower corner on the right.  Thank you!

    Lock screen?

    Are you referring to the login screen?

    Or wallpaper?

    Right-click on your desktop and select Personalize.

    Office link is at the bottom left and use a win-7 theme.

  • How to disable a license key for the bulk of r2 server 2012

    I bought a retail version of server 2012 r2 essentials to upgrade my 2003. I found my software is not compatible with the 'Essentials' and it is compatible with 'Standard '.  Now I'm going to buy a standard edition for sale at retail. My boyfriend is interested in the "essential" to its server.

    How can I disable the license key of the 'essential' that I can not use and give it to the other use?

    This issue is beyond the scope of this site and must be placed on Technet or MSDN

    http://social.msdn.Microsoft.com/forums/en-us/home

  • can I use the windows key for the laptop broken on a new computer?

    Pre-installed Windows 7

    My laptop came with pre installed Windows 7, but now its dead as motherboard had burntout. So I am planing to buy a new system. I have the product key of Windows from the thumbnail below my old laptop, I use the product key or I have to buy a new copy of windows

    The copy of Windows 7 that came with this laptop is LINKED to this laptop.  It goes with her, even in death.

    If you get the laptop repaired, then you can use the method/support of the manufacturer of the laptop gave you to restore the operating system on that now resurrected system.  If not - you bought the rights for the whole package - not the individual components.

  • In the Api Soap Echosign, how can I send more than one file for the signature...

    Some examples of code for sending single document...

    $client = new SoapClient(EchoSign\API::getWSDL());)

    $api = new EchoSign\API ($client, "YOUR API KEY");

    $file = EchoSign\Info\FileInfo::createFromFile('demo.pdf');

    $document = new EchoSign\Info\DocumentCreationInfo ("Test sendDocument", $file ");

    $recipients = new EchoSign\Info\RecipientInfo;

    $recipients-> addRecipient ($recipient_email);

    $document-> setRecipients ($recipients);

    $result = $api-> sendDocument ($document);

    Hello

    You will find the documentation of the DocumentCreationInfo object in the EchoSign API SOAP at https://secure.echosign.com/public/docs/EchoSignDocumentService22#DocumentCreationInfo

    You will see that you can provide an array of files in the field of fileInfos DocumentCreationInfo object.

    EchoSign also provides REST style APIs. You can access the REST API documentation at https://secure.echosign.com/public/docs/restapi/v5. You can use POST reassure API https://secure.echosign.com/public/docs/restapi/v5#! /agreements/ to send the contract and this API operation accepts also several files on demand.

    I hope this helps.

    Thank you

    Nikhil

  • BlackBerry Smartphones Hot key for the current screen menu?

    is there a key or combination of keys that will show the current menu rather than press the wheel?

    Unfortunately there is no combination of keys to call up the menu on the screen.

    Menu can be called only through click wheel.

  • How save/simulate an arrow key?

    Hello

    I need to register the software simulation using:

    -arrow keys (for the input field/menu selection).

    -Return the key (for the validation of choice).

    Capture screen is, of course, is not a problem, as I do it manually.

    What I did find is: how to simulate a button arrow.

    IE: tell the user of the lesson to "press the arrow key to enter the menu of xxxxx." and do it...

    I tried to use the field text, with empty response and with arrow key down as validation key, but it does not work...

    Thank you.

    Hello

    It helps please, if you tell us what version of Captivate you use.

    For more interactive objects (click boxes, buttons, text input boxes), the user can get a "successful action" by clicking (for Click box, touch or the Send button to a text entry area) OR by using a keyboard shortcut. By assigning this shortcut key (e.g. Enter), you allow the user to use this key. CP5, you'll find it in the property Panel, area Action. For CP4 find you this shortcut key in the p.e. Button, first tab properties dialog box.

    Lilybiri

  • Hi, I bought a windows xp disk Professional Microsoft a few years ago but never used it how can I cd key for the disc

    Hi, I bought a windows xp disk Professional Microsoft a few years ago but never used it how can I cd key for the disc

    If you bought a copy the retail of Windows key should be included in the box.

    How to get a replacement product key

    Retail Windows:
    If you have lost a product key for the software you purchased separately from your computer, or if your product key does not work, call Microsoft. To locate the phone number, visit the following Microsoft Web site: http://support.microsoft.com/default.aspx?scid=fh; CNTACTMS

    A fee may apply for lost keys.

  • How I validete my product key for windows vista

    How I validete my product key for windows vista

    How I validete my product key for windows vista

    Did you mean Validate or activate?
    If enable, then use the link in the menu programs
     

    --

    Noel Paton | Nil Carborundum Illegitemi | CrashFixPC | The lazy three fingers

  • How to find my product key for Windows 7 Ultimate on my computer?

    Anyone know how to find my product key for Windows 7 Ultimate on my computer...  I have several licenses and want to ID what license is on which computer.

    I see the product ID, but can't seem to find the product 'key '.

    Any help would be greatly appreciated.  J

    Original title: find product key

    Here are four utilities, which can display your product keys if they are still there:
    Belarc Advisor: http://www.belarc.com/free_download.html
    (He did a good job of providing a wealth of information.)

    Also: http://www.magicaljellybean.com/keyfinder.shtml
    and: http://www.nirsoft.net/utils/product_cd_key_viewer.html
    and RockXP: http://www.majorgeeks.com/download4138.html which has additional features

    To find out which product keys are used:

    Summary

    If you have multiple Windows licenses and have installed but don't know which one is in use, use the following instructions to double check.

    Details

    Apples of: Windows Vista, Windows 7, Windows 8 and Windows 8.1

    User level: beginner to Expert

    If you have multiple PCs in your home or business running different versions of Windows and would like to have on the same version, you can check that you do not use a product key that is already in use. For example, if you bought 3 copies of Windows 7 Professional, installed one, active, but later wanted to update another PC but can't remember which key was used, this trick can be very handy.

    Click Start, type: cmd

    Press enter on your keyboard

    At the command prompt, type the following command:

    slmgr - dli


    Press enter on your keyboard

    A dialogue window will appear on the screen. This will reveal the partial product key which gives an idea of the product key that is in use. Compare with product keys that you have and it will confirm copy of which is in use. When we're done, click OK and close the command prompt window.

    For users of Windows 8 and Windows 8.1:


    Press the Windows key + X

    Click on command prompt

    Alternative means to quickly launch the command prompt quickly on all versions of Windows:

    Press Windows key + R

    Type: CMD

    Press enter on your keyboard

  • How to change my product key for Windows 7?

    I RECEAVED THE KEY PRODUCT FOR REAL WIDOWS 7 AND INSTRUCTION HOW TO CHANGE MY PRODUCT KEY

    THE INSTRUCTION SAY CLICK START AND SHORT CLICK COMPUTER, CLICK ON THE PROPERTY AND AT THE BOTTOM OF THE DIALOG BOX CLICK ON CHANGE PRODUCT KEY

    BUT WHEN I'M THERE IN THE BOTTM OF THE BOX SAY SET IT AND NOTHING TO CHANGE THE PRODUCT KEY

    PLEASE IF SOMEONE CAN HELP ME

    THAK YOU

    You have right click on computer and then select Properties.

    Please see: how your product key updated in Windows 7

    Carey Frisch

  • How can recover my product key for windows priminum House

    I have windows 7 and it comes with computer product LMOS similar dell laptop... I need my windows product key

    Hi Gulshan,

    Where can I find my Windows product key?

    http://Windows.Microsoft.com/en-us/Windows/where-find-Windows-product-key#where-find-Windows-product-key=Windows-7

    If you have a lost or unreadable product key for the Microsoft software that came with your computer, contact your computer manufacturer to obtain a replacement. Contact information for the manufacturer of your computer can be found here:

    http://support.Microsoft.com/GP/oemphone/

    Hope this information helps. If you have any other questions, we will be happy to help you.

  • Windows vista USB flash drive installation AND recover the WINDOWS KEY from the recovery disk

    Hi all

    I formatted my laptop some time ago. Now I want to reinstall windows vista (came along with my laptop). The thing is due to a problem that my CD drive does not work so I would like to install windows vista by using a USB key. Can you get it someone please let me know if this is possible... If Yes, how I've go ahead make a bootable USB.

    As someone can tell me if there is a way to retrieve the WINDOWS KEY from the recovery disc.

    Thank you.

    Hello

    This can help, but you will need a Vista system to create the working bootable USB key:http://www.askvg.com/how-to-create-bootable-usb-drive-to-install-windows-vista/

    As for the product key, it should be on a sticker on the laptop (usually on the bottom). If it is not readable, contact the manufacturer for further assistance. As we said already, the product key is not on the installation disc.

    Replace broken laptop optical drives is not too difficult, you can see this as another option.

    Good luck, Rick Rogers, aka "Crazy" - Microsoft MVP http://mvp.support.microsoft.com Windows help - www.rickrogers.org

  • How to find my product key for my computer?

    Original title: product key.

    How to find my product key for my computer?   In addition, a box keeps telling me that my Windows and not authentic. What does that mean?

    Thank you... Peggy

    Discussions were merged.

    Deleted duplicate.

    If your computer is pre-installed with Windows 7:

    COA certificate of authenticity:

    http://www.Microsoft.com/howtotell/content.aspx?PG=COA

    ??

    What is the certificate of authenticity for Windows?

    http://Windows.Microsoft.com/en-us/Windows7/what-is-the-Windows-certificate-of-authenticity

    If store bought his license:

    You can find your Windows product key on the label supplied with the package provided with your copy of Windows. The label can also be on your computer case. Activation of the pairs with your computer, your product key.

    If it's a digital download, check your email.

  • After disk hard crash, loaded Windows 7 and get "Software Licensing Service determined that specified only usable product key for the upgrade, not for new installations.

    Original title: Windows Vista product key used for any new installation.

    I bought the upgrade from Windows 7 Home Premium to Windows Vista CD, then had a hard drive crash, then installed a new hard drive. Load the purchased Windows 7 on new hard drive, now I get the message '... Software Licensing Service determined that specified only usable product key for the upgrade, not for new installations. That means that I have to load Vista on the new hard drive, and then update? Both for the end user (paying customer) hostile.

    However, the requirements for the media upgrade is that you have an operating system already eligible such as Windows XP or Vista installed to use it. Since the Windows 7 end user license agreement.

    15 UPDATES. To use upgrade software, you must first be licensed for the software that is eligible for the upgrade. After the upgrade, this agreement takes the place of the agreement for the software that you upgraded. After upgrade, you can no longer use the software that you upgraded.

    So, if you are always denied, you will just have to reinstall Windows XP or Vista and let it do the verification of eligibility.

    OR

    Have you tried to restart by phone?

    How to activate Windows 7 manually (activate by phone)
     
    1) click Start and in the search for box type: slui.exe 4
     
    (2) press the ENTER"" key.
     
    (3) select your "country" in the list.
     
    (4) choose the option "activate phone".
     
    (5) stay on the phone (do not select/press all options) and wait for a person to help you with the activation.
     
    (6) explain your problem clearly to the support person.
     
    http://support.Microsoft.com/kb/950929/en-us

    If you do not have your Windows Vista installation media, you can download a fresh copy:

    Windows Vista (in English) with Service Pack 1

    Windows Vista (x 86)       Windows Vista (x 64)
    X 14 - 63452.exe X 14 - 63453.exe
    Boot.wim Boot.wim
    install.wim install.wim

    Installation instructions (creation of bootable DVD/USB)

    You must download the .exe, the boot.wim and install.wim file in the same place. Run the .exe file and it will extract all the files in a folder called Vista. Start Windows install will be now (cancel Setup).

    To create a .iso bootable extracted the files in the folder of Vista and download Imgburn. Run imgburn and select 'Create Image file from files/folders'

    Select the record button browse and select the folder of Vista. Then select Advanced.

    Left will be your folder of Vista, to the right, make sure that you have verified make Bootable Image, changed the developer ID: Microsoft Corporation, load segment: 07C 0 and loading areas: 4.

    Select the folder browse button then navigate to your folder of Vista, then select the startup folder and select the file called etfsboot.

    Select the generate button.

    Save your .iso

    Select Yes when the prompt for the Volume name, and select ok. Finally, wait for it to make the .iso file.

    Once you have the .iso file, they may want to use the Microsoft .iso to USB/DVD tool to create a bootable DVD or USB flash drive (USB FlashDrive recommendations, see here).

    FF

Maybe you are looking for

  • "Execution error 70 permission denied."

    Everytime I turn on my laptop, I get this message "Authorization of Run-time Error 70 refused", I have installed a new software recently. Are the specifications of my laptop... Operating system Windows 7 64 bit, core i5 with 4 GB of ram

  • DVD ROM and DVD burner is no longer available

    I lost connection with my DVD ROM and burner.   They no longer appear with other devices under 'my computer' and when I look in Device Manager there is a yellow exclamation points next to these two devices.  What should I do to restore the connection

  • from bad to worse - security issues

    Has disappeared about a week after having tried to fix iTunes or when I got the new Adobe. Cannot install or uninstall SE - says it is on an unavailable network resource - I don't have a network configuration. So I thought I'd get Defender to have at

  • Windows 8 blocking at startup

    I've upgraded to Windows 7 Windows 8 Pro about 2 weeks ago and everything went well until 2 days ago. Now, whenever I turn on the PC it starts normally but then hangs at the splash screen (right before entering the Windows Live password). No error me

  • Style of numbering and Center paragraph alignment

    Hi allI try to understand what I am doing wrong:I have a paragraph with a numbered style (see figure below (auto numbering)) from the list and the text isn't exactly in the horizontal middle.as a comparison I put a text normal box (see the above figu