Skip to content

Commit

Permalink
Win32: register for all device changes, ignore problematic message
Browse files Browse the repository at this point in the history
  • Loading branch information
OV2 committed Oct 20, 2016
1 parent 1661fc8 commit 09df5e1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion win32/wsnes9x.cpp
Expand Up @@ -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:
Expand Down Expand Up @@ -3412,6 +3412,12 @@ int WINAPI WinMain(
SetMenu (GUI.hWnd, NULL);
}

DEV_BROADCAST_DEVICEINTERFACE notificationFilter;
ZeroMemory(&notificationFilter, sizeof(notificationFilter));
notificationFilter.dbcc_size = sizeof(DEV_BROADCAST_DEVICEINTERFACE);
notificationFilter.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE;
RegisterDeviceNotification(GUI.hWnd, &notificationFilter, DEVICE_NOTIFY_ALL_INTERFACE_CLASSES);

InitRenderFilters();

GUI.ControlForced = 0xff;
Expand Down

0 comments on commit 09df5e1

Please sign in to comment.