Click here to Skip to main content
15,890,897 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I have a form (coded in C#) with a single button. When i click the button, the windows start button must be pressed. How do i do this?
I did quite a bit of searching for the solution but to no avail.
Posted

Use Spy++ to get a handle to the start button, and then post the appropriate system message using that hwnd.
 
Share this answer
 
You need SendKeys to do this. SendKeys invokes a keyboard key for your application.

for further help go here :
http://msdn.microsoft.com/en-us/library/8c6yea83(VS.85).aspx[^]

Hope you like the solution. :cool:
 
Share this answer
 
I don't think SendKeys will do this because
SendKeys
only works for sending keys to an Application. However, this library should do the trick:

http://www.codeguru.com/vb/gen/vb_system/keyboard/article.php/c14629__1/[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900