• Advertisement

Archived

This topic is now archived and is closed to further replies.

Window creation problems...

This topic is 6683 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

When you say it doesn't do anything after the CreateWindowEx, do you mean it's actually crashing on CreateWindowEx? Or is it crashing on another line? If another line, which line?

Share this post


Link to post
Share on other sites
Advertisement
I don't know what exactly is happening with the createwindow call, but...

Isn't there something else you have to do for multimon support? I remember seeing HMONITOR variables and EnumMonitor calls somewhere... and I believe there's a sample app that shows how to do it (multi-monitor Roids, I think).

Sorry if I'm restating the obvious.

Mason McCuskey
Spin Studios
www.spin-studios.com

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
It crashes on the CreateWindowEx() call.
I put OutputDebugString() calls before and after it, and it would output the one above it but not the one below it.
Any suggestions?

Share this post


Link to post
Share on other sites
It could be something in your WndProc. Right after you create a window (before the call returns), it's going to start processing messages.

I am assuming you can't use a debugger here for some reason...

------------------

-Kentamanos

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
All I could figure is you need the WS_VISIBLE flag for window style also, it worked fine for me when I did it, didn't work without it!

Share this post


Link to post
Share on other sites
Here's the scenario: I set up a window to use with a fullscreen DirectDraw game. It worked fine. Then I go and set up another monitor, complete with another video card to run it (thats two monitors, now, not just one). Now it crashes before creating a window (it doesn't do anything past the CreateWindowEx() call). I don't know if the two are related, but I really don't know what else it could be. Here is my window creation code:

// A handle to the window.
HWND hwnd;

// The windows class that describes the window.
WNDCLASS wc;

// Set up and register the window class.
wc.style = CS_DBLCLKS;
wc.lpfnWndProc = ( WNDPROC )WindowProc;
wc.cbClsExtra = NULL;
wc.cbWndExtra = NULL;
wc.hInstance = hInstance;
wc.hIcon = LoadIcon( hInstance, IDI_APPLICATION );
wc.hCursor = LoadCursor( NULL, IDC_ARROW );
wc.hbrBackground = ( HBRUSH )GetStockObject( BLACK_BRUSH );
wc.lpszMenuName = NULL;
wc.lpszClassName = "HEATHENwindow";

if ( RegisterClass( &wc ) == FALSE )
return FALSE;

// Create a fullscreen window.
if ( ( hwnd = CreateWindowEx( WS_EX_TOPMOST, "HEATHENwindow", "HEAHTEN",
WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, 0, 0,
SCREEN_W, SCREEN_H, NULL, NULL, hInstance, NULL ) )
== NULL )
return FALSE;

I would appreciate any help anyone might have. My mind is boggled.

Matthew Allen
- mallen22@concentric.net
- http://members.tripod.com/mxf_entertainment/

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I feel stupid I didn't really think about the problem obviously, I think Kentamanos is right about WndProc being the probable cause.

Share this post


Link to post
Share on other sites

  • Advertisement