Sign in to follow this  

Window Resizing trouble

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
Sounds like your window is being treated as a dialog. I think the problem may be with your extended window style.

DWORD dwExStyle;
AdjustWindowRectEx(&WindowRect, dwStyle, FALSE, dwExStyle);

This code comes from Nehe tutorial 1, check that out if you are having problems:

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.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:

m_nX, m_nY,
m_nWidth, m_nHeight,

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this