Advertisement
Guest User

startbutton.cs

a guest
May 30th, 2013
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.51 KB | None | 0 0
  1. using System;
  2. using System.Runtime.InteropServices;
  3.  
  4. class Test
  5. {
  6.     const uint KEYEVENTF_EXTENDEDKEY = 0x0001;
  7.     const uint KEYEVENTF_KEYUP = 0x0002;
  8.     const uint KEYEVENTF_UNICODE = 0x0004;
  9.     const uint KEYEVENTF_SCANCODE = 0x0008;
  10.     const byte VK_LWIN = 0x5B;
  11.  
  12.     [DllImport("user32.dll")]
  13.     static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, int dwExtraInfo);   
  14.  
  15.     public static void Main(string[] args)
  16.     {
  17.         keybd_event(VK_LWIN, 0, 0, 0);
  18.         keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0);
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement