OWLNext    7.0
Borland's Object Windows Library for the modern age
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
dispatch.h
Go to the documentation of this file.
1//
2/// \file
3/// Dispatch functions (crackers) to crack a Windows message and pass control
4/// to a member function via a pointer (Handler).
5//
6// Part of OWLNext - the next generation Object Windows Library
7// Copyright (c) 1995, 1996 by Borland International, All Rights Reserved
8// Copyright (c) 2013 Vidar Hasfjord
9//
10// For more information, including license details, see
11// http://owlnext.sourceforge.net
12//
13
14#if !defined(OWL_DISPATCH_H)
15#define OWL_DISPATCH_H
16
17#include <owl/private/defs.h>
18#if defined(BI_HAS_PRAGMA_ONCE)
19# pragma once
20#endif
21
22#include <owl/defs.h>
23#include <owl/geometry.h>
24#include <owl/wsyscls.h>
25#include <windowsx.h>
26#include <dbt.h> // We need PDEV_BROADCAST_HDR for the WM_DEVICECHANGE message.
27
30
31namespace owl {
32
33//
34// Forward declared types used for pointers and references in the dispatchers
35//
36
37class _OWLCLASS TCommandEnabler;
38class _OWLCLASS TDocument;
39class _OWLCLASS TView;
40class _OWLCLASS TDockingSlip;
41class _OWLCLASS TWindow;
42class _OWLCLASS TPoint;
43class _OWLCLASS TDropInfo;
44class _OWLCLASS TSize;
45class _OWLCLASS TRect;
46struct _OWLCLASS THelpHitInfo;
47
48//
49/// \name Aliases for Windows message parameters
50/// @{
51//
52typedef LRESULT TResult; ///< Result type
53typedef UINT TMsgId; ///< Message ID type
54typedef WPARAM TParam1; ///< First parameter type
55typedef LPARAM TParam2; ///< Second parameter type
56
57/// @}
58
59//
60/// \name Parameter factories
61/// @{
62//
63
64template <class T1, class T2>
65inline TParam2 MkParam2(const T1& lo, const T2& hi) {
66 return (uint32(hi) << 16) | uint16(lo);
67}
69 return (uint32(hi) << 16) | uint16(lo);
70}
71
72/// @}
73
74#if !defined(OWL5_COMPAT)
75#define OWL_NEW_RESPONSE_TABLE 1
76#endif
77
78#if OWL_NEW_RESPONSE_TABLE // New response table implementation:
79
80typedef void TGeneric; // For backward compatibility.
81
82//
83/// The general signature of a dispatcher function
84/// Takes a pointer to an object as well as the raw message arguments.
85/// The dispatcher should crack the message arguments and forward the message to the given object.
86/// This means that the dispatcher needs to have static knowledge of the particular message
87/// handled, the type of object passed, and the particular member function to forward to.
88//
89typedef _OWLFUNC(TResult) (*TDispatchFunction)(void* i, TParam1, TParam2);
90
91//
92// Simple dispatch using the new implementation of the machinery
93//
94#define OWL_DISPATCH(dispatch, method)\
95 &dispatch<TMyClass, &TMyClass::method>
96
97#else // Old response table implementation:
98
99//
100// Generic class for casting pointer to objects and pointer to member functions
101// Class is not actually defined or implemented anywhere
102//
103class TGeneric;
104
105//
106// Generic pointer to member function
107//
108typedef void (TGeneric::*TAnyPMF)();
109
110//
111// All message dispatcher functions take four parameters:
112//
113// - reference to an object
114// - pointer to member function (signature varies according to the cracking
115// that the function performs)
116// - \c \b wParam
117// - \c \b lParam
118//
119typedef _OWLFUNC(TResult) (*TAnyDispatcher)(TGeneric&, TAnyPMF, TParam1, TParam2);
120
121//
122// This template function is used as an adaptor to the new dispatchers.
123// It has the old TAnyDispatcher signature, so can be plugged into the old machinery.
124// It simply drops the unused TAnyPMF argument and forwards the call to the given dispatcher.
125// If the machinery is modernised in the future, the use of this function can be removed.
126//
127template <TResult (*F)(void*, TParam1, TParam2)>
130
131#define OWL_DISPATCH(dispatch, method)\
132 &owl::AnyDispatch<&dispatch<TMyClass, &TMyClass::method> >
133
134#endif
135
136//-------------------------------------------------------------------------------------------------
137
138#if !defined(OWL_EV_SIGNATURE_CHECK)
139#define OWL_EV_SIGNATURE_CHECK 1
140#endif
141
142#if OWL_EV_SIGNATURE_CHECK
143
144// Specialised dispatch templates
145
146template <TMsgId MsgId>
148{
149 template <class T> struct THandler {typedef TResult (T::*type)(TParam1, TParam2);};
150
151 template <class T, TResult (T::*M)(TParam1, TParam2)>
152 static TResult Decode(void* i, TParam1 p1, TParam2 p2)
153 {return (static_cast<T*>(i)->*M)(p1, p2);}
154};
155
156template <TMsgId MsgId>
158
159template <> struct TDispatchChildNotify<WM_COMMAND>
160{
161 template <class T> struct THandler {typedef void (T::*type)();};
162
163 template <class T, void (T::*M)()>
164 static TResult Decode(void* i, TParam1, TParam2)
165 {return (static_cast<T*>(i)->*M)(), 0;}
166};
167
168template <TMsgId MsgId>
170
172{
173 template <class T> struct THandler {typedef void (T::*type)(uint);};
174
175 template <class T, void (T::*M)(uint)>
176 static TResult Decode(void* i, TParam1 p1, TParam2)
177 {return (static_cast<T*>(i)->*M)(static_cast<uint>(p1)), 0;}
178};
179
180template <TMsgId MsgId>
181struct TDispatchCommand;
182
183template <> struct TDispatchCommand<WM_COMMAND>
184{
185 template <class T> struct THandler {typedef void (T::*type)();};
186
187 template <class T, void (T::*M)()>
188 static TResult Decode(void* i, TParam1, TParam2)
189 {return (static_cast<T*>(i)->*M)(), 0;}
190};
191
192template <TMsgId MsgId>
194
195template <> struct TDispatchCommandWithId<WM_COMMAND>
196{
197 template <class T> struct THandler {typedef void (T::*type)(uint);};
198
199 template <class T, void (T::*M)(uint)>
200 static TResult Decode(void* i, TParam1 p1, TParam2)
201 {return (static_cast<T*>(i)->*M)(static_cast<uint>(p1)), 0;}
202};
203
204#else
205
206// Obsolete free-standing dispatch functions.
207
208template <class T, TResult (T::*M)(TParam1, TParam2)>
210{return (static_cast<T*>(i)->*M)(p1, p2);}
211
212template <class T, void (T::*M)()>
214{return (static_cast<T*>(i)->*M)(), 0;}
215
216template <class T, void (T::*M)(uint)>
218{return (static_cast<T*>(i)->*M)(static_cast<uint>(p1)), 0;}
219
220template <class T, void (T::*M)()>
222{return (static_cast<T*>(i)->*M)(), 0;}
223
224template <class T, void (T::*M)(uint)>
226{return (static_cast<T*>(i)->*M)(static_cast<uint>(p1)), 0;}
227
228#endif
229
230#if OWL_EV_SIGNATURE_CHECK
231
232//
233/// Utility template for checking event handler signatures.
234//
235template <class T, TMsgId MsgId, template <TMsgId> class D>
236constexpr auto CheckSignature(typename D<MsgId>::template THandler<T>::type) noexcept -> bool
237{return true;}
238
239//
240/// Utility template for checking event handler signatures.
241/// Overload for notifications.
242//
243template <class T, TMsgId MsgId, uint NotificationCode, template <TMsgId> class D>
245{return true;}
246
247#endif
248
249//-------------------------------------------------------------------------------------------------
250// Windows message-specific dispatchers
251
252//
253/// Undefined default template for dispatchers
254/// Template specialization is used to allow the compiler to look up the dispatcher for a
255/// particular message at compile-time.
256//
257template <uint MessageID>
259
260template <> struct TDispatch<WM_ACTIVATE>
261{
262
263#if OWL_EV_SIGNATURE_CHECK
264
265 template <class T> struct THandler {typedef void (T::*type)(uint, bool, HWND);};
266
267#endif
268
269 template <class T, void (T::*M)(uint, bool, HWND)>
271 {
272 struct TForwarder
273 {
274 T* i_;
276 {(i_->*M)(active, minimized, other);}
277 }
278 forwarder = {static_cast<T*>(i)};
279 InUse(p1); InUse(p2);
280 return HANDLE_WM_ACTIVATE(nullptr, p1, p2, forwarder);
281 }
282};
283
284template <> struct TDispatch<WM_ACTIVATEAPP>
285{
286
287#if OWL_EV_SIGNATURE_CHECK
288
289 template <class T> struct THandler {typedef void (T::*type)(bool, DWORD);};
290
291#endif
292
293 template <class T, void (T::*M)(bool, DWORD)>
295 {
296 struct TForwarder
297 {
298 T* i_;
300 {(i_->*M)(active, threadId);}
301 }
302 forwarder = {static_cast<T*>(i)};
303 InUse(p1); InUse(p2);
304 return HANDLE_WM_ACTIVATEAPP(nullptr, p1, p2, forwarder);
305 }
306};
307
308template <> struct TDispatch<WM_ASKCBFORMATNAME>
309{
310
311#if OWL_EV_SIGNATURE_CHECK
312
313 template <class T> struct THandler {typedef void (T::*type)(uint bufferSize, LPTSTR formatNameBuffer);};
314
315#endif
316
317 template <class T, void (T::*M)(uint bufferSize, LPTSTR formatNameBuffer)>
319 {
320 struct TForwarder
321 {
322 T* i_;
324 {(i_->*M)(static_cast<uint>(cchMax), rgchName);}
325 }
326 forwarder = {static_cast<T*>(i)};
327 InUse(p1); InUse(p2);
329 }
330};
331
332template <> struct TDispatch<WM_CANCELMODE>
333{
334
335#if OWL_EV_SIGNATURE_CHECK
336
337 template <class T> struct THandler {typedef void (T::*type)();};
338
339#endif
340
341 template <class T, void (T::*M)()>
343 {
344 struct TForwarder
345 {
346 T* i_;
347 void operator ()(HWND)
348 {(i_->*M)();}
349 }
350 forwarder = {static_cast<T*>(i)};
351 InUse(p1); InUse(p2);
352 return HANDLE_WM_CANCELMODE(nullptr, p1, p2, forwarder);
353 }
354};
355
356//
357// HANDLE_WM_CAPTURECHANGED is missing from "windowsx.h".
358//
359template <> struct TDispatch<WM_CAPTURECHANGED>
360{
361
362#if OWL_EV_SIGNATURE_CHECK
363
364 template <class T> struct THandler {typedef void (T::*type)(HWND capture);};
365
366#endif
367
368 template <class T, void (T::*M)(HWND capture)>
370 {return (static_cast<T*>(i)->*M)(reinterpret_cast<HWND>(p2)), 0;}
371};
372
373template <> struct TDispatch<WM_CHANGECBCHAIN>
374{
375
376#if OWL_EV_SIGNATURE_CHECK
377
378 template <class T> struct THandler {typedef void (T::*type)(HWND removed, HWND next);};
379
380#endif
381
382 template <class T, void (T::*M)(HWND removed, HWND next)>
384 {
385 struct TForwarder
386 {
387 T* i_;
389 {(i_->*M)(hwndRemove, hwndNext);}
390 }
391 forwarder = {static_cast<T*>(i)};
392 InUse(p1); InUse(p2);
393 return HANDLE_WM_CHANGECBCHAIN(nullptr, p1, p2, forwarder);
394 }
395};
396
397//
398// TODO: Remove the useless 'flags' parameter, change 'repeatCount' to int, and change the 'key' parameter to 'ch'.
399//
400template <> struct TDispatch<WM_CHAR>
401{
402
403#if OWL_EV_SIGNATURE_CHECK
404
405 template <class T> struct THandler {typedef void (T::*type)(uint ch, uint repeatCount, uint flags);};
406
407#endif
408
409 template <class T, void (T::*M)(uint ch, uint repeatCount, uint flags)>
411 {
412 struct TForwarder
413 {
414 T* i_;
415 void operator ()(HWND, TCHAR ch, int cRepeat)
416 {(i_->*M)(static_cast<uint>(ch), static_cast<uint>(cRepeat), 0);}
417 }
418 forwarder = {static_cast<T*>(i)};
419 InUse(p1); InUse(p2);
420 return HANDLE_WM_CHAR(nullptr, p1, p2, forwarder);
421 }
422};
423
424template <> struct TDispatch<WM_CHARTOITEM>
425{
426
427#if OWL_EV_SIGNATURE_CHECK
428
429 template <class T> struct THandler {typedef int (T::*type)(uint ch, HWND listBox, int caretIndex);};
430
431#endif
432
433 template <class T, int (T::*M)(uint ch, HWND listBox, int caretIndex)>
435 {
436 struct TForwarder
437 {
438 T* i_;
440 {return (i_->*M)(ch, hwndListbox, iCaret);}
441 }
442 forwarder = {static_cast<T*>(i)};
443 InUse(p1); InUse(p2);
444 return HANDLE_WM_CHARTOITEM(0, p1, p2, forwarder);
445 }
446};
447
448template <> struct TDispatch<WM_CHILDACTIVATE>
449{
450
451#if OWL_EV_SIGNATURE_CHECK
452
453 template <class T> struct THandler {typedef void (T::*type)();};
454
455#endif
456
457 template <class T, void (T::*M)()>
459 {
460 struct TForwarder
461 {
462 T* i_;
463 void operator ()(HWND)
464 {(i_->*M)();}
465 }
466 forwarder = {static_cast<T*>(i)};
467 InUse(p1); InUse(p2);
469 }
470};
471
472template <> struct TDispatch<WM_CLOSE>
473{
474
475#if OWL_EV_SIGNATURE_CHECK
476
477 template <class T> struct THandler {typedef void (T::*type)();};
478
479#endif
480
481 template <class T, void (T::*M)()>
483 {
484 struct TForwarder
485 {
486 T* i_;
487 void operator ()(HWND)
488 {(i_->*M)();}
489 }
490 forwarder = {static_cast<T*>(i)};
491 InUse(p1); InUse(p2);
492 return HANDLE_WM_CLOSE(nullptr, p1, p2, forwarder);
493 }
494};
495
496template <> struct TDispatch<WM_COMPACTING>
497{
498
499#if OWL_EV_SIGNATURE_CHECK
500
501 template <class T> struct THandler {typedef void (T::*type)(uint compactRatio);};
502
503#endif
504
505 template <class T, void (T::*M)(uint compactRatio)>
507 {
508 struct TForwarder
509 {
510 T* i_;
512 {(i_->*M)(compactRatio);}
513 }
514 forwarder = {static_cast<T*>(i)};
515 InUse(p1); InUse(p2);
516 return HANDLE_WM_COMPACTING(0, p1, p2, forwarder);
517 }
518};
519
520template <> struct TDispatch<WM_COMPAREITEM>
521{
522
523#if OWL_EV_SIGNATURE_CHECK
524
525 template <class T> struct THandler {typedef int (T::*type)(uint, const COMPAREITEMSTRUCT&);};
526
527#endif
528
529 template <class T, int (T::*M)(uint, const COMPAREITEMSTRUCT&)>
531 {
532 struct TForwarder
533 {
534 T* i_;
536 {
538 return c ? (i_->*M)(c->CtlID, *c) : 0;
539 }
540 }
541 forwarder = {static_cast<T*>(i)};
542 InUse(p1); InUse(p2);
543 return HANDLE_WM_COMPAREITEM(nullptr, p1, p2, forwarder);
544 }
545};
546
547//
548// TODO: Coordinate parameters should be replaced by TPoint.
549//
550template <> struct TDispatch<WM_CONTEXTMENU>
551{
552
553#if OWL_EV_SIGNATURE_CHECK
554
555 template <class T> struct THandler {typedef void (T::*type)(HWND, int, int);};
556
557#endif
558
559 template <class T, void (T::*M)(HWND, int, int)>
561 {
562 struct TForwarder
563 {
564 T* i_;
565 void operator ()(HWND, HWND w, int x, int y)
566 {(i_->*M)(w, x, y);}
567 }
568 forwarder = {static_cast<T*>(i)};
569 InUse(p1); InUse(p2);
570 return HANDLE_WM_CONTEXTMENU(nullptr, p1, p2, forwarder);
571 }
572};
573
574//
575// HANDLE_WM_COPYDATA has a bug; it treats the handler as returning nothing (void), and the macro
576// hence always returns 0. We therefore implement this specialization manually.
577//
578template <> struct TDispatch<WM_COPYDATA>
579{
580
581#if OWL_EV_SIGNATURE_CHECK
582
583 template <class T> struct THandler {typedef bool (T::*type)(HWND sender, const COPYDATASTRUCT&);};
584
585#endif
586
587 template <class T, bool (T::*M)(HWND sender, const COPYDATASTRUCT&)>
589 {
590 PRECONDITION(p2 != 0);
591 return (p2 != 0 && (static_cast<T*>(i)->*M)(reinterpret_cast<HWND>(p1), *reinterpret_cast<PCOPYDATASTRUCT>(p2))) ? TRUE : FALSE;
592 }
593};
594
595template <> struct TDispatch<WM_CREATE>
596{
597
598#if OWL_EV_SIGNATURE_CHECK
599
600 template <class T> struct THandler {typedef bool (T::*type)(CREATESTRUCT&);};
601
602#endif
603
604 template <class T, bool (T::*M)(CREATESTRUCT&)>
606 {
607 struct TForwarder
608 {
609 T* i_;
611 {
613 return (c && (i_->*M)(*c)) ? TRUE : FALSE;
614 }
615 }
616 forwarder = {static_cast<T*>(i)};
617 InUse(p1); InUse(p2);
618 return HANDLE_WM_CREATE(nullptr, p1, p2, forwarder);
619 }
620};
621
622template <> struct TDispatch<WM_CTLCOLORBTN>
623{
624
625#if OWL_EV_SIGNATURE_CHECK
626
627 template <class T> struct THandler {typedef HBRUSH (T::*type)(HDC, HWND, uint);};
628
629#endif
630
631 template <class T, HBRUSH (T::*M)(HDC, HWND, uint)>
633 {
634 struct TForwarder
635 {
636 T* i_;
638 {return (i_->*M)(d, w, ctlType);}
639 }
640 forwarder = {static_cast<T*>(i)};
641 InUse(p1); InUse(p2);
642 return HANDLE_WM_CTLCOLORBTN(nullptr, p1, p2, forwarder);
643 }
644};
645
646template <> struct TDispatch<WM_CTLCOLOREDIT>
647{
648
649#if OWL_EV_SIGNATURE_CHECK
650
651 template <class T> struct THandler {typedef HBRUSH (T::*type)(HDC, HWND, uint);};
652
653#endif
654
655 template <class T, HBRUSH (T::*M)(HDC, HWND, uint)>
657 {
658 struct TForwarder
659 {
660 T* i_;
662 {return (i_->*M)(d, w, ctlType);}
663 }
664 forwarder = {static_cast<T*>(i)};
665 InUse(p1); InUse(p2);
666 return HANDLE_WM_CTLCOLOREDIT(nullptr, p1, p2, forwarder);
667 }
668};
669
670template <> struct TDispatch<WM_CTLCOLORDLG>
671{
672
673#if OWL_EV_SIGNATURE_CHECK
674
675 template <class T> struct THandler {typedef HBRUSH (T::*type)(HDC, HWND, uint);};
676
677#endif
678
679 template <class T, HBRUSH (T::*M)(HDC, HWND, uint)>
681 {
682 struct TForwarder
683 {
684 T* i_;
686 {return (i_->*M)(d, w, ctlType);}
687 }
688 forwarder = {static_cast<T*>(i)};
689 InUse(p1); InUse(p2);
690 return HANDLE_WM_CTLCOLORDLG(nullptr, p1, p2, forwarder);
691 }
692};
693
694template <> struct TDispatch<WM_CTLCOLORLISTBOX>
695{
696
697#if OWL_EV_SIGNATURE_CHECK
698
699 template <class T> struct THandler {typedef HBRUSH (T::*type)(HDC, HWND, uint);};
700
701#endif
702
703 template <class T, HBRUSH (T::*M)(HDC, HWND, uint)>
705 {
706 struct TForwarder
707 {
708 T* i_;
710 {return (i_->*M)(d, w, ctlType);}
711 }
712 forwarder = {static_cast<T*>(i)};
713 InUse(p1); InUse(p2);
714 return HANDLE_WM_CTLCOLORLISTBOX(nullptr, p1, p2, forwarder);
715 }
716};
717
718#if defined(OWL5_COMPAT)
719
720//
721/// This dispatch specialization is deprecated.
722/// The WM_CTLCOLORMSGBOX message is obsolete. It is not even documented at MSDN.
723/// \sa http://msdn.microsoft.com/en-us/library/windows/desktop/ms644995.aspx#control_color
724//
725template <> struct TDispatch<WM_CTLCOLORMSGBOX>
726{
727
728#if OWL_EV_SIGNATURE_CHECK
729
730 template <class T> struct THandler {typedef HBRUSH (T::*type)(HDC, HWND, uint);};
731
732#endif
733
734 template <class T, HBRUSH (T::*M)(HDC, HWND, uint)>
735 static TResult Decode(void* i, TParam1 p1, TParam2 p2)
736 {
737 struct TForwarder
738 {
739 T* i_;
741 {return (i_->*M)(d, w, ctlType);}
742 }
743 forwarder = {static_cast<T*>(i)};
744 InUse(p1); InUse(p2);
746 }
747};
748
749#endif
750
752{
753
754#if OWL_EV_SIGNATURE_CHECK
755
756 template <class T> struct THandler {typedef HBRUSH (T::*type)(HDC, HWND, uint);};
757
758#endif
759
760 template <class T, HBRUSH (T::*M)(HDC, HWND, uint)>
762 {
763 struct TForwarder
764 {
765 T* i_;
767 {return (i_->*M)(d, w, ctlType);}
768 }
769 forwarder = {static_cast<T*>(i)};
770 InUse(p1); InUse(p2);
771 return HANDLE_WM_CTLCOLORSCROLLBAR(nullptr, p1, p2, forwarder);
772 }
773};
774
775template <> struct TDispatch<WM_CTLCOLORSTATIC>
776{
777
778#if OWL_EV_SIGNATURE_CHECK
779
780 template <class T> struct THandler {typedef HBRUSH (T::*type)(HDC, HWND, uint);};
781
782#endif
783
784 template <class T, HBRUSH (T::*M)(HDC, HWND, uint)>
786 {
787 struct TForwarder
788 {
789 T* i_;
791 {return (i_->*M)(d, w, ctlType);}
792 }
793 forwarder = {static_cast<T*>(i)};
794 InUse(p1); InUse(p2);
795 return HANDLE_WM_CTLCOLORSTATIC(nullptr, p1, p2, forwarder);
796 }
797};
798
799template <> struct TDispatch<WM_CUT>
800{
801
802#if OWL_EV_SIGNATURE_CHECK
803
804 template <class T> struct THandler {typedef void (T::*type)();};
805
806#endif
807
808 template <class T, void (T::*M)()>
810 {
811 struct TForwarder
812 {
813 T* i_;
814 void operator ()(HWND)
815 {(i_->*M)();}
816 }
817 forwarder = {static_cast<T*>(i)};
818 InUse(p1); InUse(p2);
819 return HANDLE_WM_CUT(0, p1, p2, forwarder);
820 }
821};
822
823//
824// TODO: Remove the useless 'flags' parameter, change 'repeatCount' to int, and change the 'deadKey' parameter to 'ch'.
825//
826template <> struct TDispatch<WM_DEADCHAR>
827{
828
829#if OWL_EV_SIGNATURE_CHECK
830
831 template <class T> struct THandler {typedef void (T::*type)(uint deadKey, uint repeatCount, uint flags);};
832
833#endif
834
835 template <class T, void (T::*M)(uint deadKey, uint repeatCount, uint flags)>
837 {
838 struct TForwarder
839 {
840 T* i_;
841 void operator ()(HWND, TCHAR ch, int cRepeat)
842 {(i_->*M)(static_cast<uint>(ch), static_cast<uint>(cRepeat), 0);}
843 }
844 forwarder = {static_cast<T*>(i)};
845 InUse(p1); InUse(p2);
846 return HANDLE_WM_DEADCHAR(0, p1, p2, forwarder);
847 }
848};
849
850template <> struct TDispatch<WM_DELETEITEM>
851{
852
853#if OWL_EV_SIGNATURE_CHECK
854
855 template <class T> struct THandler {typedef void (T::*type)(uint, const DELETEITEMSTRUCT&);};
856
857#endif
858
859 template <class T, void (T::*M)(uint, const DELETEITEMSTRUCT&)>
861 {
862 struct TForwarder
863 {
864 T* i_;
865 void operator ()(HWND, const DELETEITEMSTRUCT* d)
866 {
868 if (d) (i_->*M)(d->CtlID, *d);
869 }
870 }
871 forwarder = {static_cast<T*>(i)};
872 InUse(p1); InUse(p2);
873 return HANDLE_WM_DELETEITEM(nullptr, p1, p2, forwarder);
874 }
875};
876
877template <> struct TDispatch<WM_DESTROY>
878{
879
880#if OWL_EV_SIGNATURE_CHECK
881
882 template <class T> struct THandler {typedef void (T::*type)();};
883
884#endif
885
886 template <class T, void (T::*M)()>
888 {
889 struct TForwarder
890 {
891 T* i_;
892 void operator ()(HWND)
893 {(i_->*M)();}
894 }
895 forwarder = {static_cast<T*>(i)};
896 InUse(p1); InUse(p2);
897 return HANDLE_WM_DESTROY(nullptr, p1, p2, forwarder);
898 }
899};
900
902{
903
904#if OWL_EV_SIGNATURE_CHECK
905
906 template <class T> struct THandler {typedef void (T::*type)();};
907
908#endif
909
910 template <class T, void (T::*M)()>
912 {
913 struct TForwarder
914 {
915 T* i_;
916 void operator ()(HWND)
917 {(i_->*M)();}
918 }
919 forwarder = {static_cast<T*>(i)};
920 InUse(p1); InUse(p2);
922 }
923};
924
925//
926// Note that the OWLNext 6.32 handler signature was non-compliant (bool (T::*)(uint, uint)).
927// For this reason we do not provide a compatibility implementation here.
928// Also note that the HANDLE_WM_DEVICECHANGE macro in "windowsx.h" has a bug.
929// The event data pointer passed in the LPARAM argument is truncated to DWORD.
930// Also, the result type should allow for the BROADCAST_QUERY_DENY return value specified for some
931// of the events. We use TResult here to signal that the return value type is the union of possible
932// return value types from all the current (and possible future) events. See the Windows API
933// documentation for details.
934//
935template <> struct TDispatch<WM_DEVICECHANGE>
936{
937
938#if OWL_EV_SIGNATURE_CHECK
939
940 template <class T> struct THandler {typedef TResult (T::*type)(uint event, PDEV_BROADCAST_HDR eventData);};
941
942#endif
943
944 template <class T, TResult (T::*M)(uint event, PDEV_BROADCAST_HDR eventData)>
946 {return (static_cast<T*>(i)->*M)(static_cast<uint>(p1), reinterpret_cast<PDEV_BROADCAST_HDR>(p2));}
947};
948
949template <> struct TDispatch<WM_DEVMODECHANGE>
950{
951
952#if OWL_EV_SIGNATURE_CHECK
953
954 template <class T> struct THandler {typedef void (T::*type)(LPCTSTR deviceName);};
955
956#endif
957
958 template <class T, void (T::*M)(LPCTSTR deviceName)>
960 {
961 struct TForwarder
962 {
963 T* i_;
965 {(i_->*M)(lpszDeviceName);}
966 }
967 forwarder = {static_cast<T*>(i)};
968 InUse(p1); InUse(p2);
970 }
971};
972
973template <> struct TDispatch<WM_DISPLAYCHANGE>
974{
975
976#if OWL_EV_SIGNATURE_CHECK
977
978 template <class T> struct THandler {typedef void (T::*type)(uint bitsPerPixel, uint screenResolutionWidth, uint screenResolutionHeight);};
979
980#endif
981
982 template <class T, void (T::*M)(uint bitsPerPixel, uint screenResolutionWidth, uint screenResolutionHeight)>
984 {
985 struct TForwarder
986 {
987 T* i_;
990 }
991 forwarder = {static_cast<T*>(i)};
992 InUse(p1); InUse(p2);
994 }
995};
996
997template <> struct TDispatch<WM_DRAWCLIPBOARD>
998{
999
1000#if OWL_EV_SIGNATURE_CHECK
1001
1002 template <class T> struct THandler {typedef void (T::*type)();};
1003
1004#endif
1005
1006 template <class T, void (T::*M)()>
1008 {
1009 struct TForwarder
1010 {
1011 T* i_;
1012 void operator ()(HWND)
1013 {(i_->*M)();}
1014 }
1015 forwarder = {static_cast<T*>(i)};
1016 InUse(p1); InUse(p2);
1017 return HANDLE_WM_DRAWCLIPBOARD(nullptr, p1, p2, forwarder);
1018 }
1019};
1020
1021template <> struct TDispatch<WM_DRAWITEM>
1022{
1023
1024#if OWL_EV_SIGNATURE_CHECK
1025
1026 template <class T> struct THandler {typedef void (T::*type)(uint, const DRAWITEMSTRUCT&);};
1027
1028#endif
1029
1030 template <class T, void (T::*M)(uint, const DRAWITEMSTRUCT&)>
1032 {
1033 struct TForwarder
1034 {
1035 T* i_;
1036 void operator ()(HWND, const DRAWITEMSTRUCT* d)
1037 {
1038 PRECONDITION(d);
1039 if (d) (i_->*M)(d->CtlID, *d);
1040 }
1041 }
1042 forwarder = {static_cast<T*>(i)};
1043 InUse(p1); InUse(p2);
1044 return HANDLE_WM_DRAWITEM(nullptr, p1, p2, forwarder);
1045 }
1046};
1047
1048template <> struct TDispatch<WM_DROPFILES>
1049{
1050
1051#if OWL_EV_SIGNATURE_CHECK
1052
1053 template <class T> struct THandler {typedef void (T::*type)(TDropInfo);};
1054
1055#endif
1056
1057 template <class T, void (T::*M)(TDropInfo)>
1059 {
1060 struct TForwarder
1061 {
1062 T* i_;
1064 {(i_->*M)(TDropInfo(hdrop));}
1065 }
1066 forwarder = {static_cast<T*>(i)};
1067 InUse(p1); InUse(p2);
1068 return HANDLE_WM_DROPFILES(nullptr, p1, p2, forwarder);
1069 }
1070};
1071
1072template <> struct TDispatch<WM_ENABLE>
1073{
1074
1075#if OWL_EV_SIGNATURE_CHECK
1076
1077 template <class T> struct THandler {typedef void (T::*type)(bool);};
1078
1079#endif
1080
1081 template <class T, void (T::*M)(bool)>
1083 {
1084 struct TForwarder
1085 {
1086 T* i_;
1088 {(i_->*M)(fEnable);}
1089 }
1090 forwarder = {static_cast<T*>(i)};
1091 InUse(p1); InUse(p2);
1092 return HANDLE_WM_ENABLE(0, p1, p2, forwarder);
1093 }
1094};
1095
1096//
1097// HANDLE_WM_ENDSESSION does not decode and pass the flags.
1098//
1099template <> struct TDispatch<WM_ENDSESSION>
1100{
1101 template <class F>
1102 static void Encode(F sendMessage, HWND wnd, bool endSession, uint flags)
1103 {sendMessage(wnd, WM_ENDSESSION, endSession ? TRUE : FALSE, static_cast<TParam2>(flags));}
1104
1105
1106#if OWL_EV_SIGNATURE_CHECK
1107
1108 template <class T> struct THandler {typedef void (T::*type)(bool endSession, uint flags);};
1109
1110#endif
1111
1112 template <class T, void (T::*M)(bool endSession, uint flags)>
1114 {return (static_cast<T*>(i)->*M)(static_cast<bool>(p1), static_cast<uint>(p2)), 0;}
1115};
1116
1117template <> struct TDispatch<WM_ENTERIDLE>
1118{
1119
1120#if OWL_EV_SIGNATURE_CHECK
1121
1122 template <class T> struct THandler {typedef void (T::*type)(uint source, HWND);};
1123
1124#endif
1125
1126 template <class T, void (T::*M)(uint source, HWND)>
1128 {
1129 struct TForwarder
1130 {
1131 T* i_;
1133 {(i_->*M)(source, hWndDlg);}
1134 }
1135 forwarder = {static_cast<T*>(i)};
1136 InUse(p1); InUse(p2);
1137 return HANDLE_WM_ENTERIDLE(nullptr, p1, p2, forwarder);
1138 }
1139};
1140
1141//
1142// HANDLE_WM_ENTERMENULOOP is missing from "windowsx.h".
1143//
1144template <> struct TDispatch<WM_ENTERMENULOOP>
1145{
1146
1147#if OWL_EV_SIGNATURE_CHECK
1148
1149 template <class T> struct THandler {typedef void (T::*type)(bool isTrackPopupMenu);};
1150
1151#endif
1152
1153 template <class T, void (T::*M)(bool isTrackPopupMenu)>
1155 {return (static_cast<T*>(i)->*M)(static_cast<BOOL>(p1) == TRUE), 0;}
1156};
1157
1158template <> struct TDispatch<WM_ENTERSIZEMOVE>
1159{
1160
1161#if OWL_EV_SIGNATURE_CHECK
1162
1163 template <class T> struct THandler {typedef void (T::*type)();};
1164
1165#endif
1166
1167 template <class T, void (T::*M)()>
1169 {
1170 struct TForwarder
1171 {
1172 T* i_;
1173 void operator ()(HWND)
1174 {(i_->*M)();}
1175 }
1176 forwarder = {static_cast<T*>(i)};
1177 InUse(p1); InUse(p2);
1179 }
1180};
1181
1182template <> struct TDispatch<WM_ERASEBKGND>
1183{
1184
1185#if OWL_EV_SIGNATURE_CHECK
1186
1187 template <class T> struct THandler {typedef bool (T::*type)(HDC);};
1188
1189#endif
1190
1191 template <class T, bool (T::*M)(HDC)>
1193 {
1194 struct TForwarder
1195 {
1196 T* i_;
1198 {return (i_->*M)(h) ? TRUE : FALSE;}
1199 }
1200 forwarder = {static_cast<T*>(i)};
1201 InUse(p1); InUse(p2);
1202 return HANDLE_WM_ERASEBKGND(nullptr, p1, p2, forwarder);
1203 }
1204};
1205
1206//
1207// HANDLE_WM_EXITMENULOOP is missing from "windowsx.h".
1208//
1209template <> struct TDispatch<WM_EXITMENULOOP>
1210{
1211
1212#if OWL_EV_SIGNATURE_CHECK
1213
1214 template <class T> struct THandler {typedef void (T::*type)(bool isTrackPopupMenu);};
1215
1216#endif
1217
1218 template <class T, void (T::*M)(bool isTrackPopupMenu)>
1220 {return (static_cast<T*>(i)->*M)(static_cast<BOOL>(p1) == TRUE), 0;}
1221};
1222
1223//
1224// HANDLE_WM_EXITSIZEMOVE is missing from "windowsx.h".
1225//
1226template <> struct TDispatch<WM_EXITSIZEMOVE>
1227{
1228
1229#if OWL_EV_SIGNATURE_CHECK
1230
1231 template <class T> struct THandler {typedef void (T::*type)();};
1232
1233#endif
1234
1235 template <class T, void (T::*M)()>
1237 {return (static_cast<T*>(i)->*M)(), 0;}
1238};
1239
1240template <> struct TDispatch<WM_FONTCHANGE>
1241{
1242
1243#if OWL_EV_SIGNATURE_CHECK
1244
1245 template <class T> struct THandler {typedef void (T::*type)();};
1246
1247#endif
1248
1249 template <class T, void (T::*M)()>
1251 {
1252 struct TForwarder
1253 {
1254 T* i_;
1255 void operator ()(HWND)
1256 {(i_->*M)();}
1257 }
1258 forwarder = {static_cast<T*>(i)};
1259 InUse(p1); InUse(p2);
1260 return HANDLE_WM_FONTCHANGE(0, p1, p2, forwarder);
1261 }
1262};
1263
1264template <> struct TDispatch<WM_GETDLGCODE>
1265{
1266
1267#if OWL_EV_SIGNATURE_CHECK
1268
1269 template <class T> struct THandler {typedef uint (T::*type)(const MSG*);};
1270
1271#endif
1272
1273 template <class T, uint (T::*M)(const MSG*)>
1275 {
1276 struct TForwarder
1277 {
1278 T* i_;
1280 {return (i_->*M)(msg);}
1281 }
1282 forwarder = {static_cast<T*>(i)};
1283 InUse(p1); InUse(p2);
1284 return HANDLE_WM_GETDLGCODE(nullptr, p1, p2, forwarder);
1285 }
1286};
1287
1288template <> struct TDispatch<WM_GETFONT>
1289{
1290
1291#if OWL_EV_SIGNATURE_CHECK
1292
1293 template <class T> struct THandler {typedef HFONT (T::*type)();};
1294
1295#endif
1296
1297 template <class T, HFONT (T::*M)()>
1299 {
1300 struct TForwarder
1301 {
1302 T* i_;
1304 {return (i_->*M)();}
1305 }
1306 forwarder = {static_cast<T*>(i)};
1307 InUse(p1); InUse(p2);
1308 return HANDLE_WM_GETFONT(nullptr, p1, p2, forwarder);
1309 }
1310};
1311
1312template <> struct TDispatch<WM_GETICON>
1313{
1314
1315#if OWL_EV_SIGNATURE_CHECK
1316
1317 template <class T> struct THandler {typedef HICON (T::*type)(uint iconType);};
1318
1319#endif
1320
1321 template <class T, HICON (T::*M)(uint iconType)>
1323 {
1324 struct TForwarder
1325 {
1326 T* i_;
1328 {return (i_->*M)(iconType);}
1329 }
1330 forwarder = {static_cast<T*>(i)};
1331 InUse(p1); InUse(p2);
1332 return HANDLE_WM_GETICON(0, p1, p2, forwarder);
1333 }
1334};
1335
1336template <> struct TDispatch<WM_GETMINMAXINFO>
1337{
1338
1339#if OWL_EV_SIGNATURE_CHECK
1340
1341 template <class T> struct THandler {typedef void (T::*type)(MINMAXINFO&);};
1342
1343#endif
1344
1345 template <class T, void (T::*M)(MINMAXINFO&)>
1347 {
1348 struct TForwarder
1349 {
1350 T* i_;
1352 {
1354 if (lpMinMaxInfo) (i_->*M)(*lpMinMaxInfo);
1355 }
1356 }
1357 forwarder = {static_cast<T*>(i)};
1358 InUse(p1); InUse(p2);
1359 return HANDLE_WM_GETMINMAXINFO(nullptr, p1, p2, forwarder);
1360 }
1361};
1362
1363#if defined(OWL5_COMPAT)
1364
1365//
1366// The old "void EvGetText(uint, LPTSTR)" signature is non-compliant.
1367// The handler must return the number of characters copied, not including the terminating
1368// null-character. Here we assume that the WM_GETTEXTLENGHT message sent to the same window
1369// will return that correct number, except when the buffer is too small, in which case we assume
1370// that the buffer was filled to capacity (truncated), including a terminating null-character.
1371//
1372template <> struct TDispatch<WM_GETTEXT>
1373{
1374 template<class T, void (T::*M)(uint textBufferSize, LPTSTR textBuffer)>
1375 static TResult Decode(void* i, TParam1 p1, TParam2 p2)
1376 {
1377 int textBufferSize = static_cast<int>(p1);
1378 CHECK(textBufferSize > 0);
1379 (static_cast<T*>(i)->*M)(static_cast<uint>(textBufferSize), reinterpret_cast<LPTSTR>(p2));
1380 int length = static_cast<int>(static_cast<T*>(i)->HandleMessage(WM_GETTEXTLENGTH));
1381 CHECK(length >= 0);
1382 return static_cast<TResult>(length >= textBufferSize ? textBufferSize - 1 : length);
1383 }
1384};
1385
1386#else
1387
1388template <> struct TDispatch<WM_GETTEXT>
1389{
1390
1391#if OWL_EV_SIGNATURE_CHECK
1392
1393 template <class T> struct THandler {typedef int (T::*type)(int textBufferSize, LPTSTR textBuffer);};
1394
1395#endif
1396
1397 template <class T, int (T::*M)(int textBufferSize, LPTSTR textBuffer)>
1399 {
1400 struct TForwarder
1401 {
1402 T* i_;
1404 {return (i_->*M)(cchTextMax, lpszText);}
1405 }
1406 forwarder = {static_cast<T*>(i)};
1407 InUse(p1); InUse(p2);
1408 return HANDLE_WM_GETTEXT(0, p1, p2, forwarder);
1409 }
1410};
1411
1412#endif
1413
1414#if defined(OWL5_COMPAT)
1415
1416//
1417// The old EvGetTextLength returns uint.
1418//
1419template <> struct TDispatch<WM_GETTEXTLENGTH>
1420{
1421
1422#if OWL_EV_SIGNATURE_CHECK
1423
1424 template <class T> struct THandler {typedef uint (T::*type)();};
1425
1426#endif
1427
1428 template <class T, uint (T::*M)()>
1429 static TResult Decode(void* i, TParam1 p1, TParam2 p2)
1430 {
1431 struct TForwarder
1432 {
1433 T* i_;
1434 int operator ()(HWND)
1435 {return static_cast<int>((i_->*M)());}
1436 }
1437 forwarder = {static_cast<T*>(i)};
1438 InUse(p1); InUse(p2);
1440 }
1441};
1442
1443#else
1444
1445template <> struct TDispatch<WM_GETTEXTLENGTH>
1446{
1447
1448#if OWL_EV_SIGNATURE_CHECK
1449
1450 template <class T> struct THandler {typedef int (T::*type)();};
1451
1452#endif
1453
1454 template <class T, int (T::*M)()>
1456 {
1457 struct TForwarder
1458 {
1459 T* i_;
1460 int operator ()(HWND)
1461 {return (i_->*M)();}
1462 }
1463 forwarder = {static_cast<T*>(i)};
1464 InUse(p1); InUse(p2);
1466 }
1467};
1468
1469#endif
1470
1471//
1472// HANDLE_WM_HELP is missing from "windowsx.h".
1473//
1474template <> struct TDispatch<WM_HELP>
1475{
1476 template <class F>
1477 static void Encode(F sendMessage, HWND wnd, const HELPINFO& i)
1478 {
1479 HELPINFO iCopy = i;
1480 sendMessage(wnd, WM_HELP, 0, reinterpret_cast<TParam2>(&iCopy));
1481 }
1482
1483#if OWL_EV_SIGNATURE_CHECK
1484
1485 template <class T> struct THandler {typedef void (T::*type)(const HELPINFO&);};
1486
1487#endif
1488
1489 template <class T, void (T::*M)(const HELPINFO&)>
1491 {
1493 return p2 != 0 ? ((static_cast<T*>(i)->*M)(*reinterpret_cast<HELPINFO*>(p2)), 0) : 0;
1494 }
1495};
1496
1497#if defined(OWL5_COMPAT)
1498
1499template <> struct TDispatch<WM_HOTKEY>
1500{
1501
1502#if OWL_EV_SIGNATURE_CHECK
1503
1504 template <class T> struct THandler {typedef void (T::*type)(int idHotKey);};
1505
1506#endif
1507
1508 template <class T, void (T::*M)(int idHotKey)>
1509 static TResult Decode(void* i, TParam1 p1, TParam2 p2)
1510 {
1511 struct TForwarder
1512 {
1513 T* i_;
1514 void operator ()(HWND, int idHotKey, UINT /*fuModifiers*/, UINT /*vk*/)
1515 {(i_->*M)(idHotKey);}
1516 }
1517 forwarder = {static_cast<T*>(i)};
1518 InUse(p1); InUse(p2);
1519 return HANDLE_WM_HOTKEY(0, p1, p2, forwarder);
1520 }
1521};
1522
1523#else
1524
1525template <> struct TDispatch<WM_HOTKEY>
1526{
1527
1528#if OWL_EV_SIGNATURE_CHECK
1529
1530 template <class T> struct THandler {typedef void (T::*type)(int idHotKey, uint modifiers, uint vk);};
1531
1532#endif
1533
1534 template <class T, void (T::*M)(int idHotKey, uint modifiers, uint vk)>
1536 {
1537 struct TForwarder
1538 {
1539 T* i_;
1541 {(i_->*M)(idHotKey, fuModifiers, vk);}
1542 }
1543 forwarder = {static_cast<T*>(i)};
1544 InUse(p1); InUse(p2);
1545 return HANDLE_WM_HOTKEY(0, p1, p2, forwarder);
1546 }
1547};
1548
1549#endif
1550
1551template <> struct TDispatch<WM_HSCROLL>
1552{
1553
1554#if OWL_EV_SIGNATURE_CHECK
1555
1556 template <class T> struct THandler {typedef void (T::*type)(uint scrollCode, uint pos, HWND hCtl);};
1557
1558#endif
1559
1560 template <class T, void (T::*M)(uint scrollCode, uint pos, HWND hCtl)>
1562 {
1563 struct TForwarder
1564 {
1565 T* i_;
1566 void operator ()(HWND, HWND hwndCtl, UINT code, int pos)
1567 {(i_->*M)(code, static_cast<uint>(pos), hwndCtl);}
1568 }
1569 forwarder = {static_cast<T*>(i)};
1570 InUse(p1); InUse(p2);
1571 return HANDLE_WM_HSCROLL(nullptr, p1, p2, forwarder);
1572 }
1573};
1574
1576{
1577
1578#if OWL_EV_SIGNATURE_CHECK
1579
1580 template <class T> struct THandler {typedef void (T::*type)(HWND cliboardViewer, uint scrollCode, uint pos);};
1581
1582#endif
1583
1584 template <class T, void (T::*M)(HWND cliboardViewer, uint scrollCode, uint pos)>
1586 {
1587 struct TForwarder
1588 {
1589 T* i_;
1591 {(i_->*M)(hwndCBViewer, code, static_cast<uint>(pos));}
1592 }
1593 forwarder = {static_cast<T*>(i)};
1594 InUse(p1); InUse(p2);
1596 }
1597};
1598
1599template <> struct TDispatch<WM_INITMENU>
1600{
1601
1602#if OWL_EV_SIGNATURE_CHECK
1603
1604 template <class T> struct THandler {typedef void (T::*type)(HMENU);};
1605
1606#endif
1607
1608 template <class T, void (T::*M)(HMENU)>
1610 {
1611 struct TForwarder
1612 {
1613 T* i_;
1615 {(i_->*M)(hMenu);}
1616 }
1617 forwarder = {static_cast<T*>(i)};
1618 InUse(p1); InUse(p2);
1619 return HANDLE_WM_INITMENU(0, p1, p2, forwarder);
1620 }
1621};
1622
1623template <> struct TDispatch<WM_INITMENUPOPUP>
1624{
1625
1626#if OWL_EV_SIGNATURE_CHECK
1627
1628 template <class T> struct THandler {typedef void (T::*type)(HMENU, uint index, bool isSysMenu);};
1629
1630#endif
1631
1632 template <class T, void (T::*M)(HMENU, uint index, bool isSysMenu)>
1634 {
1635 struct TForwarder
1636 {
1637 T* i_;
1639 {(i_->*M)(hMenu, item, fSystemMenu);}
1640 }
1641 forwarder = {static_cast<T*>(i)};
1642 InUse(p1); InUse(p2);
1643 return HANDLE_WM_INITMENUPOPUP(nullptr, p1, p2, forwarder);
1644 }
1645};
1646
1647//
1648// HANDLE_WM_IMPUTLANGCHANGE is missing from "windowsx.h".
1649//
1651{
1652
1653#if OWL_EV_SIGNATURE_CHECK
1654
1655 template <class T> struct THandler {typedef void (T::*type)(uint charSet, uint localeId);};
1656
1657#endif
1658
1659 template <class T, void (T::*M)(uint charSet, uint localeId)>
1661 {return (static_cast<T*>(i)->*M)(static_cast<uint>(p1), static_cast<uint>(p2)), 0;}
1662};
1663
1664//
1665// HANDLE_WM_IMPUTLANGCHANGEREQUEST is missing from "windowsx.h".
1666//
1668{
1669
1670#if OWL_EV_SIGNATURE_CHECK
1671
1672 template <class T> struct THandler {typedef void (T::*type)(uint flags, uint localeId);};
1673
1674#endif
1675
1676 template <class T, void (T::*M)(uint flags, uint localeId)>
1678 {return (static_cast<T*>(i)->*M)(static_cast<uint>(p1), static_cast<uint>(p2)), 0;}
1679};
1680
1681template <> struct TDispatch<WM_KEYDOWN>
1682{
1683
1684#if OWL_EV_SIGNATURE_CHECK
1685
1686 template <class T> struct THandler {typedef void (T::*type)(uint key, uint repeatCount, uint flags);};
1687
1688#endif
1689
1690 template <class T, void (T::*M)(uint key, uint repeatCount, uint flags)>
1692 {
1693 struct TForwarder
1694 {
1695 T* i_;
1696 void operator ()(HWND, UINT vk, BOOL, int cRepeat, UINT flags)
1697 {(i_->*M)(vk, static_cast<uint>(cRepeat), flags);}
1698 }
1699 forwarder = {static_cast<T*>(i)};
1700 InUse(p1); InUse(p2);
1701 return HANDLE_WM_KEYDOWN(nullptr, p1, p2, forwarder);
1702 }
1703};
1704
1705template <> struct TDispatch<WM_KEYUP>
1706{
1707
1708#if OWL_EV_SIGNATURE_CHECK
1709
1710 template <class T> struct THandler {typedef void (T::*type)(uint key, uint repeatCount, uint flags);};
1711
1712#endif
1713
1714 template <class T, void (T::*M)(uint key, uint repeatCount, uint flags)>
1716 {
1717 struct TForwarder
1718 {
1719 T* i_;
1720 void operator ()(HWND, UINT vk, BOOL, int cRepeat, UINT flags)
1721 {(i_->*M)(vk, static_cast<uint>(cRepeat), flags);}
1722 }
1723 forwarder = {static_cast<T*>(i)};
1724 InUse(p1); InUse(p2);
1725 return HANDLE_WM_KEYUP(nullptr, p1, p2, forwarder);
1726 }
1727};
1728
1729template <> struct TDispatch<WM_KILLFOCUS>
1730{
1731
1732#if OWL_EV_SIGNATURE_CHECK
1733
1734 template <class T> struct THandler {typedef void (T::*type)(HWND);};
1735
1736#endif
1737
1738 template <class T, void (T::*M)(HWND)>
1740 {
1741 struct TForwarder
1742 {
1743 T* i_;
1745 {(i_->*M)(hwndNewFocus);}
1746 }
1747 forwarder = {static_cast<T*>(i)};
1748 InUse(p1); InUse(p2);
1749 return HANDLE_WM_KILLFOCUS(nullptr, p1, p2, forwarder);
1750 }
1751};
1752
1753template <> struct TDispatch<WM_LBUTTONDBLCLK>
1754{
1755
1756#if OWL_EV_SIGNATURE_CHECK
1757
1758 template <class T> struct THandler {typedef void (T::*type)(uint modKeys, const TPoint&);};
1759
1760#endif
1761
1762 template <class T, void (T::*M)(uint modKeys, const TPoint&)>
1764 {
1765 struct TForwarder
1766 {
1767 T* i_;
1768 void operator ()(HWND, BOOL, int x, int y, UINT modKeys)
1769 {(i_->*M)(modKeys, TPoint(x, y));}
1770 }
1771 forwarder = {static_cast<T*>(i)};
1772 InUse(p1); InUse(p2);
1773 return HANDLE_WM_LBUTTONDBLCLK(nullptr, p1, p2, forwarder);
1774 }
1775};
1776
1777template <> struct TDispatch<WM_LBUTTONDOWN>
1778{
1779
1780#if OWL_EV_SIGNATURE_CHECK
1781
1782 template <class T> struct THandler {typedef void (T::*type)(uint modKeys, const TPoint&);};
1783
1784#endif
1785
1786 template <class T, void (T::*M)(uint modKeys, const TPoint&)>
1788 {
1789 struct TForwarder
1790 {
1791 T* i_;
1792 void operator ()(HWND, BOOL, int x, int y, UINT modKeys)
1793 {(i_->*M)(modKeys, TPoint(x, y));}
1794 }
1795 forwarder = {static_cast<T*>(i)};
1796 InUse(p1); InUse(p2);
1797 return HANDLE_WM_LBUTTONDOWN(nullptr, p1, p2, forwarder);
1798 }
1799};
1800
1801template <> struct TDispatch<WM_LBUTTONUP>
1802{
1803
1804#if OWL_EV_SIGNATURE_CHECK
1805
1806 template <class T> struct THandler {typedef void (T::*type)(uint modKeys, const TPoint&);};
1807
1808#endif
1809
1810 template <class T, void (T::*M)(uint modKeys, const TPoint&)>
1812 {
1813 struct TForwarder
1814 {
1815 T* i_;
1816 void operator ()(HWND, int x, int y, UINT modKeys)
1817 {(i_->*M)(modKeys, TPoint(x, y));}
1818 }
1819 forwarder = {static_cast<T*>(i)};
1820 InUse(p1); InUse(p2);
1821 return HANDLE_WM_LBUTTONUP(nullptr, p1, p2, forwarder);
1822 }
1823};
1824
1825template <> struct TDispatch<WM_MBUTTONDBLCLK>
1826{
1827
1828#if OWL_EV_SIGNATURE_CHECK
1829
1830 template <class T> struct THandler {typedef void (T::*type)(uint modKeys, const TPoint&);};
1831
1832#endif
1833
1834 template <class T, void (T::*M)(uint modKeys, const TPoint&)>
1836 {
1837 struct TForwarder
1838 {
1839 T* i_;
1840 void operator ()(HWND, BOOL, int x, int y, UINT modKeys)
1841 {(i_->*M)(modKeys, TPoint(x, y));}
1842 }
1843 forwarder = {static_cast<T*>(i)};
1844 InUse(p1); InUse(p2);
1846 }
1847};
1848
1849template <> struct TDispatch<WM_MBUTTONDOWN>
1850{
1851
1852#if OWL_EV_SIGNATURE_CHECK
1853
1854 template <class T> struct THandler {typedef void (T::*type)(uint modKeys, const TPoint&);};
1855
1856#endif
1857
1858 template <class T, void (T::*M)(uint modKeys, const TPoint&)>
1860 {
1861 struct TForwarder
1862 {
1863 T* i_;
1864 void operator ()(HWND, BOOL, int x, int y, UINT modKeys)
1865 {(i_->*M)(modKeys, TPoint(x, y));}
1866 }
1867 forwarder = {static_cast<T*>(i)};
1868 InUse(p1); InUse(p2);
1869 return HANDLE_WM_MBUTTONDOWN(0, p1, p2, forwarder);
1870 }
1871};
1872
1873template <> struct TDispatch<WM_MBUTTONUP>
1874{
1875
1876#if OWL_EV_SIGNATURE_CHECK
1877
1878 template <class T> struct THandler {typedef void (T::*type)(uint modKeys, const TPoint&);};
1879
1880#endif
1881
1882 template <class T, void (T::*M)(uint modKeys, const TPoint&)>
1884 {
1885 struct TForwarder
1886 {
1887 T* i_;
1888 void operator ()(HWND, int x, int y, UINT modKeys)
1889 {(i_->*M)(modKeys, TPoint(x, y));}
1890 }
1891 forwarder = {static_cast<T*>(i)};
1892 InUse(p1); InUse(p2);
1893 return HANDLE_WM_MBUTTONUP(0, p1, p2, forwarder);
1894 }
1895};
1896
1897template <> struct TDispatch<WM_MDIACTIVATE>
1898{
1899
1900#if OWL_EV_SIGNATURE_CHECK
1901
1902 template <class T> struct THandler {typedef void (T::*type)(HWND activated, HWND deactivated);};
1903
1904#endif
1905
1906 template <class T, void (T::*M)(HWND activated, HWND deactivated)>
1908 {
1909 struct TForwarder
1910 {
1911 T* i_;
1913 {(i_->*M)(activated, deactivated);}
1914 }
1915 forwarder = {static_cast<T*>(i)};
1916 InUse(p1); InUse(p2);
1917 return HANDLE_WM_MDIACTIVATE(nullptr, p1, p2, forwarder);
1918 }
1919};
1920
1921template <> struct TDispatch<WM_MDICASCADE>
1922{
1923
1924#if OWL_EV_SIGNATURE_CHECK
1925
1926 template <class T> struct THandler {typedef bool (T::*type)(uint cmd);};
1927
1928#endif
1929
1930 template <class T, bool (T::*M)(uint cmd)>
1932 {
1933 struct TForwarder
1934 {
1935 T* i_;
1937 {return (i_->*M)(cmd) ? TRUE : FALSE;}
1938 }
1939 forwarder = {static_cast<T*>(i)};
1940 InUse(p1); InUse(p2);
1941 return HANDLE_WM_MDICASCADE(0, p1, p2, forwarder);
1942 }
1943};
1944
1945//
1946// HANDLE_WM_MDICREATE casts the HWND result value through UINT. Seems like a bug, so manually crack this one.
1947//
1948template <> struct TDispatch<WM_MDICREATE>
1949{
1950
1951#if OWL_EV_SIGNATURE_CHECK
1952
1953 template <class T> struct THandler {typedef HWND (T::*type)(MDICREATESTRUCT&);};
1954
1955#endif
1956
1957 template <class T, HWND (T::*M)(MDICREATESTRUCT&)>
1959 {
1961 return p2 != 0 ? reinterpret_cast<TResult>((static_cast<T*>(i)->*M)(*reinterpret_cast<LPMDICREATESTRUCT>(p2))) : 0;
1962 }
1963};
1964
1965template <> struct TDispatch<WM_MDIDESTROY>
1966{
1967
1968#if OWL_EV_SIGNATURE_CHECK
1969
1970 template <class T> struct THandler {typedef void (T::*type)(HWND);};
1971
1972#endif
1973
1974 template <class T, void (T::*M)(HWND)>
1976 {
1977 struct TForwarder
1978 {
1979 T* i_;
1981 {(i_->*M)(hwndDestroy);}
1982 }
1983 forwarder = {static_cast<T*>(i)};
1984 InUse(p1); InUse(p2);
1985 return HANDLE_WM_MDIDESTROY(nullptr, p1, p2, forwarder);
1986 }
1987};
1988
1989template <> struct TDispatch<WM_MEASUREITEM>
1990{
1991
1992#if OWL_EV_SIGNATURE_CHECK
1993
1994 template <class T> struct THandler {typedef void (T::*type)(uint, MEASUREITEMSTRUCT&);};
1995
1996#endif
1997
1998 template <class T, void (T::*M)(uint, MEASUREITEMSTRUCT&)>
2000 {
2001 struct TForwarder
2002 {
2003 T* i_;
2005 {
2006 PRECONDITION(m);
2007 if (m) (i_->*M)(m->CtlID, *m);
2008 }
2009 }
2010 forwarder = {static_cast<T*>(i)};
2011 InUse(p1); InUse(p2);
2012 return HANDLE_WM_MEASUREITEM(nullptr, p1, p2, forwarder);
2013 }
2014};
2015
2016template <> struct TDispatch<WM_MENUCHAR>
2017{
2018
2019#if OWL_EV_SIGNATURE_CHECK
2020
2021 template <class T> struct THandler {typedef int32 (T::*type)(uint, uint, HMENU);};
2022
2023#endif
2024
2025 template <class T, int32 (T::*M)(uint, uint, HMENU)>
2027 {
2028 struct TForwarder
2029 {
2030 T* i_;
2032 {return (i_->*M)(nChar, menuType, hmenu);}
2033 }
2034 forwarder = {static_cast<T*>(i)};
2035 InUse(p1); InUse(p2);
2036 return HANDLE_WM_MENUCHAR(0, p1, p2, forwarder);
2037 }
2038};
2039
2040//
2041// Note that we do not use the HANDLE_WM_MENUSELECT macro here.
2042// The handler signature demanded by the macro is incompatible with OWL 5.
2043// It also does more than just decoding the arguments; it creates new ones by calling ::GetSubMenu
2044// for popup menus, and in this case, discards information (the menu item index of the popup) on
2045// which existing code depends (e.g. hints for menu items; see TDecoratedFrame::EvMenuSelect).
2046// For these reasons we use the OWL 5 signature and perform manual decoding.
2047// See the Windows API documentation.
2048// http://msdn.microsoft.com/en-us/library/windows/desktop/ms646352.aspx
2049//
2050template <> struct TDispatch<WM_MENUSELECT>
2051{
2052 template <class F>
2053 static void Encode(F sendMessage, HWND wnd, uint item, uint flags, HMENU hMenu)
2054 {sendMessage(wnd, WM_MENUSELECT, MkParam1(item, flags), reinterpret_cast<TParam2>(hMenu));}
2055
2056
2057#if OWL_EV_SIGNATURE_CHECK
2058
2059 template <class T> struct THandler {typedef void (T::*type)(uint item, uint flags, HMENU);};
2060
2061#endif
2062
2063 template <class T, void (T::*M)(uint item, uint flags, HMENU)>
2065 {return (static_cast<T*>(i)->*M)(LOWORD(p1), HIWORD(p1), reinterpret_cast<HMENU>(p2)), 0;}
2066};
2067
2068template <> struct TDispatch<WM_MOUSEACTIVATE>
2069{
2070
2071#if OWL_EV_SIGNATURE_CHECK
2072
2073 template <class T> struct THandler {typedef uint (T::*type)(HWND topLevel, uint codeHitTest, TMsgId);};
2074
2075#endif
2076
2077 template <class T, uint (T::*M)(HWND topLevel, uint codeHitTest, TMsgId)>
2079 {
2080 struct TForwarder
2081 {
2082 T* i_;
2084 {return (i_->*M)(hwndTopLevel, codeHitTest, static_cast<TMsgId>(msg));}
2085 }
2086 forwarder = {static_cast<T*>(i)};
2087 InUse(p1); InUse(p2);
2088 return HANDLE_WM_MOUSEACTIVATE(nullptr, p1, p2, forwarder);
2089 }
2090};
2091
2092template <> struct TDispatch<WM_MOUSEHOVER>
2093{
2094
2095#if OWL_EV_SIGNATURE_CHECK
2096
2097 template <class T> struct THandler {typedef void (T::*type)(uint modKeys, const TPoint&);};
2098
2099#endif
2100
2101 template <class T, void (T::*M)(uint modKeys, const TPoint&)>
2103 {
2105 return (static_cast<T*>(i)->*M)(static_cast<uint>(p1), p), 0;
2106 }
2107};
2108
2109template <> struct TDispatch<WM_MOUSEHWHEEL>
2110{
2111
2112#if OWL_EV_SIGNATURE_CHECK
2113
2114 template <class T> struct THandler {typedef void (T::*type)(uint modKeys, int zDelta, const TPoint&);};
2115
2116#endif
2117
2118 template <class T, void (T::*M)(uint modKeys, int zDelta, const TPoint&)>
2120 {
2121 struct TForwarder
2122 {
2123 T* i_;
2124 void operator ()(HWND, int x, int y, int zDelta, UINT modKeys)
2125 {(i_->*M)(modKeys, zDelta, TPoint(x, y));}
2126 }
2127 forwarder = {static_cast<T*>(i)};
2128 InUse(p1); InUse(p2);
2129 return HANDLE_WM_MOUSEWHEEL(nullptr, p1, p2, forwarder); // There is no HANDLE_WM_MOUSEHWHEEL in Windows SDK, so reuse HANDLE_WM_MOUSEWHEEL
2130 }
2131};
2132
2133
2134template <> struct TDispatch<WM_MOUSELEAVE>
2135{
2136
2137#if OWL_EV_SIGNATURE_CHECK
2138
2139 template <class T> struct THandler {typedef void (T::*type)();};
2140
2141#endif
2142
2143 template <class T, void (T::*M)()>
2145 {return (static_cast<T*>(i)->*M)(), 0;}
2146};
2147
2148template <> struct TDispatch<WM_MOUSEMOVE>
2149{
2150
2151#if OWL_EV_SIGNATURE_CHECK
2152
2153 template <class T> struct THandler {typedef void (T::*type)(uint modKeys, const TPoint&);};
2154
2155#endif
2156
2157 template <class T, void (T::*M)(uint modKeys, const TPoint&)>
2159 {
2160 struct TForwarder
2161 {
2162 T* i_;
2163 void operator ()(HWND, int x, int y, UINT modKeys)
2164 {(i_->*M)(modKeys, TPoint(x, y));}
2165 }
2166 forwarder = {static_cast<T*>(i)};
2167 InUse(p1); InUse(p2);
2168 return HANDLE_WM_MOUSEMOVE(nullptr, p1, p2, forwarder);
2169 }
2170};
2171
2172template <> struct TDispatch<WM_MOUSEWHEEL>
2173{
2174
2175#if OWL_EV_SIGNATURE_CHECK
2176
2177 template <class T> struct THandler {typedef void (T::*type)(uint modKeys, int zDelta, const TPoint&);};
2178
2179#endif
2180
2181 template <class T, void (T::*M)(uint modKeys, int zDelta, const TPoint&)>
2183 {
2184 struct TForwarder
2185 {
2186 T* i_;
2187 void operator ()(HWND, int x, int y, int zDelta, UINT modKeys)
2188 {(i_->*M)(modKeys, zDelta, TPoint(x, y));}
2189 }
2190 forwarder = {static_cast<T*>(i)};
2191 InUse(p1); InUse(p2);
2192 return HANDLE_WM_MOUSEWHEEL(nullptr, p1, p2, forwarder);
2193 }
2194};
2195
2196template <> struct TDispatch<WM_MOVE>
2197{
2198
2199#if OWL_EV_SIGNATURE_CHECK
2200
2201 template <class T> struct THandler {typedef void (T::*type)(const TPoint&);};
2202
2203#endif
2204
2205 template <class T, void (T::*M)(const TPoint&)>
2207 {
2208 struct TForwarder
2209 {
2210 T* i_;
2211 void operator ()(HWND, int x, int y)
2212 {(i_->*M)(TPoint(x, y));}
2213 }
2214 forwarder = {static_cast<T*>(i)};
2215 InUse(p1); InUse(p2);
2216 return HANDLE_WM_MOVE(nullptr, p1, p2, forwarder);
2217 }
2218};
2219
2220//
2221// HANDLE_WM_MOVING is missing from "windowsx.h".
2222//
2223template <> struct TDispatch<WM_MOVING>
2224{
2225
2226#if OWL_EV_SIGNATURE_CHECK
2227
2228 template <class T> struct THandler {typedef void (T::*type)(TRect&);};
2229
2230#endif
2231
2232 template <class T, void (T::*M)(TRect&)>
2234 {
2235 LPRECT rect = reinterpret_cast<LPRECT>(p2);
2236 CHECK(rect);
2237 if (!rect) return FALSE; // Not processed.
2238 TRect clone(*rect);
2239 (static_cast<T*>(i)->*M)(clone);
2240 *rect = clone;
2241 return TRUE; // Processed.
2242 }
2243};
2244
2245template <> struct TDispatch<WM_NCACTIVATE>
2246{
2247
2248#if OWL_EV_SIGNATURE_CHECK
2249
2250 template <class T> struct THandler {typedef bool (T::*type)(bool);};
2251
2252#endif
2253
2254 template <class T, bool (T::*M)(bool)>
2256 {
2257 struct TForwarder
2258 {
2259 T* i_;
2261 {return (i_->*M)(fActive) ? TRUE : FALSE;}
2262 }
2263 forwarder = {static_cast<T*>(i)};
2264 InUse(p1); InUse(p2);
2265 return HANDLE_WM_NCACTIVATE(nullptr, p1, p2, forwarder);
2266 }
2267};
2268
2269template <> struct TDispatch<WM_NCCALCSIZE>
2270{
2271
2272#if OWL_EV_SIGNATURE_CHECK
2273
2274 template <class T> struct THandler {typedef uint (T::*type)(bool calcValidRects, NCCALCSIZE_PARAMS&);};
2275
2276#endif
2277
2278 template <class T, uint (T::*M)(bool calcValidRects, NCCALCSIZE_PARAMS&)>
2280 {
2281 struct TForwarder
2282 {
2283 T* i_;
2285 {
2287 return lpcsp ? (i_->*M)(fCalcValidRects, *lpcsp) : 0;
2288 }
2289 }
2290 forwarder = {static_cast<T*>(i)};
2291 InUse(p1); InUse(p2);
2292 return HANDLE_WM_NCCALCSIZE(nullptr, p1, p2, forwarder);
2293 }
2294};
2295
2296template <> struct TDispatch<WM_NCCREATE>
2297{
2298
2299#if OWL_EV_SIGNATURE_CHECK
2300
2301 template <class T> struct THandler {typedef bool (T::*type)(CREATESTRUCT&);};
2302
2303#endif
2304
2305 template <class T, bool (T::*M)(CREATESTRUCT&)>
2307 {
2308 struct TForwarder
2309 {
2310 T* i_;
2312 {
2314 return (lpCreateStruct && (i_->*M)(*lpCreateStruct)) ? TRUE : FALSE;
2315 }
2316 }
2317 forwarder = {static_cast<T*>(i)};
2318 InUse(p1); InUse(p2);
2319 return HANDLE_WM_NCCREATE(0, p1, p2, forwarder);
2320 }
2321};
2322
2323template <> struct TDispatch<WM_NCDESTROY>
2324{
2325
2326#if OWL_EV_SIGNATURE_CHECK
2327
2328 template <class T> struct THandler {typedef void (T::*type)();};
2329
2330#endif
2331
2332 template <class T, void (T::*M)()>
2334 {
2335 struct TForwarder
2336 {
2337 T* i_;
2338 void operator ()(HWND)
2339 {(i_->*M)();}
2340 }
2341 forwarder = {static_cast<T*>(i)};
2342 InUse(p1); InUse(p2);
2343 return HANDLE_WM_NCDESTROY(nullptr, p1, p2, forwarder);
2344 }
2345};
2346
2347template <> struct TDispatch<WM_NCHITTEST>
2348{
2349
2350#if OWL_EV_SIGNATURE_CHECK
2351
2352 template <class T> struct THandler {typedef uint (T::*type)(const TPoint&);};
2353
2354#endif
2355
2356 template <class T, uint (T::*M)(const TPoint&)>
2358 {
2359 struct TForwarder
2360 {
2361 T* i_;
2362 uint operator ()(HWND, int x, int y)
2363 {return (i_->*M)(TPoint(x, y));}
2364 }
2365 forwarder = {static_cast<T*>(i)};
2366 InUse(p1); InUse(p2);
2367 return HANDLE_WM_NCHITTEST(nullptr, p1, p2, forwarder);
2368 }
2369};
2370
2372{
2373
2374#if OWL_EV_SIGNATURE_CHECK
2375
2376 template <class T> struct THandler {typedef void (T::*type)(uint codeHitTest, const TPoint&);};
2377
2378#endif
2379
2380 template <class T, void (T::*M)(uint codeHitTest, const TPoint&)>
2382 {
2383 struct TForwarder
2384 {
2385 T* i_;
2386 void operator ()(HWND, BOOL, int x, int y, UINT codeHitTest)
2387 {(i_->*M)(codeHitTest, TPoint(x, y));}
2388 }
2389 forwarder = {static_cast<T*>(i)};
2390 InUse(p1); InUse(p2);
2392 }
2393};
2394
2395template <> struct TDispatch<WM_NCLBUTTONDOWN>
2396{
2397
2398#if OWL_EV_SIGNATURE_CHECK
2399
2400 template <class T> struct THandler {typedef void (T::*type)(uint codeHitTest, const TPoint&);};
2401
2402#endif
2403
2404 template <class T, void (T::*M)(uint codeHitTest, const TPoint&)>
2406 {
2407 struct TForwarder
2408 {
2409 T* i_;
2410 void operator ()(HWND, BOOL, int x, int y, UINT codeHitTest)
2411 {(i_->*M)(codeHitTest, TPoint(x, y));}
2412 }
2413 forwarder = {static_cast<T*>(i)};
2414 InUse(p1); InUse(p2);
2415 return HANDLE_WM_NCLBUTTONDOWN(nullptr, p1, p2, forwarder);
2416 }
2417};
2418
2419template <> struct TDispatch<WM_NCLBUTTONUP>
2420{
2421
2422#if OWL_EV_SIGNATURE_CHECK
2423
2424 template <class T> struct THandler {typedef void (T::*type)(uint codeHitTest, const TPoint&);};
2425
2426#endif
2427
2428 template <class T, void (T::*M)(uint codeHitTest, const TPoint&)>
2430 {
2431 struct TForwarder
2432 {
2433 T* i_;
2434 void operator ()(HWND, int x, int y, UINT codeHitTest)
2435 {(i_->*M)(codeHitTest, TPoint(x, y));}
2436 }
2437 forwarder = {static_cast<T*>(i)};
2438 InUse(p1); InUse(p2);
2439 return HANDLE_WM_NCLBUTTONUP(0, p1, p2, forwarder);
2440 }
2441};
2442
2444{
2445
2446#if OWL_EV_SIGNATURE_CHECK
2447
2448 template <class T> struct THandler {typedef void (T::*type)(uint codeHitTest, const TPoint&);};
2449
2450#endif
2451
2452 template <class T, void (T::*M)(uint codeHitTest, const TPoint&)>
2454 {
2455 struct TForwarder
2456 {
2457 T* i_;
2458 void operator ()(HWND, BOOL, int x, int y, UINT codeHitTest)
2459 {(i_->*M)(codeHitTest, TPoint(x, y));}
2460 }
2461 forwarder = {static_cast<T*>(i)};
2462 InUse(p1); InUse(p2);
2464 }
2465};
2466
2467template <> struct TDispatch<WM_NCMBUTTONDOWN>
2468{
2469
2470#if OWL_EV_SIGNATURE_CHECK
2471
2472 template <class T> struct THandler {typedef void (T::*type)(uint codeHitTest, const TPoint&);};
2473
2474#endif
2475
2476 template <class T, void (T::*M)(uint codeHitTest, const TPoint&)>
2478 {
2479 struct TForwarder
2480 {
2481 T* i_;
2482 void operator ()(HWND, BOOL, int x, int y, UINT codeHitTest)
2483 {(i_->*M)(codeHitTest, TPoint(x, y));}
2484 }
2485 forwarder = {static_cast<T*>(i)};
2486 InUse(p1); InUse(p2);
2488 }
2489};
2490
2491template <> struct TDispatch<WM_NCMBUTTONUP>
2492{
2493
2494#if OWL_EV_SIGNATURE_CHECK
2495
2496 template <class T> struct THandler {typedef void (T::*type)(uint codeHitTest, const TPoint&);};
2497
2498#endif
2499
2500 template <class T, void (T::*M)(uint codeHitTest, const TPoint&)>
2502 {
2503 struct TForwarder
2504 {
2505 T* i_;
2506 void operator ()(HWND, int x, int y, UINT codeHitTest)
2507 {(i_->*M)(codeHitTest, TPoint(x, y));}
2508 }
2509 forwarder = {static_cast<T*>(i)};
2510 InUse(p1); InUse(p2);
2511 return HANDLE_WM_NCMBUTTONUP(0, p1, p2, forwarder);
2512 }
2513};
2514
2515//
2516// HANDLE_WM_NCMOUSEHOVER is missing from "windowsx.h".
2517//
2518template <> struct TDispatch<WM_NCMOUSEHOVER>
2519{
2520
2521#if OWL_EV_SIGNATURE_CHECK
2522
2523 template <class T> struct THandler {typedef void (T::*type)(uint codeHitTest, const TPoint&);};
2524
2525#endif
2526
2527 template <class T, void (T::*M)(uint codeHitTest, const TPoint&)>
2529 {
2531 return (static_cast<T*>(i)->*M)(static_cast<uint>(p1), p), 0;
2532 }
2533};
2534
2535//
2536// HANDLE_WM_NCMOUSELEAVE is missing from "windowsx.h".
2537//
2538template <> struct TDispatch<WM_NCMOUSELEAVE>
2539{
2540
2541#if OWL_EV_SIGNATURE_CHECK
2542
2543 template <class T> struct THandler {typedef void (T::*type)();};
2544
2545#endif
2546
2547 template <class T, void (T::*M)()>
2549 {return (static_cast<T*>(i)->*M)(), 0;}
2550};
2551
2552template <> struct TDispatch<WM_NCMOUSEMOVE>
2553{
2554
2555#if OWL_EV_SIGNATURE_CHECK
2556
2557 template <class T> struct THandler {typedef void (T::*type)(uint codeHitTest, const TPoint&);};
2558
2559#endif
2560
2561 template <class T, void (T::*M)(uint codeHitTest, const TPoint&)>
2563 {
2564 struct TForwarder
2565 {
2566 T* i_;
2567 void operator ()(HWND, int x, int y, UINT codeHitTest)
2568 {(i_->*M)(codeHitTest, TPoint(x, y));}
2569 }
2570 forwarder = {static_cast<T*>(i)};
2571 InUse(p1); InUse(p2);
2572 return HANDLE_WM_NCMOUSEMOVE(0, p1, p2, forwarder);
2573 }
2574};
2575
2576template <> struct TDispatch<WM_NCPAINT>
2577{
2578
2579#if OWL_EV_SIGNATURE_CHECK
2580
2581 template <class T> struct THandler {typedef void (T::*type)(HRGN);};
2582
2583#endif
2584
2585 template <class T, void (T::*M)(HRGN)>
2587 {
2588 struct TForwarder
2589 {
2590 T* i_;
2591 void operator ()(HWND, HRGN hrgn)
2592 {(i_->*M)(hrgn);}
2593 }
2594 forwarder = {static_cast<T*>(i)};
2595 InUse(p1); InUse(p2);
2596 return HANDLE_WM_NCPAINT(nullptr, p1, p2, forwarder);
2597 }
2598};
2599
2601{
2602
2603#if OWL_EV_SIGNATURE_CHECK
2604
2605 template <class T> struct THandler {typedef void (T::*type)(uint codeHitTest, const TPoint&);};
2606
2607#endif
2608
2609 template <class T, void (T::*M)(uint codeHitTest, const TPoint&)>
2611 {
2612 struct TForwarder
2613 {
2614 T* i_;
2615 void operator ()(HWND, BOOL, int x, int y, UINT codeHitTest)
2616 {(i_->*M)(codeHitTest, TPoint(x, y));}
2617 }
2618 forwarder = {static_cast<T*>(i)};
2619 InUse(p1); InUse(p2);
2621 }
2622};
2623
2624template <> struct TDispatch<WM_NCRBUTTONDOWN>
2625{
2626
2627#if OWL_EV_SIGNATURE_CHECK
2628
2629 template <class T> struct THandler {typedef void (T::*type)(uint codeHitTest, const TPoint&);};
2630
2631#endif
2632
2633 template <class T, void (T::*M)(uint codeHitTest, const TPoint&)>
2635 {
2636 struct TForwarder
2637 {
2638 T* i_;
2639 void operator ()(HWND, BOOL, int x, int y, UINT codeHitTest)
2640 {(i_->*M)(codeHitTest, TPoint(x, y));}
2641 }
2642 forwarder = {static_cast<T*>(i)};
2643 InUse(p1); InUse(p2);
2645 }
2646};
2647
2648template <> struct TDispatch<WM_NCRBUTTONUP>
2649{
2650
2651#if OWL_EV_SIGNATURE_CHECK
2652
2653 template <class T> struct THandler {typedef void (T::*type)(uint codeHitTest, const TPoint&);};
2654
2655#endif
2656
2657 template <class T, void (T::*M)(uint codeHitTest, const TPoint&)>
2659 {
2660 struct TForwarder
2661 {
2662 T* i_;
2663 void operator ()(HWND, int x, int y, UINT codeHitTest)
2664 {(i_->*M)(codeHitTest, TPoint(x, y));}
2665 }
2666 forwarder = {static_cast<T*>(i)};
2667 InUse(p1); InUse(p2);
2668 return HANDLE_WM_NCRBUTTONUP(0, p1, p2, forwarder);
2669 }
2670};
2671
2672//
2673// Note that the OWLNext 6.32 handler signature was non-compliant (void (T::*)(uint, uint)).
2674// For this reason we do not provide a compatibility implementation here.
2675// Also, note that the HANDLE_WM_NEXTDLGCTL macro in "windowsx.h" has a bug.
2676// It specifies HWND return type for the handler, not compliant with the documentation.
2677// See the Windows API documentation for details.
2678//
2679template <> struct TDispatch<WM_NEXTDLGCTL>
2680{
2681
2682#if OWL_EV_SIGNATURE_CHECK
2683
2684 template <class T> struct THandler {typedef void (T::*type)(TParam1 handleOrDirectionFlag, bool isHandle);};
2685
2686#endif
2687
2688 template <class T, void (T::*M)(TParam1 handleOrDirectionFlag, bool isHandle)>
2690 {
2691 struct TForwarder
2692 {
2693 T* i_;
2695 {return (i_->*M)(reinterpret_cast<TParam1>(hwndSetFocus), !!fNext), 0;}
2696 }
2697 forwarder = {static_cast<T*>(i)};
2698 InUse(p1); InUse(p2);
2699 return HANDLE_WM_NEXTDLGCTL(0, p1, p2, forwarder);
2700 }
2701};
2702
2703//
2704// WM_NEXTMENU is missing from "windowsx.h".
2705// Note that the OWLNext 6.32 handler signature was non-compliant (void (T::*)()).
2706// For this reason we do not provide a compatibility implementation here.
2707// See the Windows API documentation for details.
2708//
2709template <> struct TDispatch<WM_NEXTMENU>
2710{
2711
2712#if OWL_EV_SIGNATURE_CHECK
2713
2714 template <class T> struct THandler {typedef void (T::*type)(uint key, MDINEXTMENU&);};
2715
2716#endif
2717
2718 template <class T, void (T::*M)(uint key, MDINEXTMENU&)>
2720 {
2721 uint nKey = static_cast<uint>(p1);
2722 LPMDINEXTMENU lpMdiNextMenu = reinterpret_cast<LPMDINEXTMENU>(p2);
2724 if (lpMdiNextMenu) (static_cast<T*>(i)->*M)(nKey, *lpMdiNextMenu);
2725 }
2726};
2727
2728template <> struct TDispatch<WM_PAINT>
2729{
2730
2731#if OWL_EV_SIGNATURE_CHECK
2732
2733 template <class T> struct THandler {typedef void (T::*type)();};
2734
2735#endif
2736
2737 template <class T, void (T::*M)()>
2739 {
2740 struct TForwarder
2741 {
2742 T* i_;
2743 void operator ()(HWND)
2744 {(i_->*M)();}
2745 }
2746 forwarder = {static_cast<T*>(i)};
2747 InUse(p1); InUse(p2);
2748 return HANDLE_WM_PAINT(nullptr, p1, p2, forwarder);
2749 }
2750};
2751
2752//
2753// Note that the OWLNext 6.32 handler signature was non-compliant (void (T::*)(HWND, HANDLE)).
2754// For this reason we do not provide a compatibility implementation here.
2755// See the Windows API documentation for details.
2756//
2757template <> struct TDispatch<WM_PAINTCLIPBOARD>
2758{
2759
2760#if OWL_EV_SIGNATURE_CHECK
2761
2762 template <class T> struct THandler {typedef void (T::*type)(HWND clipboardViewer, const PAINTSTRUCT&);};
2763
2764#endif
2765
2766 template <class T, void (T::*M)(HWND clipboardViewer, const PAINTSTRUCT&)>
2768 {
2769 struct TForwarder
2770 {
2771 T* i_;
2773 {
2776 }
2777 }
2778 forwarder = {static_cast<T*>(i)};
2779 InUse(p1); InUse(p2);
2781 }
2782};
2783
2784template <> struct TDispatch<WM_PALETTECHANGED>
2785{
2786
2787#if OWL_EV_SIGNATURE_CHECK
2788
2789 template <class T> struct THandler {typedef void (T::*type)(HWND paletteChange);};
2790
2791#endif
2792
2793 template <class T, void (T::*M)(HWND paletteChange)>
2795 {
2796 struct TForwarder
2797 {
2798 T* i_;
2800 {(i_->*M)(hWndPalChg);}
2801 }
2802 forwarder = {static_cast<T*>(i)};
2803 InUse(p1); InUse(p2);
2804 return HANDLE_WM_PALETTECHANGED(nullptr, p1, p2, forwarder);
2805 }
2806};
2807
2809{
2810
2811#if OWL_EV_SIGNATURE_CHECK
2812
2813 template <class T> struct THandler {typedef void (T::*type)(HWND paletteChange);};
2814
2815#endif
2816
2817 template <class T, void (T::*M)(HWND paletteChange)>
2819 {
2820 struct TForwarder
2821 {
2822 T* i_;
2824 {(i_->*M)(hwndPaletteChange);}
2825 }
2826 forwarder = {static_cast<T*>(i)};
2827 InUse(p1); InUse(p2);
2829 }
2830};
2831
2832template <> struct TDispatch<WM_PARENTNOTIFY>
2833{
2834 //
2835 /// Base class for the parameter to the WM_PARENTNOTIFY handler.
2836 //
2837 struct TArgs
2838 {
2840
2841 TArgs(UINT e) : Event(e) {}
2842 };
2843
2844 //
2845 /// Parameter package for the WM_PARENTNOTIFY handler.
2846 /// Used for events that are not mouse-related.
2847 //
2848 struct TChildInfoArgs : TArgs
2849 {
2852
2853 TChildInfoArgs(UINT e, HWND c, UINT i) : TArgs(e), Child(c), ChildID(i) {}
2854 };
2855
2856 //
2857 /// Parameter package for the WM_PARENTNOTIFY handler.
2858 /// Used for mouse-related events.
2859 //
2860 struct TMouseInfoArgs : TArgs
2861 {
2863 UINT Button; ///< Only valid for WM_XBUTTONDOWN.
2864
2865 TMouseInfoArgs(UINT e, TPoint c, UINT b) : TArgs(e), Coordinate(c), Button(b) {}
2866 };
2867
2868#if OWL_EV_SIGNATURE_CHECK
2869
2870 template <class T> struct THandler {typedef void (T::*type)(const TArgs&);};
2871
2872#endif
2873
2874 //
2875 /// The handler should static_cast the TParentNotify argument to the specific derived type, which
2876 /// depends on the event handled. For mouse-related events the dynamic type of the argument is
2877 /// TParentNotifyMouseInfo, and for other events it is TParentNotifyChildInfo.
2878 ///
2879 /// Se TFrameWindow::EvParentNotify for an example.
2880 //
2881 template <class T, void (T::*M)(const TArgs&)>
2883 {
2884 UINT event = LOWORD(p1);
2886 (static_cast<T*>(i)->*M)(TMouseInfoArgs(event, TPoint(GET_X_LPARAM(p2), GET_Y_LPARAM(p2)), HIWORD(p1)));
2887 else
2888 (static_cast<T*>(i)->*M)(TChildInfoArgs(event, reinterpret_cast<HWND>(p2), HIWORD(p1)));
2889 return 0;
2890 }
2891
2892};
2893
2894typedef TDispatch<WM_PARENTNOTIFY>::TArgs TParentNotify; ///< Alias for convenience
2897
2898template <> struct TDispatch<WM_PASTE>
2899{
2900
2901#if OWL_EV_SIGNATURE_CHECK
2902
2903 template <class T> struct THandler {typedef void (T::*type)();};
2904
2905#endif
2906
2907 template <class T, void (T::*M)()>
2909 {
2910 struct TForwarder
2911 {
2912 T* i_;
2913 void operator ()(HWND)
2914 {(i_->*M)();}
2915 }
2916 forwarder = {static_cast<T*>(i)};
2917 InUse(p1); InUse(p2);
2918 return HANDLE_WM_PASTE(0, p1, p2, forwarder);
2919 }
2920};
2921
2922#if defined(OWL5_COMPAT)
2923
2924//
2925// WM_POWER is an obsolete Win16 message. Applications should use the WM_POWERBROADCAST message.
2926// Note that HANDLE_WM_POWER uses a non-compliant signature for the handler (void (int)), which
2927// does not cater for the return value (PWR_FAIL | PWR_OK) for the event code PWR_SUSPENDREQUEST.
2928// Therefore, we crack the arguments manually here.
2929//
2930template <> struct TDispatch<WM_POWER>
2931{
2932
2933#if OWL_EV_SIGNATURE_CHECK
2934
2935 template <class T> struct THandler {typedef int (T::*type)(uint event);};
2936
2937#endif
2938
2939 template <class T, int (T::*M)(uint event)>
2940 static TResult Decode(void* i, TParam1 p1, TParam2)
2941 {return (static_cast<T*>(i)->*M)(static_cast<uint>(p1));}
2942};
2943
2944#endif
2945
2946#if defined(OWL5_COMPAT)
2947
2948//
2949// HANDLE_WM_POWERBROADCAST is missing from "windowsx.h".
2950// Note that the old handler return type (bool) is non-compliant.
2951// To compensate, we translate `true` to TRUE and `false` to BROADCAST_QUERY_DENY.
2952// See the Windows API documentation.
2953// http://msdn.microsoft.com/en-us/library/windows/desktop/aa373247.aspx
2954//
2955template <> struct TDispatch<WM_POWERBROADCAST>
2956{
2957
2958#if OWL_EV_SIGNATURE_CHECK
2959
2960 template <class T> struct THandler {typedef bool (T::*type)(uint event, TParam2);};
2961
2962#endif
2963
2964 template <class T, bool (T::*M)(uint event, TParam2)>
2965 static TResult Decode(void* i, TParam1 p1, TParam2 p2)
2966 {
2967 uint event = static_cast<uint>(p1);
2968 return (static_cast<T*>(i)->*M)(event, p2) ? TRUE : BROADCAST_QUERY_DENY;
2969 }
2970};
2971
2972#else
2973
2974//
2975// HANDLE_WM_POWERBROADCAST is missing from "windowsx.h".
2976//
2977template <> struct TDispatch<WM_POWERBROADCAST>
2978{
2979
2980#if OWL_EV_SIGNATURE_CHECK
2981
2982 template <class T> struct THandler {typedef TResult (T::*type)(uint event, TParam2);};
2983
2984#endif
2985
2986 template <class T, TResult (T::*M)(uint event, TParam2)>
2988 {
2989 uint event = static_cast<uint>(p1);
2990 return (static_cast<T*>(i)->*M)(event, p2);
2991 }
2992};
2993
2994#endif
2995
2996//
2997// HANDLE_WM_PRINT is missing from "windowsx.h".
2998//
2999template <> struct TDispatch<WM_PRINT>
3000{
3001
3002#if OWL_EV_SIGNATURE_CHECK
3003
3004 template <class T> struct THandler {typedef void (T::*type)(HDC dc, uint options);};
3005
3006#endif
3007
3008 template <class T, void (T::*M)(HDC dc, uint options)>
3010 {
3011 HDC dc = reinterpret_cast<HDC>(p1);
3012 uint options = static_cast<uint>(p2);
3013 return (static_cast<T*>(i)->*M)(dc, options), 0;
3014 }
3015};
3016
3017//
3018// HANDLE_WM_PRINTCLIENT is missing from "windowsx.h".
3019//
3020template <> struct TDispatch<WM_PRINTCLIENT>
3021{
3022
3023#if OWL_EV_SIGNATURE_CHECK
3024
3025 template <class T> struct THandler {typedef void (T::*type)(HDC dc, uint options);};
3026
3027#endif
3028
3029 template <class T, void (T::*M)(HDC dc, uint options)>
3031 {
3032 HDC dc = reinterpret_cast<HDC>(p1);
3033 uint options = static_cast<uint>(p2);
3034 return (static_cast<T*>(i)->*M)(dc, options), 0;
3035 }
3036};
3037
3038//
3039// The HANDLE_WM_QUERYDRAGICON macro in "windowsx.h" has a bug; the HICON result is cast through UINT.
3040//
3041template <> struct TDispatch<WM_QUERYDRAGICON>
3042{
3043 template <class F>
3045 {return reinterpret_cast<HICON>(sendMessage(wnd, WM_QUERYDRAGICON, 0, 0));}
3046
3047
3048#if OWL_EV_SIGNATURE_CHECK
3049
3050 template <class T> struct THandler {typedef HICON (T::*type)();};
3051
3052#endif
3053
3054 template <class T, HICON (T::*M)()>
3056 {return reinterpret_cast<TResult>((static_cast<T*>(i)->*M)());}
3057};
3058
3059//
3060// HANDLE_WM_QUERYENDSESSION does not pass the flags.
3061//
3063{
3064 template <class F>
3065 static bool Encode(F sendMessage, HWND wnd, uint flags)
3066 {return sendMessage(wnd, WM_QUERYENDSESSION, 0, static_cast<TParam2>(flags)) == TRUE;}
3067
3068
3069#if OWL_EV_SIGNATURE_CHECK
3070
3071 template <class T> struct THandler {typedef bool (T::*type)(uint flags);};
3072
3073#endif
3074
3075 template <class T, bool (T::*M)(uint flags)>
3077 {return (static_cast<T*>(i)->*M)(static_cast<uint>(p2)) ? TRUE : FALSE;}
3078};
3079
3081{
3082
3083#if OWL_EV_SIGNATURE_CHECK
3084
3085 template <class T> struct THandler {typedef bool (T::*type)();};
3086
3087#endif
3088
3089 template <class T, bool (T::*M)()>
3091 {
3092 struct TForwarder
3093 {
3094 T* i_;
3096 {return (i_->*M)() ? TRUE : FALSE;}
3097 }
3098 forwarder = {static_cast<T*>(i)};
3099 InUse(p1); InUse(p2);
3100 return HANDLE_WM_QUERYNEWPALETTE(nullptr, p1, p2, forwarder);
3101 }
3102};
3103
3104template <> struct TDispatch<WM_QUERYOPEN>
3105{
3106
3107#if OWL_EV_SIGNATURE_CHECK
3108
3109 template <class T> struct THandler {typedef bool (T::*type)();};
3110
3111#endif
3112
3113 template <class T, bool (T::*M)()>
3115 {
3116 struct TForwarder
3117 {
3118 T* i_;
3120 {return (i_->*M)() ? TRUE : FALSE;}
3121 }
3122 forwarder = {static_cast<T*>(i)};
3123 InUse(p1); InUse(p2);
3124 return HANDLE_WM_QUERYOPEN(0, p1, p2, forwarder);
3125 }
3126};
3127
3128template <> struct TDispatch<WM_QUEUESYNC>
3129{
3130
3131#if OWL_EV_SIGNATURE_CHECK
3132
3133 template <class T> struct THandler {typedef void (T::*type)();};
3134
3135#endif
3136
3137 template <class T, void (T::*M)()>
3139 {
3140 struct TForwarder
3141 {
3142 T* i_;
3143 void operator ()(HWND)
3144 {(i_->*M)();}
3145 }
3146 forwarder = {static_cast<T*>(i)};
3147 InUse(p1); InUse(p2);
3148 return HANDLE_WM_QUEUESYNC(0, p1, p2, forwarder);
3149 }
3150};
3151
3152template <> struct TDispatch<WM_RBUTTONDBLCLK>
3153{
3154
3155#if OWL_EV_SIGNATURE_CHECK
3156
3157 template <class T> struct THandler {typedef void (T::*type)(uint modKeys, const TPoint&);};
3158
3159#endif
3160
3161 template <class T, void (T::*M)(uint modKeys, const TPoint&)>
3163 {
3164 struct TForwarder
3165 {
3166 T* i_;
3167 void operator ()(HWND, BOOL, int x, int y, UINT modKeys)
3168 {(i_->*M)(modKeys, TPoint(x, y));}
3169 }
3170 forwarder = {static_cast<T*>(i)};
3171 InUse(p1); InUse(p2);
3173 }
3174};
3175
3176template <> struct TDispatch<WM_RBUTTONDOWN>
3177{
3178
3179#if OWL_EV_SIGNATURE_CHECK
3180
3181 template <class T> struct THandler {typedef void (T::*type)(uint modKeys, const TPoint&);};
3182
3183#endif
3184
3185 template <class T, void (T::*M)(uint modKeys, const TPoint&)>
3187 {
3188 struct TForwarder
3189 {
3190 T* i_;
3191 void operator ()(HWND, BOOL, int x, int y, UINT modKeys)
3192 {(i_->*M)(modKeys, TPoint(x, y));}
3193 }
3194 forwarder = {static_cast<T*>(i)};
3195 InUse(p1); InUse(p2);
3196 return HANDLE_WM_RBUTTONDOWN(nullptr, p1, p2, forwarder);
3197 }
3198};
3199
3200template <> struct TDispatch<WM_RBUTTONUP>
3201{
3202
3203#if OWL_EV_SIGNATURE_CHECK
3204
3205 template <class T> struct THandler {typedef void (T::*type)(uint modKeys, const TPoint&);};
3206
3207#endif
3208
3209 template <class T, void (T::*M)(uint modKeys, const TPoint&)>
3211 {
3212 struct TForwarder
3213 {
3214 T* i_;
3215 void operator ()(HWND, int x, int y, UINT modKeys)
3216 {(i_->*M)(modKeys, TPoint(x, y));}
3217 }
3218 forwarder = {static_cast<T*>(i)};
3219 InUse(p1); InUse(p2);
3220 return HANDLE_WM_RBUTTONUP(nullptr, p1, p2, forwarder);
3221 }
3222};
3223
3225{
3226
3227#if OWL_EV_SIGNATURE_CHECK
3228
3229 template <class T> struct THandler {typedef void (T::*type)();};
3230
3231#endif
3232
3233 template <class T, void (T::*M)()>
3235 {
3236 struct TForwarder
3237 {
3238 T* i_;
3239 void operator ()(HWND)
3240 {(i_->*M)();}
3241 }
3242 forwarder = {static_cast<T*>(i)};
3243 InUse(p1); InUse(p2);
3245 }
3246};
3247
3248//
3249// The HANDLE_WM_RENDERFORMAT macro in "windowsx.h" has a bug.
3250// It specifies HANDLE return type for the handler, not compliant with the documentation.
3251// Se the Windows API documentation for details.
3252//
3253template <> struct TDispatch<WM_RENDERFORMAT>
3254{
3255
3256#if OWL_EV_SIGNATURE_CHECK
3257
3258 template <class T> struct THandler {typedef void (T::*type)(uint format);};
3259
3260#endif
3261
3262 template <class T, void (T::*M)(uint format)>
3264 {
3265 uint format = static_cast<UINT>(p1);
3266 return (static_cast<T*>(i)->*M)(format), 0;
3267 }
3268};
3269
3270template <> struct TDispatch<WM_SETCURSOR>
3271{
3272
3273#if OWL_EV_SIGNATURE_CHECK
3274
3275 template <class T> struct THandler {typedef bool (T::*type)(HWND hWndCursor, uint codeHitTest, TMsgId mouseMsg);};
3276
3277#endif
3278
3279 template <class T, bool (T::*M)(HWND hWndCursor, uint codeHitTest, TMsgId mouseMsg)>
3281 {
3282 struct TForwarder
3283 {
3284 T* i_;
3286 {return (i_->*M)(hwndCursor, codeHitTest, static_cast<TMsgId>(msg)) ? TRUE : FALSE;}
3287 }
3288 forwarder = {static_cast<T*>(i)};
3289 InUse(p1); InUse(p2);
3290 return HANDLE_WM_SETCURSOR(nullptr, p1, p2, forwarder);
3291 }
3292};
3293
3294//
3295// HANDLE_WM_SETICON is missing from "windowsx.h".
3296//
3297template <> struct TDispatch<WM_SETICON>
3298{
3299
3300#if OWL_EV_SIGNATURE_CHECK
3301
3302 template <class T> struct THandler {typedef HICON (T::*type)(bool isBigIcon, HICON);};
3303
3304#endif
3305
3306 template <class T, HICON (T::*M)(bool isBigIcon, HICON)>
3308 {
3309 HICON r = (static_cast<T*>(i)->*M)(p1 == ICON_BIG, reinterpret_cast<HICON>(p2));
3310 return reinterpret_cast<TResult>(r);
3311 }
3312};
3313
3314template <> struct TDispatch<WM_SETFOCUS>
3315{
3316
3317#if OWL_EV_SIGNATURE_CHECK
3318
3319 template <class T> struct THandler {typedef void (T::*type)(HWND hwndLostFocus);};
3320
3321#endif
3322
3323 template <class T, void (T::*M)(HWND hwndLostFocus)>
3325 {
3326 struct TForwarder
3327 {
3328 T* i_;
3330 {(i_->*M)(hWndLostFocus);}
3331 }
3332 forwarder = {static_cast<T*>(i)};
3333 InUse(p1); InUse(p2);
3334 return HANDLE_WM_SETFOCUS(nullptr, p1, p2, forwarder);
3335 }
3336};
3337
3338template <> struct TDispatch<WM_SETFONT>
3339{
3340
3341#if OWL_EV_SIGNATURE_CHECK
3342
3343 template <class T> struct THandler {typedef void (T::*type)(HFONT, bool redraw);};
3344
3345#endif
3346
3347 template <class T, void (T::*M)(HFONT, bool redraw)>
3349 {
3350 struct TForwarder
3351 {
3352 T* i_;
3354 {(i_->*M)(hfont, fRedraw);}
3355 }
3356 forwarder = {static_cast<T*>(i)};
3357 InUse(p1); InUse(p2);
3358 return HANDLE_WM_SETFONT(nullptr, p1, p2, forwarder);
3359 }
3360};
3361
3362template <> struct TDispatch<WM_SETREDRAW>
3363{
3364
3365#if OWL_EV_SIGNATURE_CHECK
3366
3367 template <class T> struct THandler {typedef void (T::*type)(bool redraw);};
3368
3369#endif
3370
3371 template <class T, void (T::*M)(bool redraw)>
3373 {
3374 struct TForwarder
3375 {
3376 T* i_;
3378 {(i_->*M)(!!fRedraw);}
3379 }
3380 forwarder = {static_cast<T*>(i)};
3381 InUse(p1); InUse(p2);
3382 return HANDLE_WM_SETREDRAW(0, p1, p2, forwarder);
3383 }
3384};
3385
3386template <> struct TDispatch<WM_SETTEXT>
3387{
3388
3389#if OWL_EV_SIGNATURE_CHECK
3390
3391 template <class T> struct THandler {typedef void (T::*type)(LPCTSTR);};
3392
3393#endif
3394
3395 template <class T, void (T::*M)(LPCTSTR)>
3397 {
3398 struct TForwarder
3399 {
3400 T* i_;
3402 {(i_->*M)(lpszText);}
3403 }
3404 forwarder = {static_cast<T*>(i)};
3405 InUse(p1); InUse(p2);
3406 return HANDLE_WM_SETTEXT(0, p1, p2, forwarder);
3407 }
3408};
3409
3410//
3411// HANDLE_WM_SETTINGCHANGE is missing from "windowsx.h".
3412//
3413template <> struct TDispatch<WM_SETTINGCHANGE>
3414{
3415
3416#if OWL_EV_SIGNATURE_CHECK
3417
3418 template <class T> struct THandler {typedef void (T::*type)(uint flags, LPCTSTR section);};
3419
3420#endif
3421
3422 template <class T, void (T::*M)(uint flags, LPCTSTR section)>
3424 {
3425 (static_cast<T*>(i)->*M)(static_cast<uint>(p1), reinterpret_cast<LPCTSTR>(p2));
3426 return 0;
3427 }
3428};
3429
3430template <> struct TDispatch<WM_SHOWWINDOW>
3431{
3432
3433#if OWL_EV_SIGNATURE_CHECK
3434
3435 template <class T> struct THandler {typedef void (T::*type)(bool, uint status);};
3436
3437#endif
3438
3439 template <class T, void (T::*M)(bool, uint status)>
3441 {
3442 struct TForwarder
3443 {
3444 T* i_;
3445 void operator ()(HWND, BOOL fShow, UINT status)
3446 {(i_->*M)(fShow, status);}
3447 }
3448 forwarder = {static_cast<T*>(i)};
3449 InUse(p1); InUse(p2);
3450 return HANDLE_WM_SHOWWINDOW(0, p1, p2, forwarder);
3451 }
3452};
3453
3454template <> struct TDispatch<WM_SIZE>
3455{
3456
3457#if OWL_EV_SIGNATURE_CHECK
3458
3459 template <class T> struct THandler {typedef void (T::*type)(uint, const TSize&);};
3460
3461#endif
3462
3463 template <class T, void (T::*M)(uint, const TSize&)>
3465 {
3466 struct TForwarder
3467 {
3468 T* i_;
3469 void operator ()(HWND, UINT sizeType, int cx, int cy)
3470 {(i_->*M)(sizeType, TSize(cx, cy));}
3471 }
3472 forwarder = {static_cast<T*>(i)};
3473 InUse(p1); InUse(p2);
3474 return HANDLE_WM_SIZE(nullptr, p1, p2, forwarder);
3475 }
3476};
3477
3478//
3479// Note that the OWLNext 6.32 handler signature was non-compliant (void (T::*)(HWND, HANDLE)).
3480// For this reason we do not provide a compatibility implementation here.
3481// See the Windows API documentation for details.
3482//
3483template <> struct TDispatch<WM_SIZECLIPBOARD>
3484{
3485
3486#if OWL_EV_SIGNATURE_CHECK
3487
3488 template <class T> struct THandler {typedef void (T::*type)(HWND clipboardViewer, const TRect& client);};
3489
3490#endif
3491
3492 template <class T, void (T::*M)(HWND clipboardViewer, const TRect& client)>
3494 {
3495 struct TForwarder
3496 {
3497 T* i_;
3499 {
3501 if (lprc) (i_->*M)(hwndCBViewer, TRect(*lprc));
3502 }
3503 }
3504 forwarder = {static_cast<T*>(i)};
3505 InUse(p1); InUse(p2);
3507 }
3508};
3509
3510//
3511// HANDLE_WM_SIZING is missing from "windowsx.h".
3512//
3513template <> struct TDispatch<WM_SIZING>
3514{
3515 template <class F>
3517 {return static_cast<bool>(sendMessage(wnd, WM_SIZING, static_cast<TParam1>(side), reinterpret_cast<TParam2>(&r)));}
3518
3519
3520#if OWL_EV_SIGNATURE_CHECK
3521
3522 template <class T> struct THandler {typedef bool (T::*type)(uint side, TRect&);};
3523
3524#endif
3525
3526 template <class T, bool (T::*M)(uint side, TRect&)>
3528 {
3530 LPRECT r = reinterpret_cast<LPRECT>(p2);
3531 if (!r) return 0;
3532 TRect clone(*r);
3533 bool result = (static_cast<T*>(i)->*M)(static_cast<uint>(p1), clone);
3534 *r = clone;
3535 return result ? TRUE : FALSE;
3536 }
3537};
3538
3539template <> struct TDispatch<WM_SPOOLERSTATUS>
3540{
3541
3542#if OWL_EV_SIGNATURE_CHECK
3543
3544 template <class T> struct THandler {typedef void (T::*type)(uint status, int jobsLeft);};
3545
3546#endif
3547
3548 template <class T, void (T::*M)(uint status, int jobsLeft)>
3550 {
3551 struct TForwarder
3552 {
3553 T* i_;
3554 void operator ()(HWND, UINT status, int cJobInQueue)
3555 {(i_->*M)(status, cJobInQueue);}
3556 }
3557 forwarder = {static_cast<T*>(i)};
3558 InUse(p1); InUse(p2);
3560 }
3561};
3562
3563//
3564// HANDLE_WM_STYLECHANGED is missing from "windowsx.h".
3565//
3566template <> struct TDispatch<WM_STYLECHANGED>
3567{
3568
3569#if OWL_EV_SIGNATURE_CHECK
3570
3571 template <class T> struct THandler {typedef void (T::*type)(int styleType, const STYLESTRUCT& style);};
3572
3573#endif
3574
3575 template <class T, void (T::*M)(int styleType, const STYLESTRUCT& style)>
3577 {
3578 int styleType = static_cast<int>(p1);
3579 const STYLESTRUCT* lpStyleStruct = reinterpret_cast<LPSTYLESTRUCT>(p2);
3581 if (lpStyleStruct) (static_cast<T*>(i)->*M)(styleType, *lpStyleStruct);
3582 return 0;
3583 }
3584};
3585
3586//
3587// HANDLE_WM_STYLECHANGING is missing from "windowsx.h".
3588//
3589template <> struct TDispatch<WM_STYLECHANGING>
3590{
3591
3592#if OWL_EV_SIGNATURE_CHECK
3593
3594 template <class T> struct THandler {typedef void (T::*type)(int styleType, STYLESTRUCT& style);};
3595
3596#endif
3597
3598 template <class T, void (T::*M)(int styleType, STYLESTRUCT& style)>
3600 {
3601 int styleType = static_cast<int>(p1);
3602 LPSTYLESTRUCT lpStyleStruct = reinterpret_cast<LPSTYLESTRUCT>(p2);
3604 if (lpStyleStruct) (static_cast<T*>(i)->*M)(styleType, *lpStyleStruct);
3605 return 0;
3606 }
3607};
3608
3609//
3610// TODO: Remove the useless 'flags' parameter, change 'repeatCount' to int, and change the 'key' parameter to 'ch'.
3611//
3612template <> struct TDispatch<WM_SYSCHAR>
3613{
3614
3615#if OWL_EV_SIGNATURE_CHECK
3616
3617 template <class T> struct THandler {typedef void (T::*type)(uint key, uint repeatCount, uint flags);};
3618
3619#endif
3620
3621 template <class T, void (T::*M)(uint key, uint repeatCount, uint flags)>
3623 {
3624 struct TForwarder
3625 {
3626 T* i_;
3627 void operator ()(HWND, TCHAR ch, int cRepeat)
3628 {(i_->*M)(static_cast<uint>(ch), static_cast<uint>(cRepeat), 0);}
3629 }
3630 forwarder = {static_cast<T*>(i)};
3631 InUse(p1); InUse(p2);
3632 return HANDLE_WM_SYSCHAR(0, p1, p2, forwarder);
3633 }
3634};
3635
3636template <> struct TDispatch<WM_SYSCOLORCHANGE>
3637{
3638
3639#if OWL_EV_SIGNATURE_CHECK
3640
3641 template <class T> struct THandler {typedef void (T::*type)();};
3642
3643#endif
3644
3645 template <class T, void (T::*M)()>
3647 {
3648 struct TForwarder
3649 {
3650 T* i_;
3651 void operator ()(HWND)
3652 {(i_->*M)();}
3653 }
3654 forwarder = {static_cast<T*>(i)};
3655 InUse(p1); InUse(p2);
3656 return HANDLE_WM_SYSCOLORCHANGE(nullptr, p1, p2, forwarder);
3657 }
3658};
3659
3660template <> struct TDispatch<WM_SYSCOMMAND>
3661{
3662
3663#if OWL_EV_SIGNATURE_CHECK
3664
3665 template <class T> struct THandler {typedef void (T::*type)(uint cmd, const TPoint&);};
3666
3667#endif
3668
3669 template <class T, void (T::*M)(uint cmd, const TPoint&)>
3671 {
3672 struct TForwarder
3673 {
3674 T* i_;
3675 void operator ()(HWND, UINT cmd, int x, int y)
3676 {(i_->*M)(cmd, TPoint(x, y));}
3677 }
3678 forwarder = {static_cast<T*>(i)};
3679 InUse(p1); InUse(p2);
3680 return HANDLE_WM_SYSCOMMAND(nullptr, p1, p2, forwarder);
3681 }
3682};
3683
3684//
3685// TODO: Remove the useless 'flags' parameter, change 'repeatCount' to int, and change the 'key' parameter to 'ch'.
3686//
3687template <> struct TDispatch<WM_SYSDEADCHAR>
3688{
3689
3690#if OWL_EV_SIGNATURE_CHECK
3691
3692 template <class T> struct THandler {typedef void (T::*type)(uint ch, uint repeatCount, uint flags);};
3693
3694#endif
3695
3696 template <class T, void (T::*M)(uint ch, uint repeatCount, uint flags)>
3698 {
3699 struct TForwarder
3700 {
3701 T* i_;
3702 void operator ()(HWND, TCHAR ch, int cRepeat)
3703 {(i_->*M)(static_cast<uint>(ch), static_cast<uint>(cRepeat), 0);}
3704 }
3705 forwarder = {static_cast<T*>(i)};
3706 InUse(p1); InUse(p2);
3707 return HANDLE_WM_SYSDEADCHAR(0, p1, p2, forwarder);
3708 }
3709};
3710
3711template <> struct TDispatch<WM_SYSKEYDOWN>
3712{
3713
3714#if OWL_EV_SIGNATURE_CHECK
3715
3716 template <class T> struct THandler {typedef void (T::*type)(uint key, uint repeatCount, uint flags);};
3717
3718#endif
3719
3720 template <class T, void (T::*M)(uint key, uint repeatCount, uint flags)>
3722 {
3723 struct TForwarder
3724 {
3725 T* i_;
3726 void operator ()(HWND, UINT vk, BOOL, int cRepeat, UINT flags)
3727 {(i_->*M)(vk, static_cast<uint>(cRepeat), flags);}
3728 }
3729 forwarder = {static_cast<T*>(i)};
3730 InUse(p1); InUse(p2);
3731 return HANDLE_WM_SYSKEYDOWN(nullptr, p1, p2, forwarder);
3732 }
3733};
3734
3735template <> struct TDispatch<WM_SYSKEYUP>
3736{
3737
3738#if OWL_EV_SIGNATURE_CHECK
3739
3740 template <class T> struct THandler {typedef void (T::*type)(uint key, uint repeatCount, uint flags);};
3741
3742#endif
3743
3744 template <class T, void (T::*M)(uint key, uint repeatCount, uint flags)>
3746 {
3747 struct TForwarder
3748 {
3749 T* i_;
3750 void operator ()(HWND, UINT vk, BOOL, int cRepeat, UINT flags)
3751 {(i_->*M)(vk, static_cast<uint>(cRepeat), flags);}
3752 }
3753 forwarder = {static_cast<T*>(i)};
3754 InUse(p1); InUse(p2);
3755 return HANDLE_WM_SYSKEYUP(0, p1, p2, forwarder);
3756 }
3757};
3758
3759//
3760// HANDLE_WM_TCARD is missing from "windowsx.h".
3761// Note that the OWLNext 6.32 handler signature was non-compliant (void (T::*)(int, int32)).
3762// For this reason we do not provide a compatibility implementation here.
3763// See the Windows API documentation for details.
3764//
3765template <> struct TDispatch<WM_TCARD>
3766{
3767
3768#if OWL_EV_SIGNATURE_CHECK
3769
3770 template <class T> struct THandler {typedef void (T::*type)(uint idAction, ULONG_PTR data);};
3771
3772#endif
3773
3774 template <class T, void (T::*M)(uint idAction, ULONG_PTR data)>
3776 {
3777 uint idAction = static_cast<UINT>(p1);
3778 ULONG_PTR data = static_cast<ULONG_PTR>(p2);
3779 return (static_cast<T*>(i)->*M)(idAction, data), 0;
3780 }
3781};
3782
3783//
3784// HANDLE_WM_THEMECHANGED is missing from "windowsx.h".
3785//
3786template <> struct TDispatch<WM_THEMECHANGED>
3787{
3788
3789#if OWL_EV_SIGNATURE_CHECK
3790
3791 template <class T> struct THandler {typedef void (T::*type)();};
3792
3793#endif
3794
3795 template <class T, void (T::*M)()>
3797 {return (static_cast<T*>(i)->*M)(), 0;}
3798};
3799
3800template <> struct TDispatch<WM_TIMECHANGE>
3801{
3802
3803#if OWL_EV_SIGNATURE_CHECK
3804
3805 template <class T> struct THandler {typedef void (T::*type)();};
3806
3807#endif
3808
3809 template <class T, void (T::*M)()>
3811 {
3812 struct TForwarder
3813 {
3814 T* i_;
3815 void operator ()(HWND)
3816 {(i_->*M)();}
3817 }
3818 forwarder = {static_cast<T*>(i)};
3819 InUse(p1); InUse(p2);
3820 return HANDLE_WM_TIMECHANGE(0, p1, p2, forwarder);
3821 }
3822};
3823
3824template <> struct TDispatch<WM_TIMER>
3825{
3826
3827#if OWL_EV_SIGNATURE_CHECK
3828
3829 template <class T> struct THandler {typedef void (T::*type)(uint);};
3830
3831#endif
3832
3833 template <class T, void (T::*M)(uint)>
3835 {
3836 struct TForwarder
3837 {
3838 T* i_;
3839 void operator ()(HWND, UINT id)
3840 {(i_->*M)(id);}
3841 }
3842 forwarder = {static_cast<T*>(i)};
3843 InUse(p1); InUse(p2);
3844 return HANDLE_WM_TIMER(nullptr, p1, p2, forwarder);
3845 }
3846};
3847
3848template <> struct TDispatch<WM_UNDO>
3849{
3850
3851#if OWL_EV_SIGNATURE_CHECK
3852
3853 template <class T> struct THandler {typedef bool (T::*type)();};
3854
3855#endif
3856
3857 template <class T, bool (T::*M)()>
3859 {
3860 struct TForwarder
3861 {
3862 T* i_;
3864 {return (i_->*M)() ? TRUE : FALSE;}
3865 }
3866 forwarder = {static_cast<T*>(i)};
3867 InUse(p1); InUse(p2);
3868 return HANDLE_WM_UNDO(0, p1, p2, forwarder);
3869 }
3870};
3871
3872template <> struct TDispatch<WM_USERCHANGED>
3873{
3874
3875#if OWL_EV_SIGNATURE_CHECK
3876
3877 template <class T> struct THandler {typedef void (T::*type)();};
3878
3879#endif
3880
3881 template <class T, void (T::*M)()>
3883 {
3884 struct TForwarder
3885 {
3886 T* i_;
3887 void operator ()(HWND)
3888 {(i_->*M)();}
3889 }
3890 forwarder = {static_cast<T*>(i)};
3891 InUse(p1); InUse(p2);
3892 return HANDLE_WM_USERCHANGED(0, p1, p2, forwarder);
3893 }
3894};
3895
3896template <> struct TDispatch<WM_VKEYTOITEM>
3897{
3898
3899#if OWL_EV_SIGNATURE_CHECK
3900
3901 template <class T> struct THandler {typedef int (T::*type)(uint vk, HWND listBox, int caretIndex);};
3902
3903#endif
3904
3905 template <class T, int (T::*M)(uint vk, HWND listBox, int caretIndex)>
3907 {
3908 struct TForwarder
3909 {
3910 T* i_;
3912 {return (i_->*M)(vk, hwndListbox, iCaret);}
3913 }
3914 forwarder = {static_cast<T*>(i)};
3915 InUse(p1); InUse(p2);
3916 return HANDLE_WM_VKEYTOITEM(0, p1, p2, forwarder);
3917 }
3918};
3919
3920template <> struct TDispatch<WM_VSCROLL>
3921{
3922
3923#if OWL_EV_SIGNATURE_CHECK
3924
3925 template <class T> struct THandler {typedef void (T::*type)(uint scrollCode, uint pos, HWND);};
3926
3927#endif
3928
3929 template <class T, void (T::*M)(uint scrollCode, uint pos, HWND)>
3931 {
3932 struct TForwarder
3933 {
3934 T* i_;
3935 void operator ()(HWND, HWND hwndCtl, UINT code, int pos)
3936 {(i_->*M)(code, static_cast<uint>(pos), hwndCtl);}
3937 }
3938 forwarder = {static_cast<T*>(i)};
3939 InUse(p1); InUse(p2);
3940 return HANDLE_WM_VSCROLL(nullptr, p1, p2, forwarder);
3941 }
3942};
3943
3945{
3946
3947#if OWL_EV_SIGNATURE_CHECK
3948
3949 template <class T> struct THandler {typedef void (T::*type)(HWND cliboardViewer, uint scrollCode, uint pos);};
3950
3951#endif
3952
3953 template <class T, void (T::*M)(HWND cliboardViewer, uint scrollCode, uint pos)>
3955 {
3956 struct TForwarder
3957 {
3958 T* i_;
3960 {(i_->*M)(hwndCBViewer, code, static_cast<uint>(pos));}
3961 }
3962 forwarder = {static_cast<T*>(i)};
3963 InUse(p1); InUse(p2);
3965 }
3966};
3967
3969{
3970
3971#if OWL_EV_SIGNATURE_CHECK
3972
3973 template <class T> struct THandler {typedef void (T::*type)(const WINDOWPOS&);};
3974
3975#endif
3976
3977 template <class T, void (T::*M)(const WINDOWPOS&)>
3979 {
3980 struct TForwarder
3981 {
3982 T* i_;
3983 void operator ()(HWND, const LPWINDOWPOS lpwpos)
3984 {
3986 if (lpwpos) (i_->*M)(*lpwpos);
3987 }
3988 }
3989 forwarder = {static_cast<T*>(i)};
3990 InUse(p1); InUse(p2);
3991 return HANDLE_WM_WINDOWPOSCHANGED(nullptr, p1, p2, forwarder);
3992 }
3993};
3994
3996{
3997
3998#if OWL_EV_SIGNATURE_CHECK
3999
4000 template <class T> struct THandler {typedef bool (T::*type)(WINDOWPOS&);};
4001
4002#endif
4003
4004 template <class T, bool (T::*M)(WINDOWPOS&)>
4006 {
4007 struct TForwarder
4008 {
4009 T* i_;
4011 {
4013 return (lpwpos && (i_->*M)(*lpwpos)) ? TRUE : FALSE;
4014 }
4015 }
4016 forwarder = {static_cast<T*>(i)};
4017 InUse(p1); InUse(p2);
4018 return HANDLE_WM_WINDOWPOSCHANGING(nullptr, p1, p2, forwarder);
4019 }
4020};
4021
4022#if defined(OWL5_COMPAT)
4023
4024//
4025// Note: WM_WININICHANGE has been superceded by WM_SETTINGCHANGE.
4026// See the Windows API documentation for details.
4027// The new message has the same code, so we need to add a special dispatch function to provide
4028// backwards compatibility.
4029//
4030template <class T, void (T::*M)(LPCTSTR section)>
4032{
4033 struct TForwarder
4034 {
4035 T* i_;
4037 {(i_->*M)(lpszSectionName);}
4038 }
4039 forwarder = {static_cast<T*>(i)};
4040 InUse(p1); InUse(p2);
4042}
4043
4044#endif
4045
4046//-------------------------------------------------------------------------------------------------
4047// Dialog message-specific dispatchers
4048
4049template <> struct TDispatch<DM_GETDEFID>
4050{
4051
4052#if OWL_EV_SIGNATURE_CHECK
4053
4054 template <class T> struct THandler {typedef uint (T::*type)();};
4055
4056#endif
4057
4058 template <class T, uint (T::*M)()>
4060 {
4061 uint r = (static_cast<T*>(i)->*M)();
4062 return r ? static_cast<TResult>(MkUint32(r, DC_HASDEFID)) : 0; // Ensure flag is set if ID is returned.
4063 }
4064};
4065
4066template <> struct TDispatch<DM_REPOSITION>
4067{
4068
4069#if OWL_EV_SIGNATURE_CHECK
4070
4071 template <class T> struct THandler {typedef void (T::*type)();};
4072
4073#endif
4074
4075 template <class T, void (T::*M)()>
4077 {return (static_cast<T*>(i)->*M)(), 0;}
4078};
4079
4080template <> struct TDispatch<DM_SETDEFID>
4081{
4082
4083#if OWL_EV_SIGNATURE_CHECK
4084
4085 template <class T> struct THandler {typedef bool (T::*type)(int);};
4086
4087#endif
4088
4089 template <class T, bool (T::*M)(int)>
4091 {return (static_cast<T*>(i)->*M)(static_cast<int>(p1)) ? TRUE : FALSE;}
4092};
4093
4094//-------------------------------------------------------------------------------------------------
4095// OWLNext-specific messages and dispatchers
4096
4097//
4098// Messages defined for OWL use - the top of the user range of ids is reserved
4099//
4100#define WM_OWLLAST 0x7FFF
4101#define WM_OWLFIRST (WM_OWLLAST - 0x03FF)
4102
4103#define WM_COMMAND_ENABLE (WM_OWLLAST - 0)
4104#define WM_CHILDINVALID (WM_OWLLAST - 1)
4105#define WM_OWLDOCUMENT (WM_OWLLAST - 2)
4106#define WM_OWLVIEW (WM_OWLLAST - 3)
4107#define WM_OWLNOTIFY (WM_OWLLAST - 4)
4108#define WM_OWLPREPROCMENU (WM_OWLLAST - 5)
4109#define WM_OWLCANCLOSE (WM_OWLLAST - 6)
4110#define WM_VBXINITFORM (WM_OWLLAST - 7)
4111#define WM_VBXNAME (WM_OWLLAST - 8)
4112#define WM_VBXBASE (WM_OWLLAST - 8 - 256)
4113#define WM_OWLWAKEUP (WM_VBXBASE - 1)
4114#define WM_OWLFRAMESIZE (WM_VBXBASE - 2) ///< Notify children of frame resizing
4115#define WM_OWLSLIPDBLCLK (WM_VBXBASE - 3) ///< Notify parent of user dblclick of edge slip
4116#define WM_OWLWINDOWDOCKED (WM_VBXBASE - 4) ///< Notify window it was [un]docked/reparented
4117#define WM_OWLCREATETTIP (WM_VBXBASE - 5) ///< Notify gadget window to create tooltips
4118#define WM_OWLHELPHIT (WM_VBXBASE - 6) ///< Notify Help manager with hit point
4119
4120template <> struct TDispatch<WM_CHILDINVALID>
4121{
4122 template <class F>
4124 {sendMessage(wnd, WM_CHILDINVALID, reinterpret_cast<TParam1>(invalidChild), 0);}
4125
4126
4127#if OWL_EV_SIGNATURE_CHECK
4128
4129 template <class T> struct THandler {typedef void (T::*type)(HWND);};
4130
4131#endif
4132
4133 template <class T, void (T::*M)(HWND)>
4135 {return (static_cast<T*>(i)->*M)(reinterpret_cast<HWND>(p1)), 0;}
4136};
4137
4138template <> struct TDispatch<WM_COMMAND_ENABLE>
4139{
4140 template <class F>
4141 static void Encode(F sendMessage, HWND wnd, TCommandEnabler& enabler)
4142 {sendMessage(wnd, WM_COMMAND_ENABLE, 0, reinterpret_cast<TParam2>(&enabler));}
4143
4144
4145#if OWL_EV_SIGNATURE_CHECK
4146
4147 template <class T> struct THandler {typedef void (T::*type)(TCommandEnabler&);};
4148
4149#endif
4150
4151 template <class T, void (T::*M)(TCommandEnabler&)>
4153 {
4155 return p2 ? ((static_cast<T*>(i)->*M)(*reinterpret_cast<TCommandEnabler*>(p2)), 0) : 0;
4156 }
4157};
4158
4159template <> struct TDispatch<WM_OWLCANCLOSE>
4160{
4161 template <class F>
4162 static bool Encode(F sendMessage, HWND wnd)
4163 {return sendMessage(wnd, WM_OWLCANCLOSE, 0, 0) == TRUE;}
4164
4165
4166#if OWL_EV_SIGNATURE_CHECK
4167
4168 template <class T> struct THandler {typedef bool (T::*type)();};
4169
4170#endif
4171
4172 template <class T, bool (T::*M)()>
4174 {return (static_cast<T*>(i)->*M)() ? TRUE : FALSE;}
4175};
4176
4177template <> struct TDispatch<WM_OWLCREATETTIP>
4178{
4179 template <class F>
4180 static void Encode(F sendMessage, HWND wnd)
4182
4183
4184#if OWL_EV_SIGNATURE_CHECK
4185
4186 template <class T> struct THandler {typedef void (T::*type)();};
4187
4188#endif
4189
4190 template <class T, void (T::*M)()>
4192 {return (static_cast<T*>(i)->*M)(), 0;}
4193};
4194
4195template <> struct TDispatch<WM_OWLFRAMESIZE>
4196{
4197 template <class F>
4198 static void Encode(F sendMessage, HWND wnd, uint sizeType, const TSize& size)
4199 {sendMessage(wnd, WM_OWLFRAMESIZE, static_cast<TParam1>(sizeType), reinterpret_cast<TParam2>(&size));}
4200
4201
4202#if OWL_EV_SIGNATURE_CHECK
4203
4204 template <class T> struct THandler {typedef void (T::*type)(uint sizeType, const TSize&);};
4205
4206#endif
4207
4208 template <class T, void (T::*M)(uint sizeType, const TSize&)>
4210 {
4212 return p2 ? ((static_cast<T*>(i)->*M)(static_cast<uint>(p1), *reinterpret_cast<TSize*>(p2)), 0) : 0;
4213 }
4214};
4215
4216template <> struct TDispatch<WM_OWLHELPHIT>
4217{
4218 template <class F>
4219 static void Encode(F sendMessage, HWND wnd, const THelpHitInfo& i)
4220 {sendMessage(wnd, WM_OWLHELPHIT, 0, reinterpret_cast<TParam2>(&i));}
4221
4222
4223#if OWL_EV_SIGNATURE_CHECK
4224
4225 template <class T> struct THandler {typedef void (T::*type)(const THelpHitInfo&);};
4226
4227#endif
4228
4229 template <class T, void (T::*M)(const THelpHitInfo&)>
4231 {
4233 return p2 ? ((static_cast<T*>(i)->*M)(*reinterpret_cast<THelpHitInfo*>(p2)), 0) : 0;
4234 }
4235};
4236
4237template <> struct TDispatch<WM_OWLPREPROCMENU>
4238{
4239 template <class F>
4240 static void Encode(F sendMessage, HWND wnd, HMENU menu)
4241 {sendMessage(wnd, WM_OWLPREPROCMENU, reinterpret_cast<TParam1>(menu), 0);}
4242
4243
4244#if OWL_EV_SIGNATURE_CHECK
4245
4246 template <class T> struct THandler {typedef void (T::*type)(HMENU);};
4247
4248#endif
4249
4250 template <class T, void (T::*M)(HMENU)>
4252 {return (static_cast<T*>(i)->*M)(reinterpret_cast<HMENU>(p1)), 0;}
4253};
4254
4255template <> struct TDispatch<WM_OWLWAKEUP>
4256{
4257 template <class F>
4258 static void Encode(F sendMessage, HWND wnd)
4259 {sendMessage(wnd, WM_OWLWAKEUP, 0, 0);}
4260
4261
4262#if OWL_EV_SIGNATURE_CHECK
4263
4264 template <class T> struct THandler {typedef void (T::*type)();};
4265
4266#endif
4267
4268 template <class T, void (T::*M)()>
4270 {return (static_cast<T*>(i)->*M)(), 0;}
4271};
4272
4274{
4275 template <class F>
4276 static void Encode(F sendMessage, HWND wnd, uint pos, const TDockingSlip& d)
4277 {sendMessage(wnd, WM_OWLWINDOWDOCKED, static_cast<TParam1>(pos), reinterpret_cast<TParam2>(&d));}
4278
4279
4280#if OWL_EV_SIGNATURE_CHECK
4281
4282 template <class T> struct THandler {typedef void (T::*type)(uint pos, const TDockingSlip&);};
4283
4284#endif
4285
4286 template <class T, void (T::*M)(uint pos, const TDockingSlip&)>
4288 {
4290 return p2 ? ((static_cast<T*>(i)->*M)(static_cast<uint>(p1), *reinterpret_cast<const TDockingSlip*>(p2)), 0) : 0;
4291 }
4292};
4293
4294} // OWL namespace
4295
4297
4298#endif
#define CHECK(condition)
Definition checks.h:239
#define PRECONDITION(condition)
Definition checks.h:227
Base class for an extensible interface for auto enabling/disabling of commands (menu items,...
Definition window.h:209
TDockingSlip is an abstract base class for windows which accepts and holds dockable windows.
Definition docking.h:154
TDropInfo is a simple class that supports file-name drag-and-drop operations using the WM_DROPFILES m...
Definition wsyscls.h:257
TPoint is a support class, derived from tagPOINT.
Definition geometry.h:87
TRect is a mathematical class derived from tagRect.
Definition geometry.h:308
The tagSIZE struct is defined as.
Definition geometry.h:234
#define WM_OWLWINDOWDOCKED
Notify window it was [un]docked/reparented.
Definition dispatch.h:4116
#define WM_OWLWAKEUP
Definition dispatch.h:4113
#define WM_OWLFRAMESIZE
Notify children of frame resizing.
Definition dispatch.h:4114
#define WM_OWLCANCLOSE
Definition dispatch.h:4109
#define WM_COMMAND_ENABLE
Definition dispatch.h:4103
#define WM_OWLHELPHIT
Notify Help manager with hit point.
Definition dispatch.h:4118
#define WM_CHILDINVALID
Definition dispatch.h:4104
#define WM_OWLCREATETTIP
Notify gadget window to create tooltips.
Definition dispatch.h:4117
#define WM_OWLPREPROCMENU
Definition dispatch.h:4108
#define WM_SIZING
Definition docking.cpp:36
#define WM_SETICON
Definition framewin.cpp:26
Classes for window system geometry.
class _ICLASS TDispatch
Definition autodefs.h:956
Object Windows Library (OWLNext Core)
Definition animctrl.h:22
UINT TMsgId
Message ID type.
Definition dispatch.h:53
TResult DispatchChildNotifyWithCode(void *i, TParam1 p1, TParam2)
Definition dispatch.h:217
void(TGeneric::* TAnyPMF)()
Definition dispatch.h:108
uint32 MkUint32(uint16 lo, uint16 hi)
Definition defs.h:261
unsigned long uint32
Definition number.h:34
TDispatch< WM_PARENTNOTIFY >::TMouseInfoArgs TParentNotifyMouseInfo
Alias for convenience.
Definition dispatch.h:2896
void InUse(const T &arg)
Handy utility to avoid compiler warnings about unused parameters.
Definition defs.h:299
LPARAM TParam2
Second parameter type.
Definition dispatch.h:55
WPARAM TParam1
First parameter type.
Definition dispatch.h:54
TDispatch< WM_PARENTNOTIFY >::TArgs TParentNotify
Alias for convenience.
Definition dispatch.h:2894
TParam2 MkParam2(const T1 &lo, const T2 &hi)
Definition dispatch.h:65
TResult DispatchRawArguments(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:209
TResult DispatchCommand(void *i, TParam1, TParam2)
Definition dispatch.h:221
TParam1 MkParam1(uint lo, uint hi)
Definition dispatch.h:68
LRESULT TResult
Result type.
Definition dispatch.h:52
unsigned short uint16
Definition number.h:33
unsigned int uint
Definition number.h:25
TDispatch< WM_PARENTNOTIFY >::TChildInfoArgs TParentNotifyChildInfo
Alias for convenience.
Definition dispatch.h:2895
TResult AnyDispatch(TGeneric &obj, TAnyPMF, TParam1 p1, TParam2 p2)
Definition dispatch.h:128
TResult DispatchCommandWithId(void *i, TParam1 p1, TParam2)
Definition dispatch.h:225
TResult DispatchChildNotify(void *i, TParam1, TParam2)
Definition dispatch.h:213
General definitions used by all ObjectWindows programs.
#define OWL_DISABLE_WARNING_POP
Definition defs.h:156
#define _OWLFUNC(p)
Definition defs.h:341
#define _OWLCLASS
Definition defs.h:338
#define OWL_DISABLE_WARNING_ZERO_AS_NULL_POINTER
Definition defs.h:160
#define OWL_DISABLE_WARNING_PUSH
Definition defs.h:155
static TResult Decode(void *i, TParam1, TParam2)
Definition dispatch.h:4059
static TResult Decode(void *i, TParam1, TParam2)
Definition dispatch.h:4076
static TResult Decode(void *i, TParam1 p1, TParam2)
Definition dispatch.h:4090
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:270
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:294
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:318
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:342
static TResult Decode(void *i, TParam1, TParam2 p2)
Definition dispatch.h:369
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:383
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:410
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:434
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:458
static void Encode(F sendMessage, HWND wnd, HWND invalidChild)
Definition dispatch.h:4123
static TResult Decode(void *i, TParam1 p1, TParam2)
Definition dispatch.h:4134
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:482
static TResult Decode(void *i, TParam1, TParam2 p2)
Definition dispatch.h:4152
static void Encode(F sendMessage, HWND wnd, TCommandEnabler &enabler)
Definition dispatch.h:4141
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:506
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:530
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:560
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:588
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:605
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:632
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:680
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:656
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:704
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:761
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:785
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:809
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:836
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:860
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:887
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:911
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:945
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:959
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:983
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:1007
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:1031
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:1058
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:1082
static void Encode(F sendMessage, HWND wnd, bool endSession, uint flags)
Definition dispatch.h:1102
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:1113
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:1127
static TResult Decode(void *i, TParam1 p1, TParam2)
Definition dispatch.h:1154
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:1168
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:1192
static TResult Decode(void *i, TParam1 p1, TParam2)
Definition dispatch.h:1219
static TResult Decode(void *i, TParam1, TParam2)
Definition dispatch.h:1236
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:1250
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:1274
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:1298
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:1322
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:1346
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:1398
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:1455
static void Encode(F sendMessage, HWND wnd, const HELPINFO &i)
Definition dispatch.h:1477
static TResult Decode(void *i, TParam1, TParam2 p2)
Definition dispatch.h:1490
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:1535
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:1561
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:1585
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:1609
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:1633
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:1660
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:1677
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:1691
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:1715
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:1739
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:1763
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:1787
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:1811
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:1835
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:1859
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:1883
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:1907
static TResult Decode(T *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:1931
static TResult Decode(void *i, TParam1, TParam2 p2)
Definition dispatch.h:1958
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:1975
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:1999
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:2026
static void Encode(F sendMessage, HWND wnd, uint item, uint flags, HMENU hMenu)
Definition dispatch.h:2053
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:2064
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:2078
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:2102
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:2119
static TResult Decode(void *i, TParam1, TParam2)
Definition dispatch.h:2144
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:2158
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:2182
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:2206
static TResult Decode(void *i, TParam1, TParam2 p2)
Definition dispatch.h:2233
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:2255
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:2279
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:2306
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:2333
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:2357
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:2381
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:2405
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:2429
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:2453
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:2477
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:2501
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:2528
static TResult Decode(void *i, TParam1, TParam2)
Definition dispatch.h:2548
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:2562
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:2586
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:2610
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:2634
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:2658
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:2689
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:2719
static bool Encode(F sendMessage, HWND wnd)
Definition dispatch.h:4162
static TResult Decode(void *i, TParam1, TParam2)
Definition dispatch.h:4173
static TResult Decode(void *i, TParam1, TParam2)
Definition dispatch.h:4191
static void Encode(F sendMessage, HWND wnd)
Definition dispatch.h:4180
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:4209
static void Encode(F sendMessage, HWND wnd, uint sizeType, const TSize &size)
Definition dispatch.h:4198
static TResult Decode(void *i, TParam1, TParam2 p2)
Definition dispatch.h:4230
static void Encode(F sendMessage, HWND wnd, const THelpHitInfo &i)
Definition dispatch.h:4219
static void Encode(F sendMessage, HWND wnd, HMENU menu)
Definition dispatch.h:4240
static TResult Decode(void *i, TParam1 p1, TParam2)
Definition dispatch.h:4251
static TResult Decode(void *i, TParam1, TParam2)
Definition dispatch.h:4269
static void Encode(F sendMessage, HWND wnd)
Definition dispatch.h:4258
static void Encode(F sendMessage, HWND wnd, uint pos, const TDockingSlip &d)
Definition dispatch.h:4276
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:4287
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:2738
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:2767
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:2794
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:2818
UINT Button
Only valid for WM_XBUTTONDOWN.
Definition dispatch.h:2863
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
The handler should static_cast the TParentNotify argument to the specific derived type,...
Definition dispatch.h:2882
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:2908
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:2987
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:3009
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:3030
static TResult Decode(void *i, TParam1, TParam2)
Definition dispatch.h:3055
static HICON Encode(F sendMessage, HWND wnd)
Definition dispatch.h:3044
static bool Encode(F sendMessage, HWND wnd, uint flags)
Definition dispatch.h:3065
static TResult Decode(void *i, TParam1, TParam2 p2)
Definition dispatch.h:3076
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:3090
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:3114
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:3138
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:3162
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:3186
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:3210
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:3234
static TResult Decode(void *i, TParam1 p1, TParam2)
Definition dispatch.h:3263
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:3280
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:3324
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:3348
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:3307
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:3372
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:3396
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:3423
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:3440
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:3464
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:3493
static bool Encode(F sendMessage, HWND wnd, uint side, TRect &r)
Definition dispatch.h:3516
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:3527
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:3549
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:3576
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:3599
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:3622
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:3646
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:3670
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:3697
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:3721
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:3745
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:3775
static TResult Decode(void *i, TParam1, TParam2)
Definition dispatch.h:3796
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:3810
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:3834
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:3858
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:3882
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:3906
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:3930
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:3954
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:3978
static TResult Decode(void *i, TParam1 p1, TParam2 p2)
Definition dispatch.h:4005
Undefined default template for dispatchers Template specialization is used to allow the compiler to l...
Definition dispatch.h:258
Classes for window system structure and type encapsulation.