Click here to Skip to main content
15,917,004 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalproblems with ShowWindow() Pin
AmericanBacon22-Jun-04 12:26
AmericanBacon22-Jun-04 12:26 
GeneralRe: problems with ShowWindow() Pin
gamitech22-Jun-04 12:38
gamitech22-Jun-04 12:38 
GeneralRe: how to cast cstring into char*? Pin
James R. Twine22-Jun-04 11:05
James R. Twine22-Jun-04 11:05 
GeneralChange Icon in Dialog Titlebar Pin
YooVeeAy22-Jun-04 11:00
YooVeeAy22-Jun-04 11:00 
GeneralRe: Change Icon in Dialog Titlebar Pin
bneacetp22-Jun-04 13:49
bneacetp22-Jun-04 13:49 
GeneralCPropertySheet::OnInitDialog() exception Pin
Richard John22-Jun-04 10:57
Richard John22-Jun-04 10:57 
GeneralRe: CPropertySheet::OnInitDialog() exception Pin
bangiev5-May-11 5:20
bangiev5-May-11 5:20 
GeneralBringing desktop window to the top without taking focus Pin
casid22-Jun-04 9:47
casid22-Jun-04 9:47 
Off and on for some time I've tried to find the best way to bring a window (whose parent is the desktop) to the top of all the other application windows on some particular event. They could very well be using another application window at the time so I can't allow it to take the focus away as this could result in lost keystrokes. My current implementation of this is basically the following:

HWND hwnd = ::GetForegroundWindow();
::SetWindowPos(myhwnd, hwnd, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE);
::SetWindowPos(myhwnd, hwnd, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE);

I've investigated numerous other ways over time. This works well but doesn't always work perfectly. Some times focus is stolen and sometimes the z-order isn't correct. These are rare cases and usually involve some specific other application that was in use at the time.

I'm wondering if anyone could offer solutions they've tested and used in the past for performing something similar?

Craig
GeneralRe: Bringing desktop window to the top without taking focus Pin
casid22-Jun-04 9:49
casid22-Jun-04 9:49 
Generalconcatenation Pin
RabiaRabia22-Jun-04 9:24
RabiaRabia22-Jun-04 9:24 
GeneralRe: concatenation Pin
ov22-Jun-04 9:30
ov22-Jun-04 9:30 
GeneralRe: concatenation Pin
gamitech22-Jun-04 12:44
gamitech22-Jun-04 12:44 
QuestionHow to remove this error Pin
RabiaRabia22-Jun-04 9:21
RabiaRabia22-Jun-04 9:21 
AnswerRe: How to remove this error Pin
ov22-Jun-04 9:32
ov22-Jun-04 9:32 
GeneralFeasability Question: C++ / UDP / MSSQL Pin
brian222222-Jun-04 9:07
brian222222-Jun-04 9:07 
GeneralRe: Feasability Question: C++ / UDP / MSSQL Pin
palbano22-Jun-04 9:47
palbano22-Jun-04 9:47 
Generalsaving modified BMPs Pin
TFB22-Jun-04 8:32
TFB22-Jun-04 8:32 
Questionhow to cast cstring into char*? Pin
vividwu22-Jun-04 7:32
vividwu22-Jun-04 7:32 
AnswerRe: how to cast cstring into char*? Pin
David Crow22-Jun-04 7:35
David Crow22-Jun-04 7:35 
GeneralRe: how to cast cstring into char*? Pin
Nitron22-Jun-04 8:04
Nitron22-Jun-04 8:04 
GeneralRe: how to cast cstring into char*? Pin
David Crow22-Jun-04 8:25
David Crow22-Jun-04 8:25 
GeneralRe: how to cast cstring into char*? Pin
Nitron22-Jun-04 8:48
Nitron22-Jun-04 8:48 
GeneralRe: how to cast cstring into char*? Pin
James R. Twine22-Jun-04 8:32
James R. Twine22-Jun-04 8:32 
GeneralRe: how to cast cstring into char*? Pin
vividwu22-Jun-04 8:13
vividwu22-Jun-04 8:13 
GeneralRe: how to cast cstring into char*? Pin
David Crow22-Jun-04 8:22
David Crow22-Jun-04 8:22 

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.