Eine ganz einfach Möglichkeit überhaupt erstmal einen Rahmen im Fenster zu ziehen ist diese:
LRESULT CALLBACK MainProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
switch(Msg)
{
case WM_CLOSE:
case WM_DESTROY:
{
PostQuitMessage(0);
return 0;
}
case WM_LBUTTONDOWN:
{
Last.x = LOWORD(lParam);
Last.y = HIWORD(lParam);
return 0;
}
case WM_LBUTTONUP:
{
Last.x = Last.y = 0;
UpdateWindow(hWnd);
return 0;
}
case WM_MOUSEMOVE:
{
if (Last.x != 0 && Last.y != 0 && wParam == MK_LBUTTON)
{
HDC hDC = GetDC(hWnd);
int i= Rectangle(hDC,Last.x,Last.y,LOWORD(lParam),HIWORD(lParam));
ReleaseDC(hWnd,hDC);
}
return 0;
}
default:
return 0;
}
}
[/PHP]
Muss natürlich noch an vielen Stellen angepasst werden