News:

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

How window styles affect code?

Started by redskull, June 10, 2006, 03:26:18 AM

Previous topic - Next topic

redskull

I don't usually like to post "fix my code" type topics, but this one has me definitly stumped.  I was doing some experimenting in a 'pop-up' window (no borders, no moving, no sizing), and everything was working as expected.  Then, I went and changed the window style in the window creation from WS_POPUP back to WS_OVERLAPPEDWINDOW.  Much to my dismay, i now get nothing, just a plain white window with the borders and title bars, but nothing inside of it.  Changing it back to WS_POPUP fixes everything.  I ran through the program in the debugger, and every API function returns the right codes (no errors), and the program seems to be running normally....just nothing inside the window.  There seems to be little in the documentation about what the different window styles actually accomplish, and I can't even begin to see how changing the style would so adversly affect the code.  If anybody has any guesses, I would certainly appreciate them.  (Most the code is just bitmap experiment junk, strech and bit blitting and the like)

infinite thanks, alan
Strange women, lying in ponds, distributing swords, is no basis for a system of government

Casper

Alan,
I cannot reproduce your problem.  I have tried swapping styles in the asm file and also in the resource file.

Casper

redskull

well, the problem is fixed, but the mystery is not really solved:  I had some bitmap loading routines in a procedure, and was using the following order:

RegisterClassEx
CreateWindowEx
MyBitmapLoadingStuff
ShowWindow
UpdateWindow
(Message Loop)

When I changed the order around to:

RegisterClassEx
CreateWindowEx
ShowWindow
MyBitmapLoadingStuff
UpdateWindow

(Message Loop)

everything works fine, which leads me to the conclusion that the bitmaps weren't getting intialized properly.  The procedure I wrote really only had stuff like Polygon and LoadImage, but it did use a GetDC/ReleaseDC call.  Apparently you can't get a DC to the screen before you ShowWindow if the window is an overlapped one, but you can if it's a Popup?  If anybody has the secret answer to this mystery, or can manage to duplicate it to confirm my suspicions, or even point me in the direction of some cryptic microsoft reference material, it would certainly put my mind at ease. :(

infinite thanks, alan
Strange women, lying in ponds, distributing swords, is no basis for a system of government