Assuming you're using the Win32 API, the following function function might do the trick.
Code:
/*
* Centers a window in the screen.
*/
void CenterWindowInScreen( HWND hwnd )
{
if ( !IsWindow(hwnd) ) return;
RECT rcWindow;
GetWindowRect(hwnd,&rcWindow);
int width = rcWindow.right - rcWindow.left;
int height = rcWindow.bottom - rcWindow.top;
int centerX =( GetSystemMetrics(SM_CXSCREEN) - width)/2;
int centerY =( GetSystemMetrics(SM_CYSCREEN) - height)/2;
SetWindowPos(hwnd,HWND_TOP,centerX,centerY,0,0,
SWP_NOSIZE|SWP_NOZORDER);
}