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

C / C++ / MFC

 
GeneralRe: visual studio 2005 problem with converting strings Pin
Stephen Hewitt25-Jun-06 0:22
Stephen Hewitt25-Jun-06 0:22 
GeneralRe: visual studio 2005 problem with converting strings Pin
Michael Dunn25-Jun-06 7:52
sitebuilderMichael Dunn25-Jun-06 7:52 
Questionwhy is a virus, my pe file? Pin
zon_cpp24-Jun-06 19:31
zon_cpp24-Jun-06 19:31 
AnswerRe: why is a virus, my pe file? [modified] Pin
Stephen Hewitt24-Jun-06 19:52
Stephen Hewitt24-Jun-06 19:52 
AnswerRe: why is a virus, my pe file? Pin
Ted Ferenc24-Jun-06 21:46
Ted Ferenc24-Jun-06 21:46 
QuestionReturn the Caption of Windows Pin
Max++24-Jun-06 18:06
Max++24-Jun-06 18:06 
AnswerRe: Return the Caption of Windows Pin
Michael Dunn24-Jun-06 18:23
sitebuilderMichael Dunn24-Jun-06 18:23 
GeneralRe: Return the Caption of Windows [modified] Pin
Stephen Hewitt24-Jun-06 19:29
Stephen Hewitt24-Jun-06 19:29 
If you want the window that has focus in the entire system GetFocus will not do the trick. To quote MSDN:
 "GetFocus returns the window with the keyboard focus for the current thread's message queue. If GetFocus returns NULL, another thread's queue may be attached to a window that has the keyboard focus. "

If you want the window with focus in the whole system and not just the calling thread (and threads that have been attached to it through the AttachThreadInput function) you can do so through the GetGUIThreadInfo API. i.e.
GUITHREADINFO gti;
bti.cbSize = sizeof(GUITHREADINFO);
if (GetGUIThreadInfo(NULL, >i))
{
    HWND hFocus = gti.hwndFocus;
}


I don't think this works on 95 (does on 98) however.

Steve
GeneralRe: Return the Caption of Windows Pin
Hamid_RT25-Jun-06 2:14
Hamid_RT25-Jun-06 2:14 
GeneralRe: Return the Caption of Windows Pin
Stephen Hewitt25-Jun-06 3:19
Stephen Hewitt25-Jun-06 3:19 
QuestionQuestion about memory locations. Pin
Lord Kixdemp24-Jun-06 15:39
Lord Kixdemp24-Jun-06 15:39 
QuestionRe: Question about memory locations. Pin
Jun Du24-Jun-06 16:13
Jun Du24-Jun-06 16:13 
AnswerRe: Question about memory locations. Pin
Lord Kixdemp24-Jun-06 16:18
Lord Kixdemp24-Jun-06 16:18 
GeneralRe: Question about memory locations. Pin
Jun Du24-Jun-06 16:30
Jun Du24-Jun-06 16:30 
GeneralRe: Question about memory locations. Pin
Lord Kixdemp24-Jun-06 19:15
Lord Kixdemp24-Jun-06 19:15 
AnswerRe: Question about memory locations. Pin
Justin Tay25-Jun-06 0:28
Justin Tay25-Jun-06 0:28 
GeneralRe: Question about memory locations. Pin
Jun Du25-Jun-06 1:57
Jun Du25-Jun-06 1:57 
GeneralRe: Question about memory locations. Pin
Justin Tay25-Jun-06 2:23
Justin Tay25-Jun-06 2:23 
GeneralRe: Question about memory locations. Pin
Lord Kixdemp26-Jun-06 21:58
Lord Kixdemp26-Jun-06 21:58 
GeneralRe: Question about memory locations. Pin
Justin Tay27-Jun-06 5:02
Justin Tay27-Jun-06 5:02 
GeneralRe: Question about memory locations. Pin
Lord Kixdemp27-Jun-06 8:57
Lord Kixdemp27-Jun-06 8:57 
GeneralRe: Question about memory locations. Pin
Justin Tay27-Jun-06 21:24
Justin Tay27-Jun-06 21:24 
GeneralRe: Question about memory locations. Pin
Lord Kixdemp1-Jul-06 17:00
Lord Kixdemp1-Jul-06 17:00 
QuestionApplication failed to initialize using Detours [modified] Pin
Sam Hobbs24-Jun-06 15:21
Sam Hobbs24-Jun-06 15:21 
QuestionIE Toolbar or BHO Images and Temp Folder Location Pin
Ranjan Banerji24-Jun-06 15:11
Ranjan Banerji24-Jun-06 15:11 

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.