-
Notifications
You must be signed in to change notification settings - Fork 12
/
resync_windows.h
43 lines (31 loc) · 1.07 KB
/
resync_windows.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**************************************************************
resync_windows.h - Windows device change notifying helper
---------------------------------------------------------
Switchres Modeline generation engine for emulation
License GPL-2.0+
Copyright 2010-2021 Chris Kennedy, Antonio Giner,
Alexandre Wodarczyk, Gil Delescluse
**************************************************************/
#ifndef __RESYNC_WINDOWS__
#define __RESYNC_WINDOWS__
#include <chrono>
#include <windows.h>
#include <dbt.h>
class resync_handler
{
public:
resync_handler();
~resync_handler();
void wait();
private:
static LRESULT CALLBACK resync_wnd_proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
LRESULT CALLBACK my_wnd_proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
static DWORD WINAPI handler_thread(LPVOID lpParameter);
DWORD handler_thread_wt();
HWND m_hwnd;
DWORD my_thread;
bool m_is_notified_1;
bool m_is_notified_2;
HANDLE m_event;
};
#endif