diff --git a/win32/wsnes9x.cpp b/win32/wsnes9x.cpp index 5efc94f4..8a303486 100644 --- a/win32/wsnes9x.cpp +++ b/win32/wsnes9x.cpp @@ -2712,7 +2712,7 @@ LRESULT CALLBACK WinProc( break; #endif case WM_DEVICECHANGE: - if(wParam == DBT_DEVICEARRIVAL || wParam == DBT_DEVICEREMOVECOMPLETE || wParam == DBT_DEVNODES_CHANGED) + if(wParam == DBT_DEVICEARRIVAL || wParam == DBT_DEVICEREMOVECOMPLETE) PostMessage(hWnd, WM_SCANJOYPADS, 0, 0); break; case WM_SCANJOYPADS: @@ -3412,6 +3412,12 @@ int WINAPI WinMain( SetMenu (GUI.hWnd, NULL); } + DEV_BROADCAST_DEVICEINTERFACE notificationFilter; + ZeroMemory(¬ificationFilter, sizeof(notificationFilter)); + notificationFilter.dbcc_size = sizeof(DEV_BROADCAST_DEVICEINTERFACE); + notificationFilter.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE; + RegisterDeviceNotification(GUI.hWnd, ¬ificationFilter, DEVICE_NOTIFY_ALL_INTERFACE_CLASSES); + InitRenderFilters(); GUI.ControlForced = 0xff;