Window Resizing trouble

Started by
2 comments, last by sp00n 18 years, 6 months ago
I'm having a bit of grief trying to get a windowed D3D9 app to be resizeable (i.e., by dragging the corner of it with a mouse like a usual window.) the window class style is CS_HREDRAW | CS_VREDRAW | CS_OWNDC, and was created as WS_OVERLAPPEDWINDOW | WS_VISIBLE. whenever i try to re-size with the mouse, the cursor changes to the re-size cursor as i move the windows cursor over the border of the window, but when i try to drag to resize the window, nothing happens, i get no resizing of the window, and no drag-resize rectangle to the cursor. as soon as i drag the cursor outide the window border, it changes back to a standard cursor. I've determined (from log functions added to msg pump) that the window is not recieving WM_SIZE or WM_SIZING messages whenever i try to resize. Could anybody give me some pointers? Thanx, sp00n
-= sp00n =-There are 10 kinds of people in this world: those who understand binary and those who don't.
Advertisement
Sounds like your window is being treated as a dialog. I think the problem may be with your extended window style.

DWORD	dwExStyle;dwExStyle=WS_EX_APPWINDOW | WS_EX_WINDOWEDGE;...AdjustWindowRectEx(&WindowRect, dwStyle, FALSE, dwExStyle);


This code comes from Nehe tutorial 1, check that out if you are having problems:
http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=01
I've tried it but it still doesn't work, I cant drag the window with the title bar either.

here are the values for my WNDCLASSEX:

	wcex.cbSize		= sizeof(WNDCLASSEX); 	wcex.style		= CS_HREDRAW | CS_VREDRAW | CS_OWNDC;	wcex.lpfnWndProc	= StaticMsgProc;	wcex.cbClsExtra		= NULL;	wcex.cbWndExtra		= NULL;	wcex.hInstance		= g_hInst;	wcex.hIcon		= LoadIcon(NULL, IDI_APPLICATION);	wcex.hCursor		= LoadCursor(NULL, IDC_ARROW);	wcex.hbrBackground	= (HBRUSH)GetStockObject(WHITE_BRUSH);	wcex.lpszMenuName	= NULL;	wcex.lpszClassName	= m_sName.c_str();	wcex.hIconSm		= LoadIcon(NULL, IDI_APPLICATION);



and this is what I'm passing to CreateWindowEx:
CreateWindowEx(WS_EX_APPWINDOW | WS_EX_WINDOWEDGE,				   m_sName.c_str(),				   m_sName.c_str(),				   WS_OVERLAPPEDWINDOW,				   m_nX, m_nY,				   m_nWidth, m_nHeight,				   NULL,				   NULL,				   g_hInst,				   NULL);




-= sp00n =-There are 10 kinds of people in this world: those who understand binary and those who don't.
Sorted. It was my dodgy msg pump, discarding messages instead of passing to DefWindProc :)
-= sp00n =-There are 10 kinds of people in this world: those who understand binary and those who don't.

This topic is closed to new replies.

Advertisement