mirror of https://github.com/snes9xgit/snes9x.git
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_CUSTKEYDOWN (WM_USER+50)
|
||||||
#define WM_CUSTKEYUP (WM_USER+51)
|
#define WM_CUSTKEYUP (WM_USER+51)
|
||||||
|
#define WM_SCANJOYPADS (WM_APP+10)
|
||||||
|
|
||||||
#ifdef UNICODE
|
#ifdef UNICODE
|
||||||
#define S9XW_SHARD_PATH SHARD_PATHW
|
#define S9XW_SHARD_PATH SHARD_PATHW
|
||||||
|
@ -2673,7 +2674,10 @@ LRESULT CALLBACK WinProc(
|
||||||
#endif
|
#endif
|
||||||
case WM_DEVICECHANGE:
|
case WM_DEVICECHANGE:
|
||||||
if(wParam == DBT_DEVICEARRIVAL || wParam == DBT_DEVICEREMOVECOMPLETE || wParam == DBT_DEVNODES_CHANGED)
|
if(wParam == DBT_DEVICEARRIVAL || wParam == DBT_DEVICEREMOVECOMPLETE || wParam == DBT_DEVNODES_CHANGED)
|
||||||
S9xDetectJoypads();
|
PostMessage(hWnd, WM_SCANJOYPADS, 0, 0);
|
||||||
|
break;
|
||||||
|
case WM_SCANJOYPADS:
|
||||||
|
S9xDetectJoypads();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return DefWindowProc (hWnd, uMsg, wParam, lParam);
|
return DefWindowProc (hWnd, uMsg, wParam, lParam);
|
||||||
|
|
Loading…
Reference in New Issue