Revision: 392
http://svn.sourceforge.net/cadcdev/?rev=392&view=rev
Author: c99koder
Date: 2007-01-28 14:41:27 -0800 (Sun, 28 Jan 2007)
Log Message:
-----------
Tiki: Win32: Center window on screen, and don't make window resizable
Modified Paths:
--------------
tiki/win32/src/platgl.cpp
Modified: tiki/win32/src/platgl.cpp
===================================================================
--- tiki/win32/src/platgl.cpp 2007-01-01 03:31:29 UTC (rev 391)
+++ tiki/win32/src/platgl.cpp 2007-01-28 22:41:27 UTC (rev 392)
@@ -89,10 +89,16 @@
if(!RegisterClassEx(&wc))
return FALSE;
- AdjustWindowRect(&WindowRect, WS_OVERLAPPEDWINDOW, FALSE);
+ AdjustWindowRect(&WindowRect, WS_POPUP|WS_CAPTION|WS_SYSMENU, FALSE);
- m_hWndMain = CreateWindow(szAppName, szAppName, WS_OVERLAPPEDWINDOW, 0, 0, WindowRect.right-WindowRect.left, WindowRect.bottom-WindowRect.top, NULL, NULL, m_hInstance, NULL);
+ //Center the window
+ WindowRect.left += (GetSystemMetrics(SM_CXSCREEN)/2 - m_targetW/2);
+ WindowRect.right += (GetSystemMetrics(SM_CXSCREEN)/2 - m_targetW/2);
+ WindowRect.top += (GetSystemMetrics(SM_CYSCREEN)/2 - m_targetH/2);
+ WindowRect.bottom += (GetSystemMetrics(SM_CYSCREEN)/2 - m_targetH/2);
+ m_hWndMain = CreateWindow(szAppName, szAppName, WS_POPUP|WS_CAPTION|WS_SYSMENU, WindowRect.left, WindowRect.top, WindowRect.right-WindowRect.left, WindowRect.bottom-WindowRect.top, NULL, NULL, m_hInstance, NULL);
+
if(!m_hWndMain)
return FALSE;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|