source: trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/Dialog.ab@ 576

Last change on this file since 576 was 576, checked in by イグトランス (egtra), 16 years ago

ListBox, Dialogの追加。UI_Sample/mouse_watcherの追加。

File size: 1.2 KB
Line 
1#include "Form.ab"
2
3Namespace ActiveBasic
4Namespace Windows
5Namespace UI
6
7Class Dialog
8 Inherits Form
9Public
10
11 Override Function DefWndProc(m As DWord, w As WPARAM, l As LPARAM) As LRESULT
12 DefWndProc = FALSE
13 End Function
14
15 Function DoModal(hwndParent As HWND) As Long
16 Dim temp[31] As Byte
17 SetWord(temp + 0, 1) '拡張テンプレート
18 SetWord(temp + 2, &hffff)
19 SetDWord(temp + 12, DS_MODALFRAME Or WS_SYSMENU)
20 StartWndProc()
21 DoModal = DialogBoxIndirectParam(Control.hInstance, temp As *DLGTEMPLATE, hwndParent, AddressOf(DefDlgProc), 0)
22 End Function
23
24Private
25 Static Function DefDlgProc(hDlg As HWND, msg As DWord, wp As WPARAM, lp As LPARAM) As LONG_PTR
26 Dim lr = Control.WndProcFirst(hDlg, msg, wp, lp)
27 If lr <> 0 Then
28 Select Case msg
29 Case WM_CHARTOITEM, _
30 WM_COMPAREITEM, _
31 WM_CTLCOLORBTN, _
32 WM_CTLCOLORDLG, _
33 WM_CTLCOLOREDIT, _
34 WM_CTLCOLORLISTBOX, _
35 WM_CTLCOLORSCROLLBAR, _
36 WM_CTLCOLORSTATIC, _
37 WM_INITDIALOG, _
38 WM_QUERYDRAGICON, _
39 WM_VKEYTOITEM
40
41 DefDlgProc = lr
42 Case Else
43 _System_SetWindowLongPtr(hDlg, DWLP_MSGRESULT, lr)
44 End Select
45 End If
46 End Function
47
48End Class
49
50End Namespace
51End Namespace
52End Namespace
Note: See TracBrowser for help on using the repository browser.