Click here to Skip to main content
15,912,504 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to replace the occurences of a macro with the new one? Pin
gagan_84212-Jun-06 20:51
gagan_84212-Jun-06 20:51 
AnswerRe: How to replace the occurences of a macro with the new one? Pin
Viorel.12-Jun-06 20:59
Viorel.12-Jun-06 20:59 
Questionquestion on dialog box Pin
Kiran Pinjala12-Jun-06 20:00
Kiran Pinjala12-Jun-06 20:00 
AnswerRe: question on dialog box [modified] Pin
Laxman Auti12-Jun-06 20:11
Laxman Auti12-Jun-06 20:11 
AnswerRe: question on dialog box Pin
_AnsHUMAN_ 12-Jun-06 20:11
_AnsHUMAN_ 12-Jun-06 20:11 
AnswerRe: question on dialog box Pin
khan++12-Jun-06 20:15
khan++12-Jun-06 20:15 
AnswerRe: question on dialog box Pin
Ganesh_T12-Jun-06 20:25
Ganesh_T12-Jun-06 20:25 
AnswerRe: question on dialog box Pin
Sarath C12-Jun-06 20:39
Sarath C12-Jun-06 20:39 
Nish has a good work around for this problem. this one i have taken from voidnish.com

He says:
How to steal focus on 2K/XP

I bet that sometimes you long for the old days when a simple SetForegroundWindow brought your dialog into focus. Sigh! Now with 2K/XP things have sorta changed so that if you try a simple SetForegroundWindow you end up flashing the taskbar icon a few times (I never counted but something tells me it flashes thrice). Not exactly what you wanted to do, eh? Luckily there are ways to bring your dialog into the foreground.

The trick is to use AttachThreadInput to attach the thread that owns the current foreground window to our thread, then call SetForegroundWindow and then detach the attached thread, again using AttachThreadInput. Cool, huh?

//Attach foreground window thread
//to our thread
AttachThreadInput(
    GetWindowThreadProcessId(
        ::GetForegroundWindow(),NULL),
    GetCurrentThreadId(),TRUE);

//Do our stuff here ;-)
SetForegroundWindow();
SetFocus(); //Just playing safe

//Detach the attached thread
AttachThreadInput(
    GetWindowThreadProcessId(
        ::GetForegroundWindow(),NULL),
    GetCurrentThreadId(),FALSE);


SaRath.

"Don't Do Different things... Do Things Differently..."

Understanding State Pattern in C++

QuestionProblem in getting the active view Document pointer Pin
narayanagvs12-Jun-06 19:55
narayanagvs12-Jun-06 19:55 
QuestionHow to embed external document? Pin
Super Lloyd12-Jun-06 19:55
Super Lloyd12-Jun-06 19:55 
Questionhow we can move the bitmap when the mouse dragged Pin
happy_ram12-Jun-06 19:44
happy_ram12-Jun-06 19:44 
AnswerRe: how we can move the bitmap when the mouse dragged Pin
Laxman Auti12-Jun-06 20:16
Laxman Auti12-Jun-06 20:16 
QuestionRe: how we can move the bitmap when the mouse dragged Pin
happy_ram12-Jun-06 20:24
happy_ram12-Jun-06 20:24 
AnswerRe: how we can move the bitmap when the mouse dragged Pin
Justin Tay12-Jun-06 20:22
Justin Tay12-Jun-06 20:22 
GeneralRe: how we can move the bitmap when the mouse dragged Pin
happy_ram12-Jun-06 20:28
happy_ram12-Jun-06 20:28 
GeneralRe: how we can move the bitmap when the mouse dragged [modified] Pin
Justin Tay12-Jun-06 20:55
Justin Tay12-Jun-06 20:55 
Generalhere is my code Pin
happy_ram12-Jun-06 21:24
happy_ram12-Jun-06 21:24 
GeneralRe: here is my code [modified] Pin
Justin Tay12-Jun-06 21:50
Justin Tay12-Jun-06 21:50 
GeneralRe: here is my code Pin
happy_ram12-Jun-06 22:34
happy_ram12-Jun-06 22:34 
GeneralRe: here is my code Pin
Justin Tay12-Jun-06 22:43
Justin Tay12-Jun-06 22:43 
GeneralRe: here is my code Pin
happy_ram12-Jun-06 22:49
happy_ram12-Jun-06 22:49 
GeneralRe: here is my code Pin
Justin Tay12-Jun-06 23:27
Justin Tay12-Jun-06 23:27 
GeneralRe: here is my code [modified] Pin
happy_ram12-Jun-06 23:45
happy_ram12-Jun-06 23:45 
GeneralRe: here is my code Pin
Justin Tay13-Jun-06 0:37
Justin Tay13-Jun-06 0:37 
GeneralRe: here is my code Pin
happy_ram13-Jun-06 0:45
happy_ram13-Jun-06 0:45 

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.