add GFX2_Get_Window_Handle() to get the win32 HWND

and use it
This commit is contained in:
Thomas Bernard
2018-06-25 10:23:19 +02:00
parent b6dec6d3f7
commit cb2d479867
7 changed files with 44 additions and 76 deletions

View File

@@ -25,10 +25,6 @@
along with Grafx2; if not, see <http://www.gnu.org/licenses/>
*/
#if defined(USE_SDL) || defined(USE_SDL2)
#include <SDL_syswm.h>
#endif
#if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__)
#include <proto/dos.h>
#include <sys/types.h>
@@ -95,21 +91,11 @@ byte Native_filesel(byte load)
#if WIN32
OPENFILENAME ofn;
char szFileName[MAX_PATH] = "";
HWND hwnd;
#if defined(USE_SDL) || defined(USE_SDL2)
SDL_SysWMinfo wminfo;
SDL_VERSION(&wminfo.version);
SDL_GetWMInfo(&wminfo);
hwnd = wminfo.window;
#else
hwnd = GetActiveWindow();
#endif
ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = hwnd;
ofn.hwndOwner = GFX2_Get_Window_Handle();
ofn.lpstrFilter = TEXT("Text Files (*.txt)\0*.txt\0All Files (*.*)\0*.*\0");
#ifdef UNICODE
#else