Win32: another attempt on hotplugging crashes
This commit is contained in:
parent
951a383ae2
commit
56a4ce5ef8
@ -291,6 +291,7 @@ void S9xDetectJoypads();
|
||||
|
||||
#define WM_CUSTKEYDOWN (WM_USER+50)
|
||||
#define WM_CUSTKEYUP (WM_USER+51)
|
||||
#define WM_SCANJOYPADS (WM_APP+10)
|
||||
|
||||
#ifdef UNICODE
|
||||
#define S9XW_SHARD_PATH SHARD_PATHW
|
||||
@ -2673,7 +2674,10 @@ LRESULT CALLBACK WinProc(
|
||||
#endif
|
||||
case WM_DEVICECHANGE:
|
||||
if(wParam == DBT_DEVICEARRIVAL || wParam == DBT_DEVICEREMOVECOMPLETE || wParam == DBT_DEVNODES_CHANGED)
|
||||
S9xDetectJoypads();
|
||||
PostMessage(hWnd, WM_SCANJOYPADS, 0, 0);
|
||||
break;
|
||||
case WM_SCANJOYPADS:
|
||||
S9xDetectJoypads();
|
||||
break;
|
||||
}
|
||||
return DefWindowProc (hWnd, uMsg, wParam, lParam);
|
||||
|
Loading…
Reference in New Issue
Block a user