CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2000
    Location
    Romania, Cluj-Napoca
    Posts
    57

    Inserting A Ctrl+alt+del Combination In The System Message Queue

    I need to simulate a CTRL+ALT+DEL keyboard sequence from an application for rebooting purposes. I'm doing this because the API LockWorkStation() is working only for the WIN 2K.

    I tried this code:

    keybd_event(VK_CONTROL,0,0,0);
    keybd_event(VK_MENU,0,0,0);
    keybd_event(VK_DELETE,0,0,0);

    keybd_event(VK_CONTROL,0,KEYEVENTF_KEYUP,0);
    keybd_event(VK_MENU,0,KEYEVENTF_KEYUP,0);
    keybd_event(VK_DELETE,0,KEYEVENTF_KEYUP,0);


    It seem that the code is not working. Anybody has an idea why ... ??? If U know some useful articles to read or have an idea , please give me a sign.
    I will reward the good answers !!!

  2. #2
    Join Date
    Jun 2001
    Location
    Switzerland
    Posts
    4,443
    Code:
    ExitWindowsEx(EWX_REBOOT | EWX_FORCE, 0);
    Gabriel, CodeGuru moderator

    Forever trusting who we are
    And nothing else matters
    - Metallica

    Learn about the advantages of std::vector.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured