Diff

Not logged in

Differences From Artifact [36c6085700197d43]:

To Artifact [5518278e91d2e2fc]:


1 1 private import win32.windows; 2 2 private import win32.commctrl; 3 3 private import std.string; 4 -private import qbga32; 5 4 6 5 void process_messages() 7 6 { 8 7 for( MSG msg; PeekMessageA( &msg, null, 0, 0, PM_REMOVE ); ) 9 8 { 10 9 TranslateMessage( &msg ); 11 10 DispatchMessageA( &msg ); 12 11 } 13 12 } 14 13 15 -// 実装継承(w 16 - 17 14 class Dialog 18 15 { 19 16 public: 20 17 HWND hwnd() 21 18 { 22 19 return handle; 23 20 } 24 21 25 22 protected: 26 - void on_init() { MessageBoxA(null,"xxx",null,MB_OK); } 23 + void on_init() {} 27 24 bool on_ok() { return false; } 28 25 bool on_cancel() { return false; } 29 26 bool on_command( UINT cmd ) { return false; } 30 27 bool on_message( UINT msg, WPARAM wp, LPARAM lp ) { return false; } 31 28 32 29 extern(Windows) private static BOOL 33 30 static_dlg_proc( HWND dlg, UINT msg, WPARAM wp, LPARAM lp ) ................................................................................ 57 54 } 58 55 59 56 protected: 60 57 HWND handle; 61 58 void BeginModeless( DLGTEMPLATE* dlg_template, HWND parent ) 62 59 { 63 60 CreateDialogIndirectParam( 64 - g_hinst, 61 + GetModuleHandle(null), 65 62 dlg_template, 66 63 parent, 67 64 &static_dlg_proc, 68 65 cast(LPARAM) cast(Dialog*) this 69 66 ); 70 67 } 71 68 72 69 int BeginModal( DLGTEMPLATE* dlg_template, HWND parent ) 73 70 { 74 71 return DialogBoxIndirectParam( 75 - g_hinst, 72 + GetModuleHandle(null), 76 73 dlg_template, 77 74 parent, 78 75 &static_dlg_proc, 79 76 cast(LPARAM) cast(Dialog*) this 80 77 ); 81 78 } 82 79