diff options
author | Takamichi Horikawa <takamichiho@gmail.com> | 2017-04-03 22:26:21 +0900 |
---|---|---|
committer | Takamichi Horikawa <takamichiho@gmail.com> | 2017-04-03 22:26:21 +0900 |
commit | 4a55b8d74132daa7b9c2b09c337532e5b0683cbf (patch) | |
tree | f32a8ce12b44ace66d9e889b6f210164e4489b37 /win32/oscilloview.c | |
parent | 813ed6d6c17d4b3c99e3d237872041f1a0047f97 (diff) |
win32: add about dialog
Diffstat (limited to 'win32/oscilloview.c')
-rw-r--r-- | win32/oscilloview.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/win32/oscilloview.c b/win32/oscilloview.c index 1478614..12851f4 100644 --- a/win32/oscilloview.c +++ b/win32/oscilloview.c @@ -24,12 +24,15 @@ static struct { struct oscillodata oscillodata[LIBOPNA_OSCILLO_TRACK_COUNT]; UINT mmtimer; HPEN whitepen; + void (*closecb)(void *ptr); + void *cbptr; } g; static void on_destroy(HWND hwnd) { g.oscilloview = 0; timeKillEvent(g.mmtimer); DeleteObject(g.whitepen); + if (g.closecb) g.closecb(g.cbptr); } static void CALLBACK mmtimer_cb(UINT timerid, UINT msg, @@ -111,7 +114,9 @@ static LRESULT CALLBACK wndproc( return DefWindowProc(hwnd, msg, wParam, lParam); } -void show_oscilloview(HINSTANCE hinst, HWND parent) { +void oscilloview_open(HINSTANCE hinst, HWND parent, void (*closecb)(void *ptr), void *cbptr) { + g.closecb = closecb; + g.cbptr = cbptr; g.hinst = hinst; g.parent = parent; if (!g.oscilloview) { @@ -140,3 +145,10 @@ void show_oscilloview(HINSTANCE hinst, HWND parent) { SetForegroundWindow(g.oscilloview); } } + +void oscilloview_close(void) { + if (g.oscilloview) { + g.closecb = 0; + DestroyWindow(g.oscilloview); + } +} |