Click here to Skip to main content
15,891,774 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: WinSock 2 / Win32 Pin
Fareed Rizkalla4-May-10 21:02
Fareed Rizkalla4-May-10 21:02 
GeneralRe: WinSock 2 / Win32 Pin
Spawn@Melmac5-May-10 0:13
Spawn@Melmac5-May-10 0:13 
Questionprevious next button to change pictures Pin
taouki18-Apr-10 7:04
taouki18-Apr-10 7:04 
AnswerRe: previous next button to change pictures Pin
cconklin18-Apr-10 7:07
cconklin18-Apr-10 7:07 
GeneralRe: previous next button to change pictures Pin
taouki18-Apr-10 7:10
taouki18-Apr-10 7:10 
AnswerRe: previous next button to change pictures Pin
loyal ginger18-Apr-10 7:41
loyal ginger18-Apr-10 7:41 
GeneralRe: previous next button to change pictures Pin
taouki18-Apr-10 7:54
taouki18-Apr-10 7:54 
GeneralRe: previous next button to change pictures Pin
loyal ginger18-Apr-10 9:03
loyal ginger18-Apr-10 9:03 
AnswerRe: previous next button to change pictures Pin
Maximilien18-Apr-10 8:01
Maximilien18-Apr-10 8:01 
QuestionRe: previous next button to change pictures Pin
David Crow19-Apr-10 3:30
David Crow19-Apr-10 3:30 
AnswerRe: previous next button to change pictures Pin
taouki23-Apr-10 23:50
taouki23-Apr-10 23:50 
QuestionClicking a windowless button programatically Pin
Green Fuze18-Apr-10 5:19
Green Fuze18-Apr-10 5:19 
AnswerRe: Clicking a windowless button programatically Pin
Member 321910418-Apr-10 6:40
Member 321910418-Apr-10 6:40 
AnswerRe: Clicking a windowless button programatically Pin
«_Superman_»18-Apr-10 7:52
professional«_Superman_»18-Apr-10 7:52 
When you spy on a button, for instance the Print button on a print dialog, you will see a field called Window Handle. This will have a value.

But when doing it programmatically, we usually use the Control ID field.

Here is what you can do to send a click on a button -
PostMessage(WM_COMMAND,	MAKELONG(ID_BUTTON, BN_CLICKED), reinterpret_cast<LPARAM>(GetDlgItem(ID_BUTTON)->m_hWnd));

I'm assuming ID_BUTTON to be the button id.
Replace that with the actual ID of the button.
I'm assuming you're using MFC.
«_Superman
I love work. It gives me something to do between weekends.

Microsoft MVP (Visual C++)

GeneralRe: Clicking a windowless button programatically Pin
Green Fuze18-Apr-10 9:55
Green Fuze18-Apr-10 9:55 
GeneralRe: Clicking a windowless button programatically Pin
«_Superman_»18-Apr-10 10:01
professional«_Superman_»18-Apr-10 10:01 
GeneralRe: Clicking a windowless button programatically Pin
Green Fuze18-Apr-10 19:29
Green Fuze18-Apr-10 19:29 
GeneralRe: Clicking a windowless button programatically Pin
Keith Worden19-Apr-10 3:27
Keith Worden19-Apr-10 3:27 
GeneralRe: Clicking a windowless button programatically Pin
Green Fuze19-Apr-10 3:56
Green Fuze19-Apr-10 3:56 
Questionhow to embed the window of my program in the desktop?(The window is showed under the desktop icons.) [modified] Pin
letianzhu17-Apr-10 20:30
letianzhu17-Apr-10 20:30 
Questionset print area Pin
Amin.Abdi17-Apr-10 8:34
Amin.Abdi17-Apr-10 8:34 
QuestionSerialize in vc++ 2008 Pin
Wasabi_17-Apr-10 3:04
Wasabi_17-Apr-10 3:04 
AnswerRe: Serialize in vc++ 2008 Pin
CPallini17-Apr-10 3:26
mveCPallini17-Apr-10 3:26 
GeneralRe: Serialize in vc++ 2008 Pin
Wasabi_17-Apr-10 3:30
Wasabi_17-Apr-10 3:30 
QuestionCalling Fns in formview Pin
hellogany16-Apr-10 23:58
hellogany16-Apr-10 23:58 

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

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