add missing ifdef for device change fix and include 2K in the version check

This commit is contained in:
Brad Parker 2017-12-30 23:07:20 -05:00
parent d09e0f7da2
commit 8a8687ec9c
2 changed files with 7 additions and 5 deletions

View File

@ -447,7 +447,7 @@ static LRESULT win32_handle_keyboard_event(HWND hwnd, UINT message,
if (message == WM_KEYUP || message == WM_SYSKEYUP)
keydown = false;
#if _WIN32_WINNT >= 0x0501
#if _WIN32_WINNT >= 0x0501 /* XP */
if (string_is_equal_fast(config_get_ptr()->arrays.input_driver, "raw", 4))
keycode = input_keymaps_translate_keysym_to_rk((unsigned)(wparam));
else
@ -751,7 +751,7 @@ bool win32_window_create(void *data, unsigned style,
RECT *mon_rect, unsigned width,
unsigned height, bool fullscreen)
{
#if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x501
#if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0500 /* 2K */
DEV_BROADCAST_DEVICEINTERFACE notification_filter;
#endif
settings_t *settings = config_get_ptr();
@ -766,7 +766,7 @@ bool win32_window_create(void *data, unsigned style,
if (!main_window.hwnd)
return false;
#if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x501
#if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0500 /* 2K */
ZeroMemory(&notification_filter, sizeof(notification_filter) );
notification_filter.dbcc_size = sizeof(DEV_BROADCAST_DEVICEINTERFACE);
notification_filter.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE;
@ -782,7 +782,7 @@ bool win32_window_create(void *data, unsigned style,
video_driver_display_set(0);
video_driver_window_set((uintptr_t)main_window.hwnd);
#if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0500
#if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0500 /* 2K */
/* Windows 2000 and above use layered windows to enable transparency */
SetWindowLongPtr(main_window.hwnd,
GWL_EXSTYLE,
@ -1164,7 +1164,7 @@ void win32_destroy_window(void)
#ifndef _XBOX
UnregisterClass("RetroArch", GetModuleHandle(NULL));
#endif
#if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x501
#if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x500 /* 2K */
UnregisterDeviceNotification(notification_handler);
#endif
main_window.hwnd = NULL;

View File

@ -803,6 +803,7 @@ bool dinput_handle_message(void *dinput, UINT message, WPARAM wParam, LPARAM lPa
return true;
}
case WM_DEVICECHANGE:
#if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0500 /* 2K */
if (wParam == DBT_DEVICEARRIVAL || wParam == DBT_DEVICEREMOVECOMPLETE)
{
PDEV_BROADCAST_HDR pHdr = (PDEV_BROADCAST_HDR)lParam;
@ -816,6 +817,7 @@ bool dinput_handle_message(void *dinput, UINT message, WPARAM wParam, LPARAM lPa
di->joypad = input_joypad_init_driver(di->joypad_driver_name, di);
}
}
#endif
break;
case WM_MOUSEWHEEL:
if (((short) HIWORD(wParam))/120 > 0)