This might help....
//Rect is filled with bitmaps dimension,
//use GetObject() if the bitmaps width and height are not known
//get the styles from the window
//send in the required client area and styles
AdjustWindowRectEx(&Rect, lStyle, bHasMenu, lExStyle);
//returned is the required window size so set the window to this size and bring to the front
SetWindowPos(hWnd, HWND_TOP, 0,0,Rect.right- Rect.left, Rect.bottom- Rect.top, SWP_NOMOVE);