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

  • 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.
  • 2
1 Solution
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);


  // 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)

>> Ctrl + Alt + Del

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

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