disable the the resize or move on dialogbox?
I'm still new learning the WinAPI so please don't mind me. For example if I just create dialog box, but then I don't want the user to drag it or change the size of it, so can I disable all that?
[210 byte] By [
mase] at [2007-11-20 11:38:55]

# 1 Re: disable the the resize or move on dialogbox?
In the dialog procedure (provided by laitinen here (http://www.dev-archive.com/forum/showthread.php?t=437025))
From most recent topics:
if (message == WM_SYSCOMMAND && ((wParam & SC_SIZE) == SC_SIZE || (wParam & SC_MOVE) == SC_MOVE) )
{
return TRUE; // Ignore if move or size
}
regards
# 2 Re: disable the the resize or move on dialogbox?
In the dialog procedure (provided by laitinen here (http://www.dev-archive.com/forum/showthread.php?t=437025))
From most recent topics:
if (message == WM_SYSCOMMAND && ((wParam & SC_SIZE) == SC_SIZE || (wParam & SC_MOVE) == SC_MOVE) )
{
return TRUE; // Ignore if move or size
}
regards
thanks, I did search though in the forum, but it didn't come up what I was looking for. I will try it out..
mase at 2007-11-9 13:33:55 >

# 3 Re: disable the the resize or move on dialogbox?
FAQ here (http://www.dev-archive.com/forum/showthread.php?t=318933)
Even though it is MFC specific, you can get the idea.
WM_GETMINMAXINFO is desirable since , if I am right, it shall be called even if one tries to programmatically change the coords using APIs like SetWindowPos/MoveWindow
# 4 Re: disable the the resize or move on dialogbox?
This works perfect kirants :thumb: , I had to use ptMinTrackSize and ptMaxTrackSize.
if(message == WM_GETMINMAXINFO ) {
((LPMINMAXINFO)lParam)->ptMinTrackSize.x=400;
((LPMINMAXINFO)lParam)->ptMinTrackSize.y=300;
((LPMINMAXINFO)lParam)->ptMaxTrackSize.x=500;
((LPMINMAXINFO)lParam)->ptMaxTrackSize.y=500;
return 0;
}
thanks once again kirants.
regards