Restrict Window move
-
Hi, Can we restrict the window move to certain extent in screen. We can move the window left or right by clicking on the Caption Bar and when we move to left side,its get moved and and also it moves out of screen alos. Can we restrict that.Like it should be move when X=50,y=50.With this limit it should move anywhere.But after that it shold not move. Pls help me.
Anu
-
Hi, Can we restrict the window move to certain extent in screen. We can move the window left or right by clicking on the Caption Bar and when we move to left side,its get moved and and also it moves out of screen alos. Can we restrict that.Like it should be move when X=50,y=50.With this limit it should move anywhere.But after that it shold not move. Pls help me.
Anu
Have a look at this DavidCrow's article: "Bounded rectangles". :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
Hi, Can we restrict the window move to certain extent in screen. We can move the window left or right by clicking on the Caption Bar and when we move to left side,its get moved and and also it moves out of screen alos. Can we restrict that.Like it should be move when X=50,y=50.With this limit it should move anywhere.But after that it shold not move. Pls help me.
Anu
You restrict your window's size by handling the WM_GETMINMAXINFO message. LRESULT OnGetMinMaxInfo ( WPARAM wParam, LPARAM lParam ) { MINMAXINFO* pmmi = (MINMAXINFO*) lParam; pmmi->ptMinTrackSize.x = 100; pmmi->ptMinTrackSize.y = 150; pmmi->ptMaxTrackSize.x = 600; pmmi->ptMaxTrackSize.y = 400; return 0; }
-
You restrict your window's size by handling the WM_GETMINMAXINFO message. LRESULT OnGetMinMaxInfo ( WPARAM wParam, LPARAM lParam ) { MINMAXINFO* pmmi = (MINMAXINFO*) lParam; pmmi->ptMinTrackSize.x = 100; pmmi->ptMinTrackSize.y = 150; pmmi->ptMaxTrackSize.x = 600; pmmi->ptMaxTrackSize.y = 400; return 0; }
-
Have a look at this DavidCrow's article: "Bounded rectangles". :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
I saw that.And when i change the left and right corner,the size of dialog get changed.
Anu