src/video/win32_v.cpp
changeset 9939 ba050f82ad30
parent 9917 1816159a6b8e
child 10084 a544278a1b43
equal deleted inserted replaced
9938:69311c7f3af3 9939:ba050f82ad30
    16 #include "../texteff.hpp"
    16 #include "../texteff.hpp"
    17 #include "win32_v.h"
    17 #include "win32_v.h"
    18 #include <windows.h>
    18 #include <windows.h>
    19 #include <tchar.h>
    19 #include <tchar.h>
    20 
    20 
    21 /** Only MSVC has this header, MinGW supplies the required constants itself */
       
    22 #ifdef _MSC_VER
       
    23 # define COMPILE_MULTIMON_STUBS
       
    24 # include <multimon.h>
       
    25 #endif /* _MSC_VER */
       
    26 
       
    27 static struct {
    21 static struct {
    28 	HWND main_wnd;
    22 	HWND main_wnd;
    29 	HBITMAP dib_sect;
    23 	HBITMAP dib_sect;
    30 	void *buffer_bits;
    24 	void *buffer_bits;
    31 	HPALETTE gdi_palette;
    25 	HPALETTE gdi_palette;
   284 #if !defined(WINCE)
   278 #if !defined(WINCE)
   285 		AdjustWindowRect(&r, style, FALSE);
   279 		AdjustWindowRect(&r, style, FALSE);
   286 #endif
   280 #endif
   287 		w = r.right - r.left;
   281 		w = r.right - r.left;
   288 		h = r.bottom - r.top;
   282 		h = r.bottom - r.top;
   289 		x = ((GetSystemMetrics(SM_CXVIRTUALSCREEN) - w) / 2) - GetSystemMetrics(SM_XVIRTUALSCREEN);
   283 		x = (GetSystemMetrics(SM_CXSCREEN) - w) / 2;
   290 		y = ((GetSystemMetrics(SM_CYVIRTUALSCREEN) - h) / 2) - GetSystemMetrics(SM_YVIRTUALSCREEN);
   284 		y = (GetSystemMetrics(SM_CYSCREEN) - h) / 2;
   291 
   285 
   292 		if (_wnd.main_wnd) {
   286 		if (_wnd.main_wnd) {
   293 			ShowWindow(_wnd.main_wnd, SW_SHOWNORMAL); // remove maximize-flag
   287 			ShowWindow(_wnd.main_wnd, SW_SHOWNORMAL); // remove maximize-flag
   294 			SetWindowPos(_wnd.main_wnd, 0, x, y, w, h, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER);
   288 			SetWindowPos(_wnd.main_wnd, 0, x, y, w, h, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER);
   295 		} else {
   289 		} else {