I'd like to perform a click in a windows application, without using the real mouse (so I can minimize it). Much like a bot would behave.
How would I do this?
I'd like to perform a click in a windows application, without using the real mouse (so I can minimize it). Much like a bot would behave.
How would I do this?
I found this at http://social.msdn.microsoft.com/forums/en-US/winforms/thread/86dcf918-0e48-40c2-88ae-0a09797db1ab/.
When i simulate key strokes and mouse click, I use Windows Input Simulator
The code below is a repost from here:
I think the function you're looking for is
PostMessage
You can read more about it here on codeproject, and download a demo project, which sends keystrokes.
This method posts messages directly on the input queue associated with the program, based on the process handle you use (hWnd)
You can also use this function to send mouse clicks with it, by posting button events, like so:
More information about those button events can be found here on MSDN.
I'm sure if you search around the internet for samples for PostMessage mouse events you'll find plenty
You can use a timer, or handle key press, and create in the timer tick or key press function simulate a mouse click, using the user32.dll file (better be in a form shape so you can handle timer interval...):
}
You can use Window Automation to find Minimize button in window and perform click. I find it easy and used a lot. here is the link to understand the whole concept. https://msdn.microsoft.com/en-us/library/windows/desktop/ff486375(v=vs.85).aspx