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

C / C++ / MFC

 
GeneralRe: Hexidecimal to decimal conversion Pin
Rick York11-Apr-02 5:13
mveRick York11-Apr-02 5:13 
GeneralRe: Hexidecimal to decimal conversion Pin
Niklas L11-Apr-02 6:00
Niklas L11-Apr-02 6:00 
GeneralRe: Hexidecimal to decimal conversion Pin
Ravi Bhavnani11-Apr-02 6:20
professionalRavi Bhavnani11-Apr-02 6:20 
GeneralConsole Font/Color Pin
EvilSource11-Apr-02 4:56
EvilSource11-Apr-02 4:56 
GeneralRe: Console Font/Color Pin
moliate11-Apr-02 5:56
moliate11-Apr-02 5:56 
Generalwindow size Pin
Rajveer11-Apr-02 3:51
Rajveer11-Apr-02 3:51 
GeneralRe: window size Pin
Mazdak11-Apr-02 4:45
Mazdak11-Apr-02 4:45 
GeneralRe: window size Pin
Joel Holdsworth11-Apr-02 4:51
Joel Holdsworth11-Apr-02 4:51 
The solution which initially springs to mind is what you can do with the PreCreateWindow function. As the name suggest, this function is called right before the window is created. The only parameter is a reference to a CREATESTRUCT. Create structs have these parameters...

LPVOID lpCreateParams;
HINSTANCE hInstance;
HMENU hMenu;
HWND hwndParent;
int cy;
int cx;
int y;
int x;
LONG style;
LPCTSTR lpszName;
LPCTSTR lpszClass;
DWORD dwExStyle;

All of these variables are a goldmine of useful settings. Whats interesting about CREATESTRUCT in the context of MDI is that lpCreateParams is a pointer to a MDICREATESTRUCT. This has these members...

LPCTSTR szClass;
LPCTSTR szTitle;
HANDLE hOwner;
int x;
int y;
int cx;
int cy;
DWORD style;
LPARAM lParam;

with this you can do all sorts of stuff like setting the windows size, and by changing the style parameter you can get the window maximized...

e.g. ((MDICREATESTRUCT*)cs.lpCreateParams)->style |= WS_MAXIMIZE;

Hope that lots of use!


With time we live, with money we spend!
Joel Holdsworth
GeneralI'm a total fraud!!! God am I a newbie!!! :) Pin
LukeV11-Apr-02 3:56
LukeV11-Apr-02 3:56 
GeneralRe: I'm a total fraud!!! God am I a newbie!!! :) Pin
LukeV11-Apr-02 4:13
LukeV11-Apr-02 4:13 
GeneralRe: I'm a total fraud!!! God am I a newbie!!! :) Pin
Bernhard11-Apr-02 4:23
Bernhard11-Apr-02 4:23 
GeneralRe: I'm a total fraud!!! God am I a newbie!!! :) Pin
LukeV11-Apr-02 4:27
LukeV11-Apr-02 4:27 
GeneralRe: I'm a total fraud!!! God am I a newbie!!! :) Pin
Bernhard11-Apr-02 4:31
Bernhard11-Apr-02 4:31 
GeneralRe: I'm a total fraud!!! God am I a newbie!!! :) Pin
LukeV11-Apr-02 4:34
LukeV11-Apr-02 4:34 
GeneralRe: I'm a total fraud!!! God am I a newbie!!! :) Pin
Bernhard11-Apr-02 4:37
Bernhard11-Apr-02 4:37 
GeneralRe: I'm a total fraud!!! God am I a newbie!!! :) Pin
luckylours11-Apr-02 4:36
luckylours11-Apr-02 4:36 
GeneralRe: I'm a total fraud!!! God am I a newbie!!! :) Pin
Oz Ben Eliezer11-Apr-02 13:45
Oz Ben Eliezer11-Apr-02 13:45 
GeneralRe: I'm a total fraud!!! God am I a newbie!!! :) Pin
Bernhard11-Apr-02 20:02
Bernhard11-Apr-02 20:02 
GeneralRe: I'm a total fraud!!! God am I a newbie!!! :) Pin
Tim Smith11-Apr-02 10:16
Tim Smith11-Apr-02 10:16 
GeneralSTL and VC++ Pin
xicoloko11-Apr-02 3:39
xicoloko11-Apr-02 3:39 
GeneralRe: STL and VC++ Pin
Nish Nishant11-Apr-02 7:23
sitebuilderNish Nishant11-Apr-02 7:23 
GeneralRe: STL and VC++ Pin
Tim Smith11-Apr-02 10:16
Tim Smith11-Apr-02 10:16 
GeneralRe: STL and VC++ Pin
Mike Nordell11-Apr-02 9:00
Mike Nordell11-Apr-02 9:00 
GeneralWINDOWPLACEMENT Pin
NC11-Apr-02 3:37
NC11-Apr-02 3:37 
GeneralRe: WINDOWPLACEMENT Pin
Jeremy Falcon11-Apr-02 10:11
professionalJeremy Falcon11-Apr-02 10:11 

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.