Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 289
  • Last Modified:

An old question about system key

Hi all

I want to write a program, which send system key to the window: Alt + Tab, Ctrl + Alt + Del ...
Does any one know how to do? I prefer a sample code.
Thanks in advance.
0
melodiesoflife
Asked:
melodiesoflife
  • 2
1 Solution
 
jkrCommented:
Just see http://www.codeproject.com/cpp/sendkeys_cpp_Article.asp ("SendKeys in C++") which covers exactly that. From the article:

Here is a small snippet that allows you to send the ALT-TAB sequence:

  // press DOWN "Alt-Tab"
  keybd_event(VK_MENU, 0, 0, 0);
  keybd_event(VK_TAB, 0, 0, 0);

  ::Sleep(1000);

  // stop pressing "Alt-Tab"
  keybd_event(VK_MENU, 0, KEYEVENTF_KEYUP, 0);
  keybd_event(VK_TAB, 0, KEYEVENTF_KEYUP, 0);


You'll find the rest there plus some helpful wrapper code also ;o)
0
 
jkrCommented:
BTW:

>> Ctrl + Alt + Del

That one I wouldn't want to emulate if I were you.
0
 
melodiesoflifeAuthor Commented:
Thanks, that is exactly code I'm finding
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now