--- abi/src/af/xap/win/xap_Win32Frame.cpp.orig	Thu Oct  4 11:59:22 2001
+++ abi/src/af/xap/win/xap_Win32Frame.cpp	Wed Jan 16 15:06:39 2002
@@ -205,16 +205,27 @@
 	RECT r;
 	UT_uint32 iHeight, iWidth;
 
 	// create a top-level window for us.
 	// TODO get the default window size from preferences or something.
-	// Handled in Win32App for 1st frame opened.
+	// Win32App will set position & size for 1st frame opened only.
+
+	// get window width & height from preferences
+	UT_sint32 t_x,t_y;  // dummy variables
+	UT_uint32 t_flag;
+	if ( !(this->getApp()->getGeometry(&t_x,&t_y,&iWidth,&iHeight,&t_flag)) ||
+           !((iWidth > 0) && (iHeight > 0)) )
+	{
+		iWidth = CW_USEDEFAULT;
+		iHeight = CW_USEDEFAULT;
+	}
+
 
 	m_hwndFrame = CreateWindow(m_pWin32App->getApplicationName(),
 							   m_pWin32App->getApplicationTitleForTitleBar(),
 							   WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN,
-							   CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
+							   CW_USEDEFAULT, CW_USEDEFAULT, iWidth, iHeight,
 							   NULL, NULL, m_pWin32App->getInstance(), NULL);
 	UT_ASSERT(m_hwndFrame);
 
 	// bind this frame to its window
 	SetWindowLong(m_hwndFrame, GWL_USERDATA,(LONG)this);
