Jump to content
  • Advertisement
Sign in to follow this  
sp00n

Window Resizing trouble

This topic is 4613 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

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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);




Share this post


Link to post
Share on other sites
Sorted. It was my dodgy msg pump, discarding messages instead of passing to DefWindProc :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!