Also ok so geht es
// Fenster auf dem Desktop zentriert
HWND hwnd = GetDesktopWindow();
CRect rc;
GetWindowRect(hwnd, &rc);
int dx = rc.right - rc.left;
int dy = rc.bottom - rc.top;
[/PHP]
Meine Frage ist wie kann ich jetzt machen dass ich den Dialog (SDI) zentrieren kann
Das habe ich versucht, leider ohne Erfolg
[PHP]
HWND hwnd = GetDesktopWindow();
CRect rc;
GetWindowRect(hwnd, &rc);
int dx = rc.right - rc.left;
int dy = rc.bottom - rc.top;
m_pMainWnd->MoveWindow(dx/2, dy/2,dx,dy, TRUE);
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
m_pMainWnd->ShowWindow(SW_SHOW);
m_pActiveWnd->CenterWindow();
[/PHP]