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

Tagged as

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

, 30 May 2011 CPOL
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);


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


About the Author

Jerry Jiang
Founder Maple Technology Software
Canada Canada
Education:Master of Computer Science.
A passionate software developer since 1992,now lives in Vancouver.

Comments and Discussions

QuestionClick Pinmemberrhfritz119-Jun-14 6: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 | Terms of Use | Mobile
Web03 | 2.8.150224.1 | Last Updated 30 May 2011
Article Copyright 2011 by Jerry Jiang
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid