Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Languages / VC10.0

CenterWindow in WIN32

5.00/5 (2 votes)
4 Oct 2011CPOL 8.5K  
There is ATL CWindow method CenterWindow:void CenterWnd(HWND hWnd){ CWindow wnd; wnd.Attach(hWnd); wnd.CenterWindow(NULL); wnd.Detach();}
There is ATL CWindow method CenterWindow:

C#
void CenterWnd(HWND hWnd)
{
    CWindow wnd;
    wnd.Attach(hWnd);
    wnd.CenterWindow(NULL);
    wnd.Detach();
}

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)