Click here to Skip to main content
Click here to Skip to main content

Tagged as

Go to top

How to simulate mouse click event in .NET using C++

, 30 May 2011
Rate this:
Please Sign up or sign in to vote.
Code to simulate a mouse click event in C++
Here is a small code snippet that shows how to simulate a mouse click event, in C++:
System::IntPtr hButtonWnd = this->OkButton->Handle;
HWND hwnd = (HWND)hButtonWnd.ToPointer();
::PostMessage (hwnd, BM_CLICK, 0, 0);

License

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

Share

About the Author

Jerry Jiang
Founder Maple Technology Software
Canada Canada
Jerry Jiang(BOLIANG JIANG)
 
Education:Master of Computer Science.
 
A passionate software developer since 1992,now lives in Vancouver.
 
jerry@mptsoft.com

Comments and Discussions

 
QuestionClick Pinmemberrhfritz119-Jun-14 5:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web03 | 2.8.140916.1 | Last Updated 30 May 2011
Article Copyright 2011 by Jerry Jiang
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid