soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
SNativeWndProxy.h
1#ifndef __SNATIVEWNDPROXY__H__
2#define __SNATIVEWNDPROXY__H__
3
4SNSBEGIN
5
6template <class T>
7class TNativeWndProxy
8 : public T
9 , public SNativeWnd {
10public:
11 STDMETHOD_(long, AddRef)(THIS)
12 {
13 return SNativeWnd::AddRef();
14 }
15 STDMETHOD_(long, Release)(THIS)
16 {
17 return SNativeWnd::Release();
18 }
19 STDMETHOD_(void, OnFinalRelease)(THIS)
20 {
22 }
23 STDMETHOD_(int, GetID)(THIS) SCONST
24 {
25 return SNativeWnd::GetID();
26 }
27 STDMETHOD_(void, SetID)(THIS_ int nID)
28 {
29 return SNativeWnd::SetID(nID);
30 }
31
32 STDMETHOD_(HWND, CreateNative)
33 (THIS_ LPCTSTR lpWindowName,
34 DWORD dwStyle,
35 DWORD dwExStyle,
36 int x,
37 int y,
38 int nWidth,
39 int nHeight,
40 HWND hWndParent,
41 int nID,
42 LPVOID lpParam) OVERRIDE
43 {
44 return SNativeWnd::CreateNative(lpWindowName, dwStyle, dwExStyle, x, y, nWidth, nHeight,
45 hWndParent,nID, lpParam);
46 }
47
48 STDMETHOD_(HWND, GetHwnd)(THIS) OVERRIDE
49 {
50 return SNativeWnd::GetHwnd();
51 }
52
53 STDMETHOD_(BOOL, SubclassWindow)(THIS_ HWND hWnd) OVERRIDE
54 {
55 return SNativeWnd::SubclassWindow(hWnd);
56 }
57 STDMETHOD_(HWND, UnsubclassWindow)(THIS_ BOOL bForce /*= FALSE*/) OVERRIDE
58 {
59 return SNativeWnd::UnsubclassWindow(bForce);
60 }
61 STDMETHOD_(const MSG *, GetCurrentMessage)(THIS) SCONST OVERRIDE
62 {
64 }
65 STDMETHOD_(int, GetDlgCtrlID)(THIS) SCONST OVERRIDE
66 {
68 }
69 STDMETHOD_(DWORD, GetStyle)(THIS) SCONST OVERRIDE
70 {
71 return SNativeWnd::GetStyle();
72 }
73 STDMETHOD_(DWORD, GetExStyle)(THIS) SCONST OVERRIDE
74 {
76 }
77 STDMETHOD_(LONG_PTR, GetWindowLongPtr)(THIS_ int nIndex) SCONST OVERRIDE
78 {
79 return SNativeWnd::GetWindowLongPtr(nIndex);
80 }
81 STDMETHOD_(LONG_PTR, SetWindowLongPtr)(THIS_ int nIndex, LONG_PTR dwNewLong) OVERRIDE
82 {
83 return SNativeWnd::SetWindowLongPtr(nIndex, dwNewLong);
84 }
85 STDMETHOD_(HWND, GetParent)(THIS) OVERRIDE
86 {
87 return SNativeWnd::GetParent();
88 }
89 STDMETHOD_(HWND, SetParent)(THIS_ HWND hWndNewParent) OVERRIDE
90 {
91 return SNativeWnd::SetParent(hWndNewParent);
92 }
93 STDMETHOD_(BOOL, IsWindowEnabled)(THIS) SCONST OVERRIDE
94 {
96 }
97 STDMETHOD_(BOOL, ModifyStyle)(THIS_ DWORD dwRemove, DWORD dwAdd, UINT nFlags = 0) OVERRIDE
98 {
99 return SNativeWnd::ModifyStyle(dwRemove, dwAdd, nFlags);
100 }
101 STDMETHOD_(BOOL, ModifyStyleEx)(THIS_ DWORD dwRemove, DWORD dwAdd, UINT nFlags = 0) OVERRIDE
102 {
103 return SNativeWnd::ModifyStyleEx(dwRemove, dwAdd, nFlags);
104 }
105 STDMETHOD_(BOOL, SetWindowPos)
106 (THIS_ HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT nFlags) OVERRIDE
107 {
108 return SNativeWnd::SetWindowPos(hWndInsertAfter, x, y, cx, cy, nFlags);
109 }
110 STDMETHOD_(BOOL, CenterWindow)(THIS_ HWND hWndCenter DEF_VAL(0)) OVERRIDE
111 {
112 return SNativeWnd::CenterWindow(hWndCenter);
113 }
114 STDMETHOD_(BOOL, IsWindow)(CTHIS) SCONST OVERRIDE
115 {
116 return SNativeWnd::IsWindow();
117 }
118 STDMETHOD_(BOOL, Invalidate)(THIS_ BOOL bErase = TRUE) OVERRIDE
119 {
120 return SNativeWnd::Invalidate(bErase);
121 }
122 STDMETHOD_(BOOL, InvalidateRect)(THIS_ LPCRECT lpRect, BOOL bErase = TRUE) OVERRIDE
123 {
124 return SNativeWnd::InvalidateRect(lpRect, bErase);
125 }
126 STDMETHOD_(BOOL, GetWindowRect)(THIS_ LPRECT lpRect) SCONST OVERRIDE
127 {
128 return SNativeWnd::GetWindowRect(lpRect);
129 }
130 STDMETHOD_(BOOL, GetClientRect)(THIS_ LPRECT lpRect) SCONST OVERRIDE
131 {
132 return SNativeWnd::GetClientRect(lpRect);
133 }
134 STDMETHOD_(BOOL, ClientToScreen)(THIS_ LPPOINT lpPoint) SCONST OVERRIDE
135 {
136 return SNativeWnd::ClientToScreen(lpPoint);
137 }
138 STDMETHOD_(BOOL, ClientToScreen2)(THIS_ LPRECT lpRect) SCONST OVERRIDE
139 {
140 return SNativeWnd::ClientToScreen2(lpRect);
141 }
142 STDMETHOD_(BOOL, ScreenToClient)(THIS_ LPPOINT lpPoint) SCONST OVERRIDE
143 {
144 return SNativeWnd::ScreenToClient(lpPoint);
145 }
146 STDMETHOD_(BOOL, ScreenToClient2)(THIS_ LPRECT lpRect) SCONST OVERRIDE
147 {
148 return SNativeWnd::ScreenToClient2(lpRect);
149 }
150 STDMETHOD_(int, MapWindowPoints)
151 (THIS_ HWND hWndTo, LPPOINT lpPoint, UINT nCount) SCONST OVERRIDE
152 {
153 return SNativeWnd::MapWindowPoints(hWndTo, lpPoint, nCount);
154 }
155 STDMETHOD_(int, MapWindowRect)(THIS_ HWND hWndTo, LPRECT lpRect) SCONST OVERRIDE
156 {
157 return SNativeWnd::MapWindowRect(hWndTo, lpRect);
158 }
159 STDMETHOD_(UINT_PTR, SetTimer)
160 (THIS_ UINT_PTR nIDEvent,
161 UINT nElapse,
162 void(CALLBACK *lpfnTimer)(HWND, UINT, UINT_PTR, DWORD) = NULL) OVERRIDE
163 {
164 return SNativeWnd::SetTimer(nIDEvent, nElapse, lpfnTimer);
165 }
166 STDMETHOD_(BOOL, KillTimer)(THIS_ UINT_PTR nIDEvent) OVERRIDE
167 {
168 return SNativeWnd::KillTimer(nIDEvent);
169 }
170 STDMETHOD_(HDC, GetDC)(THIS) OVERRIDE
171 {
172 return SNativeWnd::GetDC();
173 }
174 STDMETHOD_(HDC, GetWindowDC)(THIS) OVERRIDE
175 {
177 }
178 STDMETHOD_(int, ReleaseDC)(THIS_ HDC hDC) OVERRIDE
179 {
180 return SNativeWnd::ReleaseDC(hDC);
181 }
182 STDMETHOD_(BOOL, CreateCaret)(THIS_ HBITMAP hBitmap, int nWidth, int nHeight) OVERRIDE
183 {
184 return SNativeWnd::CreateCaret(hBitmap, nWidth, nHeight);
185 }
186 STDMETHOD_(BOOL, HideCaret)(THIS) OVERRIDE
187 {
188 return SNativeWnd::HideCaret();
189 }
190 STDMETHOD_(BOOL, ShowCaret)(THIS) OVERRIDE
191 {
192 return SNativeWnd::ShowCaret();
193 }
194 STDMETHOD_(HWND, SetCapture)(THIS) OVERRIDE
195 {
196 return SNativeWnd::SetCapture();
197 }
198
199 STDMETHOD_(HWND, GetCapture)(THIS) OVERRIDE
200 {
201 return SNativeWnd::GetCapture();
202 }
203
204 STDMETHOD_(BOOL, ReleaseCapture)(THIS) OVERRIDE
205 {
207 }
208
209 STDMETHOD_(HWND, SetFocus)(THIS) OVERRIDE
210 {
211 return SNativeWnd::SetFocus();
212 }
213 STDMETHOD_(LRESULT, SendMessage)
214 (THIS_ UINT message, WPARAM wParam = 0, LPARAM lParam = 0) OVERRIDE
215 {
216 return SNativeWnd::SendMessage(message, wParam, lParam);
217 }
218 STDMETHOD_(BOOL, PostMessage)(THIS_ UINT message, WPARAM wParam = 0, LPARAM lParam = 0) OVERRIDE
219 {
220 return SNativeWnd::PostMessage(message, wParam, lParam);
221 }
222 STDMETHOD_(BOOL, SendNotifyMessage)
223 (THIS_ UINT message, WPARAM wParam = 0, LPARAM lParam = 0) OVERRIDE
224 {
225 return SNativeWnd::SendNotifyMessage(message, wParam, lParam);
226 }
227 STDMETHOD_(BOOL, SetWindowText)(THIS_ LPCTSTR lpszString) OVERRIDE
228 {
229 return SNativeWnd::SetWindowText(lpszString);
230 }
231 STDMETHOD_(int, GetWindowText)(THIS_ LPTSTR lpszStringBuf, int nMaxCount) SCONST OVERRIDE
232 {
233 return SNativeWnd::GetWindowText(lpszStringBuf, nMaxCount);
234 }
235 STDMETHOD_(BOOL, IsIconic)(THIS) SCONST OVERRIDE
236 {
237 return SNativeWnd::IsIconic();
238 }
239 STDMETHOD_(BOOL, IsZoomed)(THIS) SCONST OVERRIDE
240 {
241 return SNativeWnd::IsZoomed();
242 }
243 STDMETHOD_(BOOL, IsWindowVisible)(THIS) SCONST OVERRIDE
244 {
246 }
247 STDMETHOD_(BOOL, MoveWindow)
248 (THIS_ int x, int y, int nWidth, int nHeight, BOOL bRepaint = TRUE) OVERRIDE
249 {
250 return SNativeWnd::MoveWindow(x, y, nWidth, nHeight, bRepaint);
251 }
252 STDMETHOD_(BOOL, MoveWindow2)(THIS_ LPCRECT lpRect, BOOL bRepaint = TRUE) OVERRIDE
253 {
254 return SNativeWnd::MoveWindow2(lpRect, bRepaint);
255 }
256 STDMETHOD_(BOOL, ShowWindow)(THIS_ int nCmdShow) OVERRIDE
257 {
258 return SNativeWnd::ShowWindow(nCmdShow);
259 }
260 STDMETHOD_(int, SetWindowRgn)(THIS_ HRGN hRgn, BOOL bRedraw = TRUE) OVERRIDE
261 {
262 return SNativeWnd::SetWindowRgn(hRgn, bRedraw);
263 }
264 STDMETHOD_(BOOL, SetLayeredWindowAttributes)
265 (THIS_ COLORREF crKey, BYTE byAlpha, DWORD dwFlags) OVERRIDE
266 {
267 return SNativeWnd::SetLayeredWindowAttributes(crKey, byAlpha, dwFlags);
268 }
269 STDMETHOD_(BOOL, UpdateLayeredWindow)
270 (THIS_ HDC hdcDst,
271 POINT *pptDst,
272 SIZE *psize,
273 HDC hdcSrc,
274 POINT *pptSrc,
275 COLORREF crKey,
276 BLENDFUNCTION *pblend,
277 DWORD dwFlags)
278 {
279 return SNativeWnd::UpdateLayeredWindow(hdcDst, pptDst, psize, hdcSrc, pptSrc, crKey, pblend,
280 dwFlags);
281 }
282
283 STDMETHOD_(void, SetMsgHandler)(THIS_ FunMsgHandler fun, void *ctx) OVERRIDE
284 {
285 return SNativeWnd::SetMsgHandler(fun, ctx);
286 }
287
288 STDMETHOD_(MsgHandlerInfo *, GetMsgHandler)(THIS) OVERRIDE{
290 }
291
292};
293
294SNSEND
295#endif // __SNATIVEWNDPROXY__H__
Class for managing native window operations.
Definition SNativeWnd.h:126
BOOL IsIconic() SCONST OVERRIDE
Checks if the window is iconic (minimized).
BOOL IsZoomed() SCONST OVERRIDE
Checks if the window is zoomed (maximized).
BOOL ClientToScreen2(LPRECT lpRect) SCONST OVERRIDE
Converts client rectangle coordinates to screen coordinates.
BOOL ScreenToClient(LPPOINT lpPoint) SCONST OVERRIDE
Converts screen coordinates to client coordinates.
int SetWindowRgn(HRGN hRgn, BOOL bRedraw=TRUE) OVERRIDE
Sets the window region.
int MapWindowRect(HWND hWndTo, LPRECT lpRect) SCONST OVERRIDE
Maps a rectangle from one window to another.
HDC GetDC() OVERRIDE
Retrieves a device context for the window.
HWND SetCapture() OVERRIDE
Sets the window to capture the mouse.
BOOL GetWindowRect(LPRECT lpRect) SCONST OVERRIDE
Retrieves the window rectangle.
HWND GetCapture() OVERRIDE
Retrieves the handle to the window that has captured the mouse.
BOOL ReleaseCapture() OVERRIDE
Releases the mouse capture.
int MapWindowPoints(HWND hWndTo, LPPOINT lpPoint, UINT nCount) SCONST OVERRIDE
Maps points from one window to another.
BOOL SetLayeredWindowAttributes(COLORREF crKey, BYTE bAlpha, DWORD dwFlags) OVERRIDE
Sets the layered window attributes.
BOOL IsWindowVisible() SCONST OVERRIDE
Checks if the window is visible.
BOOL Invalidate(BOOL bErase=TRUE) OVERRIDE
Invalidates the entire window.
BOOL IsWindow() SCONST OVERRIDE
Checks if the handle is a valid window handle.
BOOL IsWindowEnabled() SCONST OVERRIDE
Checks if the window is enabled.
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0) OVERRIDE
Sends a message to the window.
const MSG * GetCurrentMessage() SCONST OVERRIDE
Retrieves the current message being processed.
void SetMsgHandler(FunMsgHandler fun, void *ctx) OVERRIDE
Sets the message handler for the window.
BOOL MoveWindow(int x, int y, int nWidth, int nHeight, BOOL bRepaint=TRUE) OVERRIDE
Moves the window to the specified position and resizes it.
BOOL SendNotifyMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0) OVERRIDE
Sends a notify message to the window.
UINT_PTR SetTimer(UINT_PTR nIDEvent, UINT nElapse, void(CALLBACK *lpfnTimer)(HWND, UINT, UINT_PTR, DWORD)=NULL) OVERRIDE
Sets a timer for the window.
HWND UnsubclassWindow(BOOL bForce=FALSE) OVERRIDE
Unsubclasses a window.
BOOL ShowCaret() OVERRIDE
Shows the caret.
BOOL SubclassWindow(HWND hWnd) OVERRIDE
Subclasses an existing window.
BOOL PostMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0) OVERRIDE
Posts a message to the window.
DWORD GetStyle() SCONST OVERRIDE
Retrieves the window style.
int GetID() SCONST
Retrieves the window ID.
Definition SNativeWnd.h:155
HWND GetParent() OVERRIDE
Retrieves the handle to the parent window.
HWND SetFocus() OVERRIDE
Sets the input focus to the window.
DWORD GetExStyle() SCONST OVERRIDE
Retrieves the extended window style.
HWND SetParent(HWND hWndNewParent) OVERRIDE
Sets the handle to the parent window.
BOOL SetWindowText(LPCTSTR lpszString) OVERRIDE
Sets the window text.
BOOL ClientToScreen(LPPOINT lpPoint) SCONST OVERRIDE
Converts client coordinates to screen coordinates.
BOOL ShowWindow(int nCmdShow) OVERRIDE
Sets the show state of the window.
BOOL KillTimer(UINT_PTR nIDEvent) OVERRIDE
Kills a timer for the window.
void SetID(int nID)
Sets the window ID.
Definition SNativeWnd.h:165
int GetWindowText(LPTSTR lpszStringBuf, int nMaxCount) SCONST OVERRIDE
Retrieves the window text.
BOOL CreateCaret(HBITMAP hBitmap, int nWidth, int nHeight) OVERRIDE
Creates a caret for the window.
LONG_PTR SetWindowLongPtr(int nIndex, LONG_PTR dwNewLong) OVERRIDE
Sets the long pointer value at the specified index.
BOOL CenterWindow(HWND hWndCenter=0) OVERRIDE
Centers the window relative to another window.
BOOL GetClientRect(LPRECT lpRect) SCONST OVERRIDE
Retrieves the client rectangle.
BOOL ModifyStyle(DWORD dwRemove, DWORD dwAdd, UINT nFlags=0) OVERRIDE
Modifies the window style.
HDC GetWindowDC() OVERRIDE
Retrieves a device context for the entire window.
HWND CreateNative(LPCTSTR lpWindowName, DWORD dwStyle, DWORD dwExStyle, int x, int y, int nWidth, int nHeight, HWND hWndParent, int nID=0, LPVOID lpParam=0) OVERRIDE
Creates a native window.
BOOL ModifyStyleEx(DWORD dwRemove, DWORD dwAdd, UINT nFlags=0) OVERRIDE
Modifies the extended window style.
BOOL SetWindowPos(HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT nFlags) OVERRIDE
Sets the window position.
HWND GetHwnd() OVERRIDE
Retrieves the handle to the window.
int ReleaseDC(HDC hDC) OVERRIDE
Releases a device context.
BOOL HideCaret() OVERRIDE
Hides the caret.
BOOL ScreenToClient2(LPRECT lpRect) SCONST OVERRIDE
Converts screen rectangle coordinates to client coordinates.
int GetDlgCtrlID() SCONST OVERRIDE
Retrieves the dialog control ID.
MsgHandlerInfo * GetMsgHandler() OVERRIDE
Retrieves the message handler for the window.
LONG_PTR GetWindowLongPtr(int nIndex) SCONST OVERRIDE
Retrieves the long pointer value at the specified index.
BOOL UpdateLayeredWindow(HDC hdcDst, POINT *pptDst, SIZE *psize, HDC hdcSrc, POINT *pptSrc, COLORREF crKey, BLENDFUNCTION *pblend, DWORD dwFlags) OVERRIDE
Updates the layered window.
BOOL InvalidateRect(LPCRECT lpRect, BOOL bErase=TRUE) OVERRIDE
Invalidates a specified rectangle of the window.
BOOL MoveWindow2(LPCRECT lpRect, BOOL bRepaint=TRUE) OVERRIDE
Moves the window to the specified position and resizes it using a rectangle.
long Release() PURE
Release reference.
void OnFinalRelease() PURE
Final release of the object.
long AddRef() PURE
Add reference.