Click here to Skip to main content
15,886,078 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
AnswerRe: Calling Fns in formview Pin
hellogany17-Apr-10 0:47
hellogany17-Apr-10 0:47 
QuestionCan you help me ? I need source code of a program like Total commander. Pin
thanhkhanhcntt16-Apr-10 15:18
thanhkhanhcntt16-Apr-10 15:18 
AnswerRe: Can you help me ? I need source code of a program like Total commander. PinPopular
Tim Craig16-Apr-10 17:50
Tim Craig16-Apr-10 17:50 
GeneralRe: Can you help me ? I need source code of a program like Total commander. Pin
thanhkhanhcntt16-Apr-10 20:15
thanhkhanhcntt16-Apr-10 20:15 
AnswerRe: Can you help me ? I need source code of a program like Total commander. Pin
Wes Aday16-Apr-10 18:04
professionalWes Aday16-Apr-10 18:04 
AnswerRe: Can you help me ? I need source code of a program like Total commander. Pin
jeron117-Apr-10 2:02
jeron117-Apr-10 2:02 

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.