News:

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

Centering a window on another window

Started by NoCforMe, April 09, 2012, 01:56:13 AM

Previous topic - Next topic

dedndave

Steve,
for IE, there is a feature called "Compatibility View"
you may have it disabled   :P

i am using XP MCE2005, SP3 with IE8 - Compatibilty View enabled
your post looks the same in Firefox and IE

jj2007

Just checked with IE7 (<rant>I'll never understand why the bloody beast points me every single time I start it to runonce, although I always tell it what my homepage is</rant>), and I can confirm that IE does not show the tabs correctly. Looks awful indeed.

SteveAsm

Quote from: dedndave on April 09, 2012, 05:24:29 PM
for IE, there is a feature called "Compatibility View"
you may have it disabled   :P

i am using XP MCE2005, SP3 with IE8 - Compatibilty View enabled
your post looks the same in Firefox and IE

Dave,
I'm aware of "Compatibility View".
I'm running XP, SP3, IE8 w/Compatibility View enabled.
And this is what I see for many posts with code:

    INVOKEGetWindowRect, winHandle, ADDR gpRect

    MOVEAX, gpRect.right
    SUBEAX, gpRect.left
    SUBEAX, winWidth
    MOVECX, EAX
    ANDECX, 1 SHL 31
    SHREAX, 1
    OREAX, ECX
    ADDEAX, gpRect.left
    MOVECX, EAX

where TABS are used in the code.

NoCforMe

Dunno why y'all are having problems with IE. I just tried my version (old: v5) and it displayed correctly.

Did Micro$oft break tab rendering in later versions of IE?

dedndave

ok - i was playing around - lol
you have to disable compatibility view for this site
IE - Tools menu - Compatibility View

i had it disabled for alll websites except those in my list
IE - Tools menu - Compatibility View Settings

SteveAsm

Quote from: dedndave on April 09, 2012, 06:59:11 PM
ok - i was playing around - lol
you have to disable compatibility view for this site
IE - Tools menu - Compatibility View

i had it disabled for alll websites except those in my list
IE - Tools menu - Compatibility View Settings

Okay, once I removed masm32 from my Compatibility View list, it displayed correctly.
Now, I can't remember why I had it on my list.   :eek

SteveAsm

#21
Quote from: SteveAsm on April 09, 2012, 10:59:25 PM
Okay, once I removed masm32 from my Compatibility View list, it displayed correctly.
Now, I can't remember why I had it on my list.   :eek

Ohoh!
now I remember.
It has to due with SMF Forums.
SMF Forums, (and masm32 is one of them), has a glitch that pertains to IE-8.
Unless you use Compatibility View, when entering text in the textbox for submitting a post, the textbox becomes unstable.
I remember discussing this in emails with SMF support. It is a well known bug.
Their only solution is to turn Compatibility View ON.
Try it.
Using IE8, Compatibility View turned OFF, enter (or copy) a dozen or so lines of text and at the end of the page, start typing.
It will become unstable.

This raises another issue, tho'.
Now, as I have illustrated, with Compatibility View turned ON, TABS become a problem as text is run together without proper spacing.

hfheatherfox07

Hi there this seems to be a good Idea what am I doing wrong invoking the  SetWindowPos ?
... I commented out because It crashes on me  :(

dedndave

SWP_NOMOVE + SWP_NOSIZE

you should OR constants together, not ADD

SWP_NOMOVE or SWP_NOSIZE

but - that's not the problem

also, the x and y position parameters will be ignored if the SWP_NOMOVE flag is set   :P

but - that's not the problem

hfheatherfox07

Quote from: dedndave on April 11, 2012, 10:09:33 PM
SWP_NOMOVE + SWP_NOSIZE

you should OR constants together, not ADD

SWP_NOMOVE or SWP_NOSIZE

but - that's not the problem

also, the x and y position parameters will be ignored if the SWP_NOMOVE flag is set   :P

but - that's not the problem


so what is the problem?

dedndave

    Call CenterWindow
CenterWindow PROC winHandle:HWND, winWidth:DWORD, winHeight:DWORD
when CenterWindow returns, it POP's 3 dwords off the stack
lemme see - that'd be the stored EBP value, the return address for DlgProc, and the hWnd parm   :bg
no wonder it crashes
then - when you exit the DlgProc routine, it tries to jam the uMsg value into ESP and POP wParam into EBP   :lol
it then proceeds to execute code at the address of whatever lParam is pointing to - probably crashes right there

hfheatherfox07

Quote from: dedndave on April 11, 2012, 10:14:20 PM
    Call CenterWindow
CenterWindow PROC winHandle:HWND, winWidth:DWORD, winHeight:DWORD


LOL ...

I don't get it

Gunner

If you use call, you need to push the parameters then call,  or use invoke and you would see what the error is!
~Rob (Gunner)
- IE Zone Editor
- Gunners File Type Editor
http://www.gunnerinc.com

dedndave

well, first, you have to get the window width and height
i am guessing you want to center it on the desktop, so you can use GetSystemMetrics for those
        INVOKE  CenterWindow,hWnd,width,height