News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

creating a window with F1 toggle for full screen

Started by hfheatherfox07, August 11, 2011, 08:38:52 PM

Previous topic - Next topic

hfheatherfox07

thanks... so what does the SetFsp  PROC  does exactly....

I meant to ask this earlier .... how come the message box "X" close is deactivated ....it is like that with some of my other examples too....is this something in MASM specific?
I have some examples with no source and the "x" is activated so you have the option to cancel....

dedndave

i suspect you need an InitCommonControls before calling MessageBox
let me try it...

hfheatherfox07

Quote from: dedndave on August 19, 2011, 02:37:45 AM
i suspect you need an InitCommonControls before calling MessageBox
let me try it...

would coinitialize CommonControls be better? just remembered seeing that yesterday when I was doing something

dedndave

ok - if the message box does not have a cancel button, it won't have a close box, either   :P
so - if we use MB_YESNO, you won't get the close box

so, back to SetFsp
that procedure probably looks a little intimidating
i should have written it for clarity instead of small size
sorry about that

the job of that proc is to figure out what window position and size values to use to get full screen
the window has borders and a title bar
so, that proc determines how large they are
then figures out the coordinates for the fsp structure
for example, if the border on the left side of the window is 4 pixels wide, we need to set the x position to -4
i think the title bar is 30 pixels high, so we set the y position to -30
it does this by getting the window rectangle and the client rectangle,
converting 2 points using ClientToScreen, and doing some math to set the fsp structure values