Click here to Skip to main content
15,885,366 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: CSplitterWnd error Pin
Bram van Kampen5-Aug-06 15:59
Bram van Kampen5-Aug-06 15:59 
GeneralRe: CSplitterWnd error Pin
Tengil996-Aug-06 1:14
Tengil996-Aug-06 1:14 
Questionfstream object not cleared from memory Pin
jon-805-Aug-06 4:01
professionaljon-805-Aug-06 4:01 
AnswerRe: fstream object not cleared from memory Pin
Gary R. Wheeler5-Aug-06 5:42
Gary R. Wheeler5-Aug-06 5:42 
GeneralRe: fstream object not cleared from memory Pin
jon-805-Aug-06 6:09
professionaljon-805-Aug-06 6:09 
QuestionAdd a non-resource-dialog to a CPropertySheet Pin
Tengil995-Aug-06 3:43
Tengil995-Aug-06 3:43 
AnswerRe: Add a non-resource-dialog to a CPropertySheet Pin
Tengil995-Aug-06 6:48
Tengil995-Aug-06 6:48 
QuestionActive Foreground Window Pin
Imtiaz Murtaza5-Aug-06 1:44
Imtiaz Murtaza5-Aug-06 1:44 
Dear friends,
I've a simple MFC application that only consists of a main window. What my application does is that, it launches MS-Word and makes MS-Word window as a child window of my main window.

When the focus is in MS-Word Window, 'operating system' makes its parent window (i.e my main window) as inactive and turns is titlebar as grey. It is so because, though MS-Word window is a child window of my main window, it runs in a separate process.

My main window only becomes active when i click on it. Now the problem is that i want to programatically activate my main window when user is typing in MS-Word window and presses Ctrl+P. My application uses Key board hooking to detect Ctrl+P.

The question is that how do i activate my main window????

I first tried SetActiveWindow API, but it didn't work Frown | :( MSDN doc says abt this API that :

The SetActiveWindow function activates a window, but not if the application is in the background

Obviously my application is in background when focus is in MS word window, so may be thats why this API is not working.

I also tried SetWindowPos and SetForegroundWindow but no result.

Can you suggest me that how do i activate my main window and bring it in the foreground with input focus.



Imtiaz

Questionhow to select CListCtrl Items programatically Pin
GANsJob5-Aug-06 0:54
GANsJob5-Aug-06 0:54 
AnswerRe: how to select CListCtrl Items programatically Pin
Hamid_RT5-Aug-06 1:33
Hamid_RT5-Aug-06 1:33 
AnswerRe: how to select CListCtrl Items programatically Pin
Marc Soleda5-Aug-06 3:54
Marc Soleda5-Aug-06 3:54 
QuestionReading Media File in 100 thread instances Pin
Andy Rama5-Aug-06 0:47
Andy Rama5-Aug-06 0:47 
QuestionCOPY AND PASTE CODE in vc++ Pin
ningthemcha4-Aug-06 23:57
ningthemcha4-Aug-06 23:57 
AnswerRe: COPY AND PASTE CODE in vc++ Pin
Hans Dietrich5-Aug-06 17:37
mentorHans Dietrich5-Aug-06 17:37 
QuestionHow can I grayed out i.e. Enable or dissable the controls from Tool bar Pin
Sameer_Thakur4-Aug-06 23:26
Sameer_Thakur4-Aug-06 23:26 
AnswerRe: How can I grayed out i.e. Enable or dissable the controls from Tool bar Pin
Amar Sutar4-Aug-06 23:40
Amar Sutar4-Aug-06 23:40 
AnswerRe: How can I grayed out i.e. Enable or dissable the controls from Tool bar Pin
Hamid_RT5-Aug-06 2:40
Hamid_RT5-Aug-06 2:40 
Questioncommunication b/w modeless dlg and its parent Pin
GANsJob4-Aug-06 21:46
GANsJob4-Aug-06 21:46 
AnswerRe: communication b/w modeless dlg and its parent Pin
_AnsHUMAN_ 4-Aug-06 21:59
_AnsHUMAN_ 4-Aug-06 21:59 
GeneralRe: communication b/w modeless dlg and its parent Pin
GANsJob5-Aug-06 0:48
GANsJob5-Aug-06 0:48 
QuestionRe: communication b/w modeless dlg and its parent Pin
Hamid_RT5-Aug-06 1:19
Hamid_RT5-Aug-06 1:19 
QuestionRead data from file and separate to keep Pin
Max++4-Aug-06 21:36
Max++4-Aug-06 21:36 
AnswerRe: Read data from file and separate to keep Pin
_AnsHUMAN_ 4-Aug-06 22:00
_AnsHUMAN_ 4-Aug-06 22:00 
AnswerRe: Read data from file and separate to keep Pin
Graham Shanks4-Aug-06 22:00
Graham Shanks4-Aug-06 22:00 
AnswerRe: Read data from file and separate to keep Pin
Hamid_RT5-Aug-06 3:12
Hamid_RT5-Aug-06 3:12 

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.