1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| void CMainFrame::OnMove(int x, int y)
{
CFrameWnd::OnMove(x, y);
int ScreenWidth ;
int ScreenHeight;
ScreenWidth = GetSystemMetrics(SM_CXSCREEN);
ScreenHeight = GetSystemMetrics(SM_CYSCREEN);
if(x<0)
{
SetWindowPos(NULL, 0,y-49, mainframe_size_height, mainframe_size_width, SWP_SHOWWINDOW);
}
if(x>ScreenWidth-550)
//550*590 taille de la mainframe que j'ai fixé
{
SetWindowPos(NULL, ScreenWidth-550,y-49, mainframe_size_height, mainframe_size_width, SWP_SHOWWINDOW);
}
if(y>ScreenHeight-590+20)//20 : taille de la barre des tâches
{
SetWindowPos(NULL, x,ScreenHeight-590+20-50, mainframe_size_height, mainframe_size_width, SWP_SHOWWINDOW);
}
} |
Partager