1 /** DGui project file.
2 
3 Copyright: Trogu Antonio Davide 2011-2013
4 
5 License: $(HTTP boost.org/LICENSE_1_0.txt, Boost License 1.0).
6 
7 Authors: Trogu Antonio Davide
8 */
9 module dguihub.core.message;
10 
11 import dguihub.core.winapi;
12 
13 /* DGui Custom Messages in order to overcome WinAPI's limitation */
14 enum {
15    DGUI_BASE = WM_APP + 1, // DGui's internal message start
16    DGUI_ADDCHILDCONTROL = DGUI_BASE, // void DGUI_ADDCHILDCONTROL(Control childControl, NULL)
17    DGUI_DOLAYOUT = DGUI_BASE + 1, // void DGUI_DOLAYOUT(NULL, NULL)
18    DGUI_SETDIALOGRESULT = DGUI_BASE + 2, // void DGUI_SETDIALOGRESULT(DialogResult result, NULL)
19    DGUI_REFLECTMESSAGE = DGUI_BASE + 3, // void DGUI_REFLECTMESSAGE(Message m, NULL)
20    DGUI_CHILDCONTROLCREATED = DGUI_BASE + 4, // void DGUI_CHILDCONTROLCREATED(Control childControl, NULL)
21    DGUI_CREATEONLY = DGUI_BASE + 5, // void DGUI_CREATEONLY(NULL, NULL)
22 }
23 
24 struct Message {
25    HWND hWnd;
26    uint msg;
27    WPARAM wParam;
28    LPARAM lParam;
29    LRESULT result;
30 
31    public static Message opCall(HWND h, uint msg, WPARAM wp, LPARAM lp) {
32       Message m;
33 
34       m.hWnd = h;
35       m.msg = msg;
36       m.wParam = wp;
37       m.lParam = lp;
38 
39       return m;
40    }
41 }