diff --git a/gfx/common/win32_common.cpp b/gfx/common/win32_common.cpp index 8376943d88..2383bf3d22 100644 --- a/gfx/common/win32_common.cpp +++ b/gfx/common/win32_common.cpp @@ -30,10 +30,13 @@ #include "../video_thread_wrapper.h" #include "../drivers_wm/win32_shader_dlg.h" -#ifdef __cplusplus -extern "C" -#endif -bool dinput_handle_message(void *dinput, UINT message, WPARAM wParam, LPARAM lParam); +extern "C" bool dinput_handle_message(void *dinput, UINT message, WPARAM wParam, LPARAM lParam); +extern "C" bool win32_browser( + HWND owner, + char *filename, + const char *extensions, + const char *title, + const char *initial_dir); unsigned g_resize_width; unsigned g_resize_height; @@ -280,33 +283,6 @@ bool win32_window_create(void *data, unsigned style, return true; } -static bool win32_browser( - HWND owner, - char *filename, - const char *extensions, - const char *title, - const char *initial_dir) -{ - OPENFILENAME ofn; - - memset((void*)&ofn, 0, sizeof(OPENFILENAME)); - - ofn.lStructSize = sizeof(OPENFILENAME); - ofn.hwndOwner = owner; - ofn.lpstrFilter = extensions; - ofn.lpstrFile = filename; - ofn.lpstrTitle = title; - ofn.lpstrInitialDir = TEXT(initial_dir); - ofn.lpstrDefExt = ""; - ofn.nMaxFile = PATH_MAX; - ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY; - - if (!GetOpenFileName(&ofn)) - return false; - - return true; -} - LRESULT win32_menu_loop(HWND owner, WPARAM wparam) { WPARAM mode = wparam & 0xffff; diff --git a/ui/drivers/ui_win32.c b/ui/drivers/ui_win32.c index 6fe878690e..675a1b1121 100644 --- a/ui/drivers/ui_win32.c +++ b/ui/drivers/ui_win32.c @@ -19,14 +19,54 @@ #include #include +#if !defined(_XBOX) + +#define IDI_ICON 1 + +#ifndef _WIN32_WINNT +#define _WIN32_WINNT 0x0500 //_WIN32_WINNT_WIN2K +#endif + +#include +#include +#endif + #include #include "../ui_companion_driver.h" + typedef struct ui_companion_win32 { void *empty; } ui_companion_win32_t; +bool win32_browser( + HWND owner, + char *filename, + const char *extensions, + const char *title, + const char *initial_dir) +{ + OPENFILENAME ofn; + + memset((void*)&ofn, 0, sizeof(OPENFILENAME)); + + ofn.lStructSize = sizeof(OPENFILENAME); + ofn.hwndOwner = owner; + ofn.lpstrFilter = extensions; + ofn.lpstrFile = filename; + ofn.lpstrTitle = title; + ofn.lpstrInitialDir = TEXT(initial_dir); + ofn.lpstrDefExt = ""; + ofn.nMaxFile = PATH_MAX; + ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY; + + if (!GetOpenFileName(&ofn)) + return false; + + return true; +} + static void ui_companion_win32_deinit(void *data) { ui_companion_win32_t *handle = (ui_companion_win32_t*)data;