mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 08:47:52 -06:00
Win32 specific: Using SHChangeNotifyRegister to get notifications
on removable media insert / eject events. From now on we no more poll for removable media on Windows. Thanks @mjgtp from prusaprinters.org See the following discussion: https://forum.prusaprinters.org/forum/prusaslicer/prusaslicer-trying-to-access-my-floppy-disk-a The final working code sample was taken from Chromium source code, volume_mount_watcher_win.cc
This commit is contained in:
parent
3fdd643f49
commit
58192ba6c2
4 changed files with 73 additions and 11 deletions
|
@ -144,6 +144,8 @@ public:
|
|||
|
||||
#ifdef _WIN32
|
||||
void* m_hDeviceNotify { nullptr };
|
||||
uint32_t m_ulSHChangeNotifyRegister { 0 };
|
||||
static constexpr int WM_USER_MEDIACHANGED { 0x7FFF }; // WM_USER from 0x0400 to 0x7FFF, picking the last one to not interfere with wxWidgets allocation
|
||||
#endif // _WIN32
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue