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

C / C++ / MFC

 
AnswerRe: Getting the handle of active window in other thread Pin
dudedotnet9-Oct-07 1:38
dudedotnet9-Oct-07 1:38 
GeneralRe: Getting the handle of active window in other thread Pin
Mark Salsbery9-Oct-07 5:52
Mark Salsbery9-Oct-07 5:52 
GeneralRe: Getting the handle of active window in other thread Pin
dudedotnet9-Oct-07 23:55
dudedotnet9-Oct-07 23:55 
QuestionInserting an ActiveX control based TreeView into a CAD program Pin
larsgregersen4-Oct-07 6:03
larsgregersen4-Oct-07 6:03 
QuestionIs there a way to switch focus?? Pin
Kiran Satish4-Oct-07 5:42
Kiran Satish4-Oct-07 5:42 
AnswerRe: Is there a way to switch focus?? Pin
Mark Salsbery4-Oct-07 5:51
Mark Salsbery4-Oct-07 5:51 
GeneralRe: Is there a way to switch focus?? Pin
Kiran Satish4-Oct-07 7:11
Kiran Satish4-Oct-07 7:11 
GeneralRe: Is there a way to switch focus?? Pin
Mark Salsbery4-Oct-07 7:30
Mark Salsbery4-Oct-07 7:30 
No matter what you use, you're going to need to know something
about the other process.

In this case, you need to know the other process' HWND.
FindWindow() can help if you know what you're looking for.
GetWindowThreadProcessId() may be useful as well.
It depends what info you have to identify the other process.

Once you have the window handle, you can use SetForegroundWindow()
to activate it.  You should then call GetLastActivePopup(), and if it returns
a different window handle then the one you activated, call
SetForegroundWindow() on that window.

Mark



Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: Is there a way to switch focus?? Pin
Kiran Satish4-Oct-07 11:30
Kiran Satish4-Oct-07 11:30 
GeneralRe: Is there a way to switch focus?? Pin
Mark Salsbery4-Oct-07 11:43
Mark Salsbery4-Oct-07 11:43 
GeneralRe: Is there a way to switch focus?? Pin
Kiran Satish4-Oct-07 13:00
Kiran Satish4-Oct-07 13:00 
GeneralRe: Is there a way to switch focus?? Pin
Mark Salsbery4-Oct-07 13:09
Mark Salsbery4-Oct-07 13:09 
GeneralRe: Is there a way to switch focus?? Pin
Kiran Satish5-Oct-07 7:33
Kiran Satish5-Oct-07 7:33 
GeneralRe: Is there a way to switch focus?? Pin
Mark Salsbery5-Oct-07 7:38
Mark Salsbery5-Oct-07 7:38 
GeneralRe: Is there a way to switch focus?? Pin
Kiran Satish5-Oct-07 9:36
Kiran Satish5-Oct-07 9:36 
GeneralRe: Is there a way to switch focus?? Pin
Mark Salsbery5-Oct-07 9:42
Mark Salsbery5-Oct-07 9:42 
GeneralRe: Is there a way to switch focus?? Pin
Kiran Satish5-Oct-07 9:51
Kiran Satish5-Oct-07 9:51 
GeneralRe: Is there a way to switch focus?? Pin
Mark Salsbery5-Oct-07 10:08
Mark Salsbery5-Oct-07 10:08 
GeneralRe: Is there a way to switch focus?? Pin
Kiran Satish8-Oct-07 5:55
Kiran Satish8-Oct-07 5:55 
QuestionDeque using elements from a class Pin
PolarFuzz4-Oct-07 5:10
PolarFuzz4-Oct-07 5:10 
QuestionRe: Deque using elements from a class Pin
David Crow4-Oct-07 5:33
David Crow4-Oct-07 5:33 
AnswerRe: Deque using elements from a class [modified] Pin
George L. Jackson4-Oct-07 5:54
George L. Jackson4-Oct-07 5:54 
GeneralRe: Deque using elements from a class Pin
led mike4-Oct-07 6:20
led mike4-Oct-07 6:20 
GeneralRe: Deque using elements from a class Pin
George L. Jackson4-Oct-07 6:32
George L. Jackson4-Oct-07 6:32 
GeneralRe: Deque using elements from a class Pin
led mike4-Oct-07 7:20
led mike4-Oct-07 7:20 

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.