Click here to Skip to main content
15,896,118 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Ribbon Bar creates multiple menu items with same name Pin
Dale Haessel9-Nov-09 9:35
Dale Haessel9-Nov-09 9:35 
GeneralRe: Ribbon Bar creates multiple menu items with same name Pin
Randor 9-Nov-09 10:54
professional Randor 9-Nov-09 10:54 
GeneralRe: Ribbon Bar creates multiple menu items with same name Pin
Dale Haessel9-Nov-09 12:37
Dale Haessel9-Nov-09 12:37 
GeneralRe: Ribbon Bar creates multiple menu items with same name Pin
Randor 9-Nov-09 13:15
professional Randor 9-Nov-09 13:15 
QuestionIncrease mainframe window if right side of inserted view is out of MainFrames client area [modified] Pin
Fusshoeller9-Nov-09 7:05
Fusshoeller9-Nov-09 7:05 
AnswerRe: Increase mainframe window if right side of inserted view is out of MainFrames client area Pin
«_Superman_»9-Nov-09 8:02
professional«_Superman_»9-Nov-09 8:02 
GeneralRe: Increase mainframe window if right side of inserted view is out of MainFrames client area Pin
Fusshoeller9-Nov-09 8:33
Fusshoeller9-Nov-09 8:33 
AnswerRe: Increase mainframe window if right side of inserted view is out of MainFrames client area Pin
Fusshoeller10-Nov-09 22:20
Fusshoeller10-Nov-09 22:20 
My own answer to my own question. A little stupid but maybe someone can use my solution to save some times and delivers new idears.

I solved my problem as follows:
First i used the sysinternals freeware zoom tool (http://technet.microsoft.com/de-de/sysinternals/bb897434%28en-us%29.aspx[^])to find the sizes of frames and borders.
Then the second tool the winspector tool from gipsysoft (http://www.windows-spy.com/[^] )to find out coordinates and classes of the interesting frames.

With this informations i was looking for parent() parent()....... frames and windows until i found the windows and frames with the correct coordinates.

The resulting code as follows:


CRect MainFrameClientRect,MainFrameClientRectSC,ViewsFrameWindowRect,PPWindowRectSC;
CWnd* PP;
//ClientRect  of mainframe 
PP=GetParent()->GetParent();
PP->GetClientRect(MainFrameClientRect);
MainFrameClientRectSC=MainFrameClientRect;
PP->ClientToScreen(MainFrameClientRectSC);

//View covering outside frame
GetParentFrame()->GetWindowRect(ViewsFrameWindowRect);

CMainFrame* pMainFrame=(CMainFrame* )theApp.GetMainWnd();
WINDOWPLACEMENT MainFramePlacement;
MainFramePlacement.length = sizeof(WINDOWPLACEMENT);

//Get the Mainframes actual position
::GetWindowPlacement(pMainFrame->m_hWnd,&MainFramePlacement);

//if views right/bottom edge is outside mainframes client area increase MainFramePlacement right/bottom
// coordinates so view windows right/bottom  will be next to mainframes client area right/bottom 
 
if(ViewsFrameWindowRect.right>MainFrameClientRectSC.right)
MainFramePlacement.rcNormalPosition.right+=ViewsFrameWindowRect.right-MainFrameClientRectSC.right;
if(ViewsFrameWindowRect.bottom>MainFrameClientRectSC.bottom)
MainFramePlacement.rcNormalPosition.bottom+=ViewsFrameWindowRect.bottom-MainFrameClientRectSC.bottom;

//increase and position mainframe
pMainFrame->SetWindowPos(NULL,
												 MainFramePlacement.rcNormalPosition.left,
												 MainFramePlacement.rcNormalPosition.top,
												 MainFramePlacement.rcNormalPosition.right-MainFramePlacement.rcNormalPosition.left,
												 MainFramePlacement.rcNormalPosition.bottom-MainFramePlacement.rcNormalPosition.top,
												 SWP_NOZORDER);
pMainFrame->ShowWindow(theApp.m_nCmdShow);
pMainFrame->UpdateWindow();


Thanks to all which were looking at my question and thinking about a solution but couldn't help.
Questionhow to use createprocess to create a new console window(cmd.exe) and run commands Pin
devgo9-Nov-09 7:03
devgo9-Nov-09 7:03 
AnswerRe: how to use createprocess to create a new console window(cmd.exe) and run commands Pin
Randor 9-Nov-09 7:17
professional Randor 9-Nov-09 7:17 
GeneralRe: how to use createprocess to create a new console window(cmd.exe) and run commands Pin
devgo9-Nov-09 7:28
devgo9-Nov-09 7:28 
QuestionRe: how to use createprocess to create a new console window(cmd.exe) and run commands Pin
David Crow9-Nov-09 7:52
David Crow9-Nov-09 7:52 
GeneralRe: how to use createprocess to create a new console window(cmd.exe) and run commands Pin
Randor 9-Nov-09 7:54
professional Randor 9-Nov-09 7:54 
GeneralRe: how to use createprocess to create a new console window(cmd.exe) and run commands Pin
devgo9-Nov-09 9:18
devgo9-Nov-09 9:18 
GeneralRe: how to use createprocess to create a new console window(cmd.exe) and run commands Pin
Randor 9-Nov-09 10:19
professional Randor 9-Nov-09 10:19 
GeneralRe: how to use createprocess to create a new console window(cmd.exe) and run commands Pin
devgo9-Nov-09 10:56
devgo9-Nov-09 10:56 
GeneralRe: how to use createprocess to create a new console window(cmd.exe) and run commands Pin
devgo11-Nov-09 9:15
devgo11-Nov-09 9:15 
GeneralRe: how to use createprocess to create a new console window(cmd.exe) and run commands Pin
Randor 11-Nov-09 16:34
professional Randor 11-Nov-09 16:34 
QuestionIs there a way to register an activeX ocx file with relative path and not full path? Pin
eyal_balla9-Nov-09 4:31
eyal_balla9-Nov-09 4:31 
AnswerRe: Is there a way to register an activeX ocx file with relative path and not full path? Pin
Chris Losinger9-Nov-09 5:34
professionalChris Losinger9-Nov-09 5:34 
QuestionHow do I get contents of long strings in VS 2008 debugger? Pin
Interrobang9-Nov-09 4:28
Interrobang9-Nov-09 4:28 
AnswerRe: How do I get contents of long strings in VS 2008 debugger? Pin
loyal ginger9-Nov-09 4:48
loyal ginger9-Nov-09 4:48 
AnswerRe: How do I get contents of long strings in VS 2008 debugger? Pin
Chris Losinger9-Nov-09 4:50
professionalChris Losinger9-Nov-09 4:50 
QuestionSimple CToolTipCtrl trouble. Pin
Nikz29-Nov-09 4:20
Nikz29-Nov-09 4:20 
AnswerRe: Simple CToolTipCtrl trouble. Pin
Code-o-mat9-Nov-09 5:24
Code-o-mat9-Nov-09 5:24 

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.