Click here to Skip to main content
16,005,552 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Pop Up loading message Pin
acerunner31627-Nov-06 15:26
acerunner31627-Nov-06 15:26 
GeneralRe: Pop Up loading message [modified] Pin
Mark Salsbery27-Nov-06 15:49
Mark Salsbery27-Nov-06 15:49 
GeneralRe: Pop Up loading message Pin
acerunner31627-Nov-06 16:04
acerunner31627-Nov-06 16:04 
GeneralRe: Pop Up loading message Pin
Mark Salsbery27-Nov-06 16:47
Mark Salsbery27-Nov-06 16:47 
GeneralRe: Pop Up loading message Pin
Scott Holt27-Nov-06 13:57
Scott Holt27-Nov-06 13:57 
GeneralRe: Pop Up loading message Pin
acerunner31627-Nov-06 14:14
acerunner31627-Nov-06 14:14 
GeneralRe: Pop Up loading message Pin
Scott Holt27-Nov-06 15:30
Scott Holt27-Nov-06 15:30 
GeneralRe: Pop Up loading message Pin
Scott Holt27-Nov-06 15:38
Scott Holt27-Nov-06 15:38 
OK, my bad...you're evidently using MFC, which provides its own "flavor" of 'GetFocus()'. Try the following:

CWnd* pwndSaveFocus = GetFocus() ;

...


SetFocus(pwndSaveFocus) ;

The difference is that 'GetFocus()' and 'SetFocus()' from the MFC classes operate on an instance of the 'CWnd' class. The code I originally gave you is bare-bones Windows API, and operates on window handles (HWND). The 'CWnd' class in MFC actually encapsulates HWNDs.

Alternatively, you could force the use of the Windows API functions by using the scoping operator to go "outside" the MFC scope to the global scope, as follows:

HWND hwndSaveFocus = ::GetFocus() ;

...

::SetFocus(hwndSaveFocus) ;

The '::' at the beginning of each of the above statements forces the compiler to bypass the MFC functions and map directly to the Windows API.

Hope this gets you a little closer.

Scott



GeneralRe: Pop Up loading message Pin
acerunner31627-Nov-06 15:56
acerunner31627-Nov-06 15:56 
GeneralRe: Pop Up loading message Pin
acerunner31628-Nov-06 8:33
acerunner31628-Nov-06 8:33 
GeneralRe: Pop Up loading message Pin
Scott Holt28-Nov-06 9:57
Scott Holt28-Nov-06 9:57 
GeneralRe: Pop Up loading message Pin
Mark Salsbery27-Nov-06 11:26
Mark Salsbery27-Nov-06 11:26 
AnswerRe: Pop Up loading message Pin
Aqueel27-Nov-06 22:28
Aqueel27-Nov-06 22:28 
QuestionAnother beginner Q Pin
Ray_mond27-Nov-06 7:29
Ray_mond27-Nov-06 7:29 
QuestionRe: Another beginner Q Pin
Maximilien27-Nov-06 7:33
Maximilien27-Nov-06 7:33 
AnswerRe: Another beginner Q Pin
Ray_mond27-Nov-06 10:22
Ray_mond27-Nov-06 10:22 
QuestionFOLDER ACCESS PERMISSION Pin
Killer327-Nov-06 6:15
Killer327-Nov-06 6:15 
AnswerRe: FOLDER ACCESS PERMISSION Pin
David Crow27-Nov-06 7:30
David Crow27-Nov-06 7:30 
AnswerRe: FOLDER ACCESS PERMISSION Pin
Mark Salsbery27-Nov-06 7:39
Mark Salsbery27-Nov-06 7:39 
QuestionCFileDialog Pin
Nyarlatotep27-Nov-06 6:01
Nyarlatotep27-Nov-06 6:01 
AnswerRe: CFileDialog Pin
BlitzPackage27-Nov-06 6:19
BlitzPackage27-Nov-06 6:19 
GeneralRe: CFileDialog Pin
Nyarlatotep27-Nov-06 6:55
Nyarlatotep27-Nov-06 6:55 
GeneralRe: CFileDialog Pin
Humberto27-Nov-06 8:17
Humberto27-Nov-06 8:17 
AnswerRe: CFileDialog Pin
cje27-Nov-06 7:22
cje27-Nov-06 7:22 
GeneralRe: CFileDialog Pin
Nyarlatotep27-Nov-06 7:29
Nyarlatotep27-Nov-06 7:29 

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.