Click here to Skip to main content
15,900,372 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Window caption at center Pin
ThatsAlok14-Nov-05 1:12
ThatsAlok14-Nov-05 1:12 
AnswerRe: Window caption at center Pin
Arman S.14-Nov-05 1:12
Arman S.14-Nov-05 1:12 
QuestionDestination path ICopyHook Pin
ragavan13-Nov-05 22:17
ragavan13-Nov-05 22:17 
QuestionCButton SetFocus Pin
AORD13-Nov-05 21:00
AORD13-Nov-05 21:00 
AnswerRe: CButton SetFocus Pin
toxcct13-Nov-05 21:38
toxcct13-Nov-05 21:38 
GeneralRe: CButton SetFocus Pin
AORD14-Nov-05 18:23
AORD14-Nov-05 18:23 
GeneralRe: CButton SetFocus Pin
toxcct14-Nov-05 21:19
toxcct14-Nov-05 21:19 
AnswerRe: CButton SetFocus Pin
Rajesh R Subramanian13-Nov-05 23:20
professionalRajesh R Subramanian13-Nov-05 23:20 
AORD wrote:
GetDlgItem(IDC_MY_BUTTON)->SetFocus();


Well, it wont work. I have been facing similar problems, and I go down to PostMessage() level. What you probably can do is, Get the handle of the button with which you would want to deal, and then continue by posting an appropriate message. The following code snippet should help solving your problem.

<br />
HWND hButton;<br />
GetDlgItem(ID_MYBUTTON, &hButton); <br />
::PostMessage(hButton, BN_SETFOCUS, 1, 0);<br />


Regards,
Rajesh R. Subramanian,
Cyberscape Multimeida Limited,
Bombay, India.

You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
GeneralRe: CButton SetFocus Pin
Mircea Puiu14-Nov-05 5:45
Mircea Puiu14-Nov-05 5:45 
AnswerRe: CButton SetFocus Pin
Mircea Puiu14-Nov-05 5:04
Mircea Puiu14-Nov-05 5:04 
Answer... and to see the difference ... Pin
Mircea Puiu14-Nov-05 5:43
Mircea Puiu14-Nov-05 5:43 
GeneralRe: ... and to see the difference ... Pin
Rajesh R Subramanian14-Nov-05 17:18
professionalRajesh R Subramanian14-Nov-05 17:18 
GeneralRe: ... and to see the difference ... Pin
AORD14-Nov-05 18:21
AORD14-Nov-05 18:21 
QuestionWhy CListView do not inherit from CListCtrl Pin
white jungle13-Nov-05 20:49
white jungle13-Nov-05 20:49 
AnswerRe: Why CListView do not inherit from CListCtrl Pin
YaronNir14-Nov-05 1:37
YaronNir14-Nov-05 1:37 
AnswerRe: Why CListView do not inherit from CListCtrl Pin
Sheng Jiang 蒋晟14-Nov-05 19:24
Sheng Jiang 蒋晟14-Nov-05 19:24 
Questiondiff b/w LUID and SID Pin
sunit513-Nov-05 20:25
sunit513-Nov-05 20:25 
AnswerRe: diff b/w LUID and SID Pin
sunit513-Nov-05 21:00
sunit513-Nov-05 21:00 
QuestionIn MFC model less Dialogbox Pin
vikas amin13-Nov-05 19:24
vikas amin13-Nov-05 19:24 
AnswerRe: In MFC model less Dialogbox Pin
Mircea Puiu13-Nov-05 20:13
Mircea Puiu13-Nov-05 20:13 
AnswerRe: In MFC model less Dialogbox Pin
*Dreamz13-Nov-05 20:20
*Dreamz13-Nov-05 20:20 
GeneralRe: In MFC model less Dialogbox Pin
vikas amin13-Nov-05 21:04
vikas amin13-Nov-05 21:04 
Questionuse object itself as key in stl map Pin
yccheok13-Nov-05 19:18
yccheok13-Nov-05 19:18 
AnswerRe: use object itself as key in stl map Pin
Garth J Lancaster13-Nov-05 19:54
professionalGarth J Lancaster13-Nov-05 19:54 
AnswerRe: use object itself as key in stl map Pin
*Dreamz13-Nov-05 20:39
*Dreamz13-Nov-05 20:39 

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.