Click here to Skip to main content
15,884,836 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionStatic registry for classfactory handles Pin
rana742-Jun-06 2:20
rana742-Jun-06 2:20 
QuestionForeground process Pin
KKumarTG2-Jun-06 2:20
KKumarTG2-Jun-06 2:20 
AnswerRe: Foreground process Pin
Ștefan-Mihai MOGA2-Jun-06 2:26
professionalȘtefan-Mihai MOGA2-Jun-06 2:26 
QuestionRe: Foreground process Pin
David Crow2-Jun-06 3:18
David Crow2-Jun-06 3:18 
AnswerRe: Foreground process Pin
Sebastian Schneider2-Jun-06 3:23
Sebastian Schneider2-Jun-06 3:23 
GeneralRe: Foreground process Pin
David Crow2-Jun-06 3:31
David Crow2-Jun-06 3:31 
GeneralRe: Foreground process Pin
KKumarTG2-Jun-06 3:49
KKumarTG2-Jun-06 3:49 
GeneralRe: Foreground process Pin
David Crow2-Jun-06 4:21
David Crow2-Jun-06 4:21 
This behavior is by design (for Windows 2000). Instead of bringing the window to the front, it simply calls FlashWindow(). As a workaround, try:

if (GetForegroundWindow() != hWnd)
{     
    DWORD dwThreadID1 = GetWindowThreadProcessId(GetForegroundWindow(), NULL);
    DWORD dwThreadID2 = GetWindowThreadProcessId(hWnd, NULL);
 
    if (dwThreadID1 != dwThreadID2)
    {
         AttachThreadInput(dwThreadID1, dwThreadID2, TRUE);
         SetForegroundWindow(hWnd);
         AttachThreadInput(dwThreadID1, dwThreadID2, FALSE);
    }
    else
         SetForegroundWindow(hWnd);
 
    if (IsIconic(hWnd))
        ShowWindow(hWnd, SW_RESTORE);
    else
        ShowWindow(hWnd, SW_SHOW);
}



"The largest fire starts but with the smallest spark." - David Crow


GeneralRe: Foreground process Pin
KKumarTG2-Jun-06 5:23
KKumarTG2-Jun-06 5:23 
QuestionRe: Foreground process Pin
David Crow2-Jun-06 8:04
David Crow2-Jun-06 8:04 
AnswerRe: Foreground process Pin
James R. Twine2-Jun-06 4:44
James R. Twine2-Jun-06 4:44 
GeneralRe: Foreground process [modified] Pin
Nemanja Trifunovic2-Jun-06 4:52
Nemanja Trifunovic2-Jun-06 4:52 
GeneralRe: Foreground process Pin
Sebastian Schneider2-Jun-06 5:01
Sebastian Schneider2-Jun-06 5:01 
GeneralRe: Foreground process Pin
Zac Howland2-Jun-06 5:25
Zac Howland2-Jun-06 5:25 
GeneralRe: Foreground process Pin
Sebastian Schneider2-Jun-06 7:46
Sebastian Schneider2-Jun-06 7:46 
GeneralRe: Foreground process Pin
Zac Howland2-Jun-06 8:02
Zac Howland2-Jun-06 8:02 
GeneralRe: Foreground process Pin
Sebastian Schneider2-Jun-06 8:27
Sebastian Schneider2-Jun-06 8:27 
GeneralRe: Foreground process Pin
Nemanja Trifunovic2-Jun-06 4:53
Nemanja Trifunovic2-Jun-06 4:53 
GeneralRe: Foreground process Pin
Sebastian Schneider2-Jun-06 5:03
Sebastian Schneider2-Jun-06 5:03 
Questiondelete in ctor ! Pin
vikramlinux2-Jun-06 2:16
vikramlinux2-Jun-06 2:16 
AnswerRe: delete in ctor ! Pin
toxcct2-Jun-06 2:19
toxcct2-Jun-06 2:19 
AnswerRe: delete in ctor ! Pin
Ștefan-Mihai MOGA2-Jun-06 2:21
professionalȘtefan-Mihai MOGA2-Jun-06 2:21 
GeneralRe: delete in ctor ! Pin
vikramlinux2-Jun-06 2:26
vikramlinux2-Jun-06 2:26 
AnswerRe: delete in ctor ! [modified] Pin
Chris Losinger2-Jun-06 2:23
professionalChris Losinger2-Jun-06 2:23 
NewsRe: delete in ctor ! [modified] Pin
Roland Pibinger2-Jun-06 4:06
Roland Pibinger2-Jun-06 4:06 

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.