2 registered members (AndrewAMD, Ayumi),
877
guests, and 2
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
maximize window problem
#290355
09/18/09 16:15
09/18/09 16:15
|
Joined: Mar 2007
Posts: 197
yorisimo
OP
Member
|
OP
Member
Joined: Mar 2007
Posts: 197
|
GS 7.801 Pro Windows Vista I want a resizeable window with a maximize button so I am using:
video_window(NULL, NULL, 4+16+32+64+128, 0);
I've defined:
on_maximize = MaximizeEvent;
on_resize = ResizeEvent;
function ResizeEvent(){
RECT r;
GetClientRect(hWnd,&r);
video_set(r.right,r.bottom,0,0);
}
function MaximizeEvent(){
RECT r;
GetClientRect(hWnd,&r);
video_set(r.right,r.bottom,0,0);
}
The window is resizeable, maximizeable, and automatically adjusts resolution correctly. The problem is, with multiple monitors, it does not maximize correctly on the primary monitor. A little bit of the border hangs over to the secondary monitor. The overhanging border does not occur without the thick resizeable border:
video_window(NULL, NULL, 16+32+64+128, 0);
I've noticed that the overhanging border only occurs when maximized on the primary monitor when the start bar is in a horizontal configuration on the primary monitor. Even if the start bar is on the secondary monitor, there is no border overhanging problem maximizing on the secondary monitor I tried removing the resizeable border in the MaximizeEvent function, but that unmaximizes the window. Also there is a problem of maximizing the window on a window that has negative coordinates as I've posted earlier that jcl said he would look in to.
|
|
|
Re: maximize window problem
[Re: jcl]
#290983
09/22/09 18:32
09/22/09 18:32
|
Joined: Mar 2007
Posts: 197
yorisimo
OP
Member
|
OP
Member
Joined: Mar 2007
Posts: 197
|
OK, I simply added code to the OnMaximizeEvent and OnResizeEvent to remove and restore the sizing border when maximizing and restoring so it works nicely now:
function OnResizeEvent(){
RECT r;
//Replace the sizing border
video_window(NULL, NULL, 4+16+32+64+128, 0);
GetClientRect(hWnd,&r);
video_set(r.right,r.bottom,0,0);
}
function OnMaximizeEvent(){
RECT r;
//Remove the sizing border without using video_window and set to open maximized
SetWindowLong(hWnd, GWL_STYLE, WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX|WS_MAXIMIZEBOX|WS_MAXIMIZE);
//Activate the last change from above
SetWindowPos(hWnd, NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
GetClientRect(hWnd,&r);
video_set(r.right,r.bottom,0,0);
}
|
|
|
|