Skip to main content
gamedev.net
🔒 Locked

CreateWindowEx question

Started by lakibuk Oct 17, 2003 at 1:18 PM 6 replies 700+ views
Original Post
lakibuk
lakibuk
I am creating a window with this function. No matter which values i set in width and height, the window is always sized 648x511. Anyone an idea what''s wrong? hWnd = CreateWindowEx(0, NAME, TITLE, WS_OVERLAPPED|WS_MINIMIZEBOX|WS_SYSMENU, CW_USEDEFAULT, CW_USEDEFAULT, width, height, NULL, NULL, hInstance, NULL);
merlin9x9
merlin9x9
Well, that looks fine to me. Try putting some literals in there instead of width and height to see if that fixes the problem. If it does, then those variables are somehow getting ignored or having their values replaced. Then either use your debugger''s trace feature or some outputs to figure out where this is happening.
jammanut
jammanut
I''m new to WIN32 programming but I''ll try and help. I''ve looked at Visual Studio help files and the only thing I can see that might be wrong is that you are using WS_xxxxxx style parameters instead of WS_EX_xxxxxx.
I hope this is of some help.
lakibuk
lakibuk
Using literals produces the same effect. No matter what value they have.
WS_EX... tried this, doesn''t make a difference.
strange...
Mastaba
Mastaba
How are you making the window visible? That is probably where the error is.
lakibuk
lakibuk
I am using this code,after creating the window.
It get''s the windows position and size.
It''s already 648x511 directly after the creation,before it is shown.

if (hWnd) GetWindowRect(hWnd, &g_rcWindow);
merlin9x9
merlin9x9
Using WC_EX_ flags is not your problem, because only that first parameter takes them because it''s the one that signifies an extended style. The fourth parameter is for regular styles, hence the WS_ flags.

Well, perhaps it''s time to post your code.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.