Index: ddraw/glDirectDraw.cpp |
— | — | @@ -1425,9 +1425,23 @@ |
1426 | 1426 | if(hWnd && !IsWindow(hWnd)) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
|
1427 | 1427 | if ((dwFlags & DDSCL_EXCLUSIVE) && !hWnd) TRACE_RET(HRESULT, 23, DDERR_INVALIDPARAMS);
|
1428 | 1428 | if(dwFlags & 0xFFFFE020) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
|
| 1429 | + if (((hWnd != this->hWnd) && this->hWnd) || (this->hWnd && (dwFlags & DDSCL_NORMAL)))
|
| 1430 | + {
|
| 1431 | + if (winstyle)
|
| 1432 | + {
|
| 1433 | + SetWindowLongPtrA(hWnd, GWL_STYLE, winstyle);
|
| 1434 | + SetWindowLongPtrA(hWnd, GWL_EXSTYLE, winstyleex);
|
| 1435 | + //ShowWindow(hWnd, SW_RESTORE);
|
| 1436 | + winstyle = winstyleex = 0;
|
| 1437 | + SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
|
| 1438 | + }
|
| 1439 | + }
|
1429 | 1440 | this->hWnd = hWnd;
|
1430 | | - winstyle = GetWindowLongPtrA(hWnd,GWL_STYLE);
|
1431 | | - winstyleex = GetWindowLongPtrA(hWnd,GWL_EXSTYLE);
|
| 1441 | + if (!winstyle && !winstyleex)
|
| 1442 | + {
|
| 1443 | + winstyle = GetWindowLongPtrA(hWnd, GWL_STYLE);
|
| 1444 | + winstyleex = GetWindowLongPtrA(hWnd, GWL_EXSTYLE);
|
| 1445 | + }
|
1432 | 1446 | bool exclusive = false;
|
1433 | 1447 | devwnd = false;
|
1434 | 1448 | if(dwFlags & DDSCL_ALLOWMODEX)
|
Index: ddraw/glRenderer.cpp |
— | — | @@ -203,6 +203,7 @@ |
204 | 204 | */
|
205 | 205 | void glRenderer_Init(glRenderer *This, int width, int height, int bpp, bool fullscreen, unsigned int frequency, HWND hwnd, glDirectDraw7 *glDD7, BOOL devwnd)
|
206 | 206 | {
|
| 207 | + LONG_PTR winstyle, winstyleex;
|
207 | 208 | This->oldswap = 0;
|
208 | 209 | This->fogcolor = 0;
|
209 | 210 | This->fogstart = 0.0f;
|
— | — | @@ -219,8 +220,10 @@ |
220 | 221 | This->start = CreateEvent(NULL,FALSE,FALSE,NULL);
|
221 | 222 | if(fullscreen)
|
222 | 223 | {
|
223 | | - SetWindowLongPtrA(This->hWnd,GWL_EXSTYLE,WS_EX_APPWINDOW);
|
224 | | - SetWindowLongPtrA(This->hWnd,GWL_STYLE,WS_OVERLAPPED);
|
| 224 | + winstyle = GetWindowLongPtrA(This->hWnd, GWL_STYLE);
|
| 225 | + winstyleex = GetWindowLongPtrA(This->hWnd, GWL_EXSTYLE);
|
| 226 | + SetWindowLongPtrA(This->hWnd, GWL_EXSTYLE, winstyleex & ~(WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE));
|
| 227 | + SetWindowLongPtrA(This->hWnd, GWL_STYLE, (winstyle | WS_POPUP | WS_SYSMENU) & ~(WS_CAPTION | WS_THICKFRAME));
|
225 | 228 | ShowWindow(This->hWnd,SW_MAXIMIZE);
|
226 | 229 | }
|
227 | 230 | if(width)
|