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

C / C++ / MFC

 
GeneralSendMessage from CDocument Pin
6-Aug-01 4:02
suss6-Aug-01 4:02 
GeneralRe: SendMessage from CDocument Pin
6-Aug-01 4:11
suss6-Aug-01 4:11 
GeneralHelp with Tab controls Pin
Dave Midgley6-Aug-01 3:16
Dave Midgley6-Aug-01 3:16 
GeneralRe: Help with Tab controls Pin
Not Active6-Aug-01 3:28
mentorNot Active6-Aug-01 3:28 
GeneralRe: Help with Tab controls Pin
Tomasz Sowinski6-Aug-01 10:07
Tomasz Sowinski6-Aug-01 10:07 
GeneralRe: Help with Tab controls Pin
Not Active6-Aug-01 10:54
mentorNot Active6-Aug-01 10:54 
GeneralRe: Help with Tab controls Pin
Tomasz Sowinski6-Aug-01 11:16
Tomasz Sowinski6-Aug-01 11:16 
GeneralAdjustWindowRect problems Pin
Peter Andersson6-Aug-01 2:16
Peter Andersson6-Aug-01 2:16 
Hello,
I want to create my mainframe with a certain size. Right now I have overridden CMainFrame::PreCreateWindow and I set the members of the CREATESTRUCT x,y,cx and cy to hardcoded values.
I would however like to do this properly, by using AdjustWindowRect(Ex) to calculate the values for me.

The whole point is I want the client area to be of zero height, like the Visual Basic development environment used to be.

Confused | :confused: I cannot make this work. Here is my code:

BOOL COptixFrmMain::PreCreateWindow(CREATESTRUCT& cs)
{
cs.style &= ~WS_MAXIMIZEBOX;
// cs.style &= ~WS_THICKFRAME;
// cs.style &= ~WS_SYSMENU;

/* These values are the ones I want!
cs.x = 0;
cs.y = 0;
cs.cx = 450;
cs.cy = 105;
*/
RECT rect;
SetRectEmpty(&rect);
rect.right = 450; // I want it to be 450 wide
::AdjustWindowRect(&rect,cs.style,TRUE);

cs.x = 0;
cs.y = 0;
cs.cx = rect.right - rect.left;
cs.cy = rect.bottom - rect.top;

cs.lpszClass = AfxRegisterWndClass(
CS_DBLCLKS, // if you need double-clicks
NULL, // no cursor (use default)
NULL, // no background brush
AfxGetApp()->LoadIcon(IDR_MAINFRAME)); // app icon
ASSERT(cs.lpszClass);
if( !SECFDIFrameWnd::PreCreateWindow(cs) )
return FALSE;
return TRUE;
}

If you look carefully, you can see that I use Objective Toolkit, and their FDI classes, but that should hardly matter in this case.

All help is appreciated! Rose | [Rose]

************************
Peter Andersson
peter.andersson@dtsag.ch
GeneralRe: AdjustWindowRect problems Pin
Not Active6-Aug-01 3:10
mentorNot Active6-Aug-01 3:10 
GeneralRe: AdjustWindowRect problems Pin
Peter Andersson6-Aug-01 3:34
Peter Andersson6-Aug-01 3:34 
GeneralAutomating Visual C++ Project Creation Pin
Steve Thresher6-Aug-01 1:34
Steve Thresher6-Aug-01 1:34 
GeneralRe: Automating Visual C++ Project Creation Pin
J Patel6-Aug-01 11:10
J Patel6-Aug-01 11:10 
GeneralRe: Automating Visual C++ Project Creation Pin
Steve Thresher6-Aug-01 23:09
Steve Thresher6-Aug-01 23:09 
GeneralRe: Automating Visual C++ Project Creation Pin
Tim Deveaux6-Aug-01 12:38
Tim Deveaux6-Aug-01 12:38 
GeneralRe: Automating Visual C++ Project Creation Pin
Steve Thresher6-Aug-01 23:06
Steve Thresher6-Aug-01 23:06 
GeneralRe: Automating Visual C++ Project Creation Pin
Nick Van den Abbeele7-Aug-01 0:51
Nick Van den Abbeele7-Aug-01 0:51 
GeneralRe: Automating Visual C++ Project Creation Pin
Tim Deveaux7-Aug-01 9:34
Tim Deveaux7-Aug-01 9:34 
GeneralRe: Automating Visual C++ Project Creation Pin
Steve Thresher7-Aug-01 22:31
Steve Thresher7-Aug-01 22:31 
GeneralLine style and color Pin
6-Aug-01 1:26
suss6-Aug-01 1:26 
GeneralRe: Line style and color Pin
Not Active6-Aug-01 3:11
mentorNot Active6-Aug-01 3:11 
GeneralCAsyncSocket Pin
6-Aug-01 0:38
suss6-Aug-01 0:38 
GeneralMulti Document Interface question Pin
Ashman6-Aug-01 0:22
Ashman6-Aug-01 0:22 
GeneralRe: Multi Document Interface question Pin
Not Active6-Aug-01 3:13
mentorNot Active6-Aug-01 3:13 
GeneralVirus Scanners Pin
Steve Thresher6-Aug-01 0:00
Steve Thresher6-Aug-01 0:00 
Generalmfc windows explorer insantiy Pin
karmatosed5-Aug-01 23:56
karmatosed5-Aug-01 23:56 

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.