diff options
| author | Pietro Gagliardi <[email protected]> | 2015-04-07 00:56:06 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2015-04-07 00:56:06 -0400 |
| commit | ab936d304f593ab14853216ce3e77bba1e71d4f4 (patch) | |
| tree | 74624b76167a3e6dc8f1a06c34fcb94ecd72d185 /new/ui_windows.h | |
| parent | 1d76d53593de0c6bd4faf8c47bb525977a33b178 (diff) | |
Added a public API for creating raw Windows controls. Removed include guards from uipriv_*.h.
Diffstat (limited to 'new/ui_windows.h')
| -rw-r--r-- | new/ui_windows.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/new/ui_windows.h b/new/ui_windows.h new file mode 100644 index 0000000..eb68475 --- /dev/null +++ b/new/ui_windows.h @@ -0,0 +1,29 @@ +// 7 april 2015 + +/* +This file assumes that you have included <windows.h> and "ui.h" beforehand. It provides API-specific functions for interfacing with foreign controls in Windows. +*/ + +#ifndef __UI_UI_WINDOWS_H__ +#define __UI_UI_WINDOWS_H__ + +// uiWindowsNewControl() creates a new uiControl with the given Windows API control inside. +typedef struct uiWindowsNewControlParams uiWindowsNewControlParams; +struct uiWindowsNewControlParams { + // These match the CreateWindowExW() function. + DWORD dwExStyle; + LPCWSTR lpClassName; +//TODO? LPCWSTR lpWindowName; + DWORD dwStyle; // WS_CHILD and WS_VISIBLE are automatically applied. + HINSTANCE hInstance; + + // These are called when the control sends a WM_COMMAND or WM_NOTIFY (respectively) to its parent. + // ui redirects the message back and calls these functions. + // Store the result in the LRESULT pointer and return TRUE to return the given result; return FALSE to pass the notification up to your window procedure. + // Note that these are only issued if they come from the uiControl itself; notifications from children of the uiControl (such as a header control) will be received normally. + BOOL (*onWM_COMMAND)(uiControl *, WPARAM, LPARAM, LRESULT *); + BOOL (*onWM_NOTIFY)(uiControl *, WPARAM, LPARAM, LRESULT *); +}; +uiControl *uiWindowsNewControl(uiWindowsNewControlParams *); + +#endif |
