Click here to Skip to main content
15,915,508 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionis this kind icon in an exe file possible? Pin
includeh1012-Dec-04 4:05
includeh1012-Dec-04 4:05 
AnswerRe: is this kind icon in an exe file possible? Pin
PJ Arends12-Dec-04 9:20
professionalPJ Arends12-Dec-04 9:20 
Generalras "error 632" Pin
mohsen nourian12-Dec-04 3:52
mohsen nourian12-Dec-04 3:52 
GeneralYahoo Messenger Pin
Member 141138912-Dec-04 3:08
Member 141138912-Dec-04 3:08 
GeneralBUG: ScrollWindowEx smoothscrolling, Child windows are drawn displaced Pin
Nalik12-Dec-04 2:03
Nalik12-Dec-04 2:03 
GeneralUpdateResource() ------ 2 Pin
includeh1012-Dec-04 0:49
includeh1012-Dec-04 0:49 
GeneralUpdateResource function Pin
includeh1012-Dec-04 0:29
includeh1012-Dec-04 0:29 
QuestionHow can I change focus between child windows within an MDI application Pin
wicked_guy12-Dec-04 0:16
wicked_guy12-Dec-04 0:16 
Hello everyone,

I am having trouble changing focus from child window to another. Of course, I want to be able to do that without using the mouse or keyboard, but the code itself. The application is used in an automated video grabbing.
This is the code I have written:

class CMyAppDoc : public CDocument
{
public:
CView *pOldActiveView;
..
..


CMyAppDoc::OnButton1()
{
CMDIFrameWnd* pMainWnd = (CMDIFrameWnd*)AfxGetMainWnd();

// Get the active MDI child window.
CMDIChildWnd* pChild = (CMDIChildWnd*)pMainWnd->MDIGetActive();

// Get the active view attached to the active MDI child window.
pOldActiveView = pChild->GetActiveView();
}

After clicking Button1 I manually change the focus by the mouse and then click Button2, which includes the following code:

CMyAppDoc::Button2()
{
pOldActiveView->SetActiveWindow();
}

Summarizing the code, clicking the Button1 should assign the pointer pOldActiveView the address of the active child window during the time it is pressed. Then After manually chainging the focus to another child window the active child window will change but the pointer is still pointing to our old active child window. So then by clicking Button2 should set the focus on the old child window, but unfortunately nothing changes.

I have also tried "pOldActiveView->SetFocus()" instead but didn't change anything as well.

Any help will be highly appreciated.
QuestionDid I miss something? Pin
jw8111-Dec-04 23:18
jw8111-Dec-04 23:18 
AnswerRe: Did I miss something? Pin
*Dreamz12-Dec-04 19:01
*Dreamz12-Dec-04 19:01 
GeneralRe: Did I miss something? Pin
jw8112-Dec-04 19:05
jw8112-Dec-04 19:05 
GeneralRe: Did I miss something? Pin
*Dreamz12-Dec-04 19:14
*Dreamz12-Dec-04 19:14 
GeneralRe: Did I miss something? Pin
jw8113-Dec-04 4:45
jw8113-Dec-04 4:45 
GeneralRe: Did I miss something? Pin
*Dreamz13-Dec-04 17:27
*Dreamz13-Dec-04 17:27 
GeneralC++ GameHook help Pin
RipeNades11-Dec-04 21:59
RipeNades11-Dec-04 21:59 
GeneraleMbedded Pin
su_penguin11-Dec-04 20:53
su_penguin11-Dec-04 20:53 
GeneralSingle MDI child Pin
sthaas11-Dec-04 19:58
sthaas11-Dec-04 19:58 
Generala little help... Pin
titanswimmer11-Dec-04 13:36
titanswimmer11-Dec-04 13:36 
GeneralRe: a little help... Pin
bob1697212-Dec-04 8:43
bob1697212-Dec-04 8:43 
Generalbitmap data Pin
includeh1011-Dec-04 12:40
includeh1011-Dec-04 12:40 
GeneralRe: bitmap data Pin
HalfWayMan12-Dec-04 1:31
HalfWayMan12-Dec-04 1:31 
GeneralRe: bitmap data Pin
includeh1012-Dec-04 2:11
includeh1012-Dec-04 2:11 
GeneralRe: bitmap data Pin
HalfWayMan12-Dec-04 2:33
HalfWayMan12-Dec-04 2:33 
Generalasynchronnous download from web Pin
PetoG11-Dec-04 6:51
PetoG11-Dec-04 6:51 
GeneralRe: asynchronnous download from web Pin
Neville Franks11-Dec-04 9:44
Neville Franks11-Dec-04 9:44 

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.