TNB Library
TnbMultiMouseManager.h
[詳解]
1#pragma once
11#include "TnbDummyWindow.h"
12#include "TnbPointerVector.h"
13#include "TnbBitmapImage.h"
14#include <math.h>
15
16
17
18//TNB Library
19namespace TNB
20{
21
22
23
37{
38public:
39
48 struct IListener
49 {
51 virtual ~IListener(void) {}
52
55 {
59 };
60
66 virtual void OnMultiMouseDevice(INDEX index, EDevice device) = 0;
67
73 virtual void OnMultiMouseEvent(INDEX index, const RAWMOUSE& mouse) = 0;
74 };
75
76
77 //--------------------------------
78
79
84 virtual void SetListener(IListener* P) = NULL;
85
90 virtual size_t GetMouseCount(void) const = NULL;
91
97 virtual bool Start(void) = NULL;
98
102 virtual void Stop(void) = NULL;
103};
104
105
106
161{
162public:
163
174 {
176 virtual ~IListener(void) {}
177
180 {
184 };
185
188 {
191 };
192
201 virtual void OnMultiMouseButton(INDEX index, EButton button, EEvent event, int x, int y) = 0;
202
210 virtual void OnMultiMouseMove(INDEX index, BYTE buttonFlags, int x, int y) = 0;
211
217 virtual void OnMultiMouseWheel(INDEX index, int d) = 0;
218
224 virtual void OnMultiMouseEvent(INDEX index, const RAWMOUSE& mouse) { }
225
226 #ifdef _TnbDOXYGEN //Document作成用シンボル
227
230 {
234 };
235
241 virtual void OnMultiMouseDevice(INDEX index, EDevice device) = 0;
242
243 #endif
244
251 static DWORD MakeMouseEventFlags(EButton button, EEvent event)
252 {
253 if ( event == Event_Down )
254 {
255 switch ( button )
256 {
257 case Button_Left: return MOUSEEVENTF_LEFTDOWN;
258 case Button_Right: return MOUSEEVENTF_RIGHTDOWN;
259 case Button_Middle: return MOUSEEVENTF_MIDDLEDOWN;
260 }
261 }
262 else if ( event == Event_Up )
263 {
264 switch ( button )
265 {
266 case Button_Left: return MOUSEEVENTF_LEFTUP;
267 case Button_Right: return MOUSEEVENTF_RIGHTUP;
268 case Button_Middle: return MOUSEEVENTF_MIDDLEUP;
269 }
270 }
271 return 0;
272 }
273 };
274
275
276 //-----------------------------------
277
278
280 CMultiMouseManager(void) : m_pWatcher(NULL)
281 {
282 ::SetRectEmpty(&m_in.m_corsorRect);
283 }
284
290 {
291 EXCLUSIVE( &m_in.m_sync );
292 m_in.m_pListener = P;
293 }
294
302 bool Start(IMultiMouseWatcher* pWatcher, HWND hParent = NULL)
303 {
304 EXCLUSIVE( &m_in.m_sync );
305 Stop();
306 m_pWatcher = pWatcher;
307 m_pWatcher->SetListener(&m_in);
308 if ( ! m_in.m_cursorImage.IsNull() )
309 {
310 m_in.m_hParent = hParent;
311 if ( m_pWatcher->Start() )
312 {
313 size_t len = m_pWatcher->GetMouseCount();
314 m_in.m_cursores.SetSize(len);
315 loop ( i, len )
316 {
317 if ( ! m_in.CheckIndex(i) )
318 {
319 return false;
320 }
321 }
322 return true;
323 }
324 Stop();
325 }
326 return false;
327 }
328
333 void Stop(void)
334 {
335 EXCLUSIVE( &m_in.m_sync );
336 if ( m_pWatcher != NULL )
337 {
338 m_pWatcher->Stop();
339 m_in.m_cursores.RemoveAll();
340 m_pWatcher = NULL;
341 }
342 }
343
353 bool SetDefaultCursorImage(int hotspotX, int hotspotY, CBitmapHandle bmp, COLORREF color = CLR_AUTOSELECT)
354 {
355 EXCLUSIVE( &m_in.m_sync );
356 m_in.m_cursorImage = bmp;
357 m_in.m_cursorMaskColor = color;
358 m_in.m_cursorHotspot.x = hotspotX;
359 m_in.m_cursorHotspot.y = hotspotY;
360 return ! m_in.m_cursorImage.IsNull();
361 }
362
371 bool SetDefaultCursorImage(CBitmapHandle bmp, COLORREF color = CLR_AUTOSELECT)
372 {
373 return SetDefaultCursorImage(0, 0, bmp, color);
374 }
375
384 bool SetDefaultCursorImage(HCURSOR hCursor, COLORREF color = RGB(255, 0, 255))
385 {
386 EXCLUSIVE( &m_in.m_sync );
387 CBitmapHandle bmp;
388 POINT hotspot;
389 if ( m_IconToBitmap(bmp, hotspot, hCursor, color) )
390 {
391 m_in.m_cursorImage = bmp;
392 m_in.m_cursorMaskColor = color;
393 m_in.m_cursorHotspot = hotspot;
394 return ! m_in.m_cursorImage.IsNull();
395 }
396 return false;
397 }
398
404 size_t GetMouseCount(void) const
405 {
406 EXCLUSIVE( &m_in.m_sync );
407 return m_in.m_cursores.GetSize();
408 }
409
416 bool IsValid(INDEX index) const
417 {
418 EXCLUSIVE( &m_in.m_sync );
419 return (m_RefCursorManager(index) != NULL);
420 }
421
432 bool SetCursorImage(INDEX index, int hotspotX, int hotspotY, CBitmapHandle bmp, COLORREF color = CLR_AUTOSELECT)
433 {
434 EXCLUSIVE( &m_in.m_sync );
435 CCursorManager* P = m_GetCursorManager(index);
436 if ( P != NULL )
437 {
438 POINT po = { hotspotX, hotspotY };
439 return P->SetImage(bmp, color, po);
440 }
441 return false;
442 }
443
452 bool SetCursorImage(INDEX index, CBitmapHandle bmp, COLORREF color = CLR_AUTOSELECT)
453 {
454 return SetCursorImage(index, 0, 0, bmp, color);
455 }
456
466 bool SetCursorImage(INDEX index, HCURSOR hCursor, COLORREF color = RGB(255, 0, 255))
467 {
468 EXCLUSIVE( &m_in.m_sync );
469 CCursorManager* P = m_GetCursorManager(index);
470 if ( P != NULL )
471 {
472 CBitmapHandle bmp;
473 POINT hotspot;
474 if ( m_IconToBitmap(bmp, hotspot, hCursor, color) )
475 {
476 return P->SetImage(bmp, color, hotspot);
477 }
478 }
479 return false;
480 }
481
489 bool ShowCursor(INDEX index, bool isShow)
490 {
491 EXCLUSIVE( &m_in.m_sync );
492 CCursorManager* P = m_GetCursorManager(index);
493 if ( P != NULL )
494 {
495 P->Show(isShow);
496 return true;
497 }
498 return false;
499 }
500
508 bool ClipCursor(INDEX index, const RECT& rect)
509 {
510 EXCLUSIVE( &m_in.m_sync );
511 CCursorManager* P = m_GetCursorManager(index);
512 if ( P != NULL )
513 {
514 P->Clip(rect);
515 return true;
516 }
517 return false;
518 }
519
528 bool SetCursorPos(INDEX index, int x, int y)
529 {
530 EXCLUSIVE( &m_in.m_sync );
531 CCursorManager* P = m_GetCursorManager(index);
532 if ( P != NULL )
533 {
534 return P->SetPos(x, y);
535 }
536 return false;
537 }
538
545 POINT GetCursorPos(INDEX index) const
546 {
547 EXCLUSIVE( &m_in.m_sync );
548 const CCursorManager* P = m_RefCursorManager(index);
549 if ( P != NULL )
550 {
551 return P->GetPos();
552 }
553 POINT po = { 0, 0 };
554 return po;
555 }
556
563 BYTE GetButtonState(INDEX index) const
564 {
565 EXCLUSIVE( &m_in.m_sync );
566 const CCursorManager* P = m_RefCursorManager(index);
567 if ( P != NULL )
568 {
569 return P->GetButtonState();
570 }
571 return 0;
572 }
573
574private:
575
580 class CCursorWindow : public CDummyWindow::IListener
581 {
582 public:
584 CCursorWindow(void) : m_rgn(NULL), m_isChild(false)
585 {
586 }
588 ~CCursorWindow(void)
589 {
590 m_DeleteRgn();
591 }
593 bool HasCursorImage(void) const
594 {
595 return ! m_image.IsEmpty();
596 }
601 bool Create(HWND hParent)
602 {
603 if ( HasCursorImage() )
604 {
605 m_isChild = false;
606 DWORD style = WS_POPUP;
607 HWND hWnd = HWND_TOPMOST;
608 if ( hParent != NULL )
609 {
610 style = WS_CHILD;
611 hWnd = HWND_TOP;
612 m_isChild = true;
613 }
614 HWND hFocus = ::GetFocus();
615 CStr className = "TNBLIB:MultiMouseMan_";
616 if ( m_win.Create(this, NULL, className, style, NULL, hParent) )
617 {
618 m_win.ModifyStyleEx(0, WS_EX_TOOLWINDOW | WS_EX_NOACTIVATE | WS_EX_TOPMOST);
619 if ( ! m_isChild )
620 {
621 m_win.ModifyStyleEx(0, WS_EX_LAYERED);
622 ::SetLayeredWindowAttributes(m_win, RGB(0, 0, 0), 0, 0);
623 }
624 ::SetFocus(hFocus);
625 const SIZE& sz = m_image.GetSize();
626 ::SetWindowPos(m_win, hWnd, 0, 0, sz.cx, sz.cy, SWP_NOMOVE | SWP_NOACTIVATE | SWP_ASYNCWINDOWPOS);
627 HRGN rgn = ::CreateRectRgn(0, 0, 0, 0);
628 ::CombineRgn(rgn, m_rgn, NULL, RGN_COPY);
629 ::SetWindowRgn(m_win, rgn, TRUE);
630 Move(0, 0);
631 return true;
632 }
633 ::SetFocus(hFocus);
634 }
635 return false;
636 }
638 void Move(int x, int y)
639 {
640 if ( ::IsWindow(m_win) )
641 {
642 HWND hWnd = HWND_TOPMOST;
643 UINT flags = SWP_NOSIZE | SWP_NOACTIVATE | SWP_ASYNCWINDOWPOS;
644 if ( m_isChild )
645 {
646 hWnd = NULL;
647 flags |= SWP_NOZORDER;
648 }
649 ::SetWindowPos(m_win, hWnd, x - m_hotspot.x, y - m_hotspot.y, 0, 0, flags);
650 }
651 }
653 bool SetImage(CBitmapHandle bmp, COLORREF color, const POINT& hotspot)
654 {
655 if ( m_image.Set(bmp) )
656 {
657 m_DeleteRgn();
658 m_rgn = m_image.CreateRgn(color);
659 m_hotspot = hotspot;
660 if ( ::IsWindow(m_win) )
661 {
662 const SIZE& sz = m_image.GetSize();
663 ::SetWindowPos(m_win, NULL, 0, 0, sz.cx, sz.cy, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_ASYNCWINDOWPOS);
664 HRGN rgn = ::CreateRectRgn(0, 0, 0, 0);
665 ::CombineRgn(rgn, m_rgn, NULL, RGN_COPY);
666 ::SetWindowRgn(m_win, rgn, TRUE);
667 ::InvalidateRgn(m_win, m_rgn, TRUE);
668 }
669 return true;
670 }
671 return false;
672 }
673
674 void Show(bool isShow)
675 {
676 ::ShowWindow(m_win, isShow ? SW_SHOW : SW_HIDE);
677 }
678
679 protected:
680 virtual bool OnWindowMessage(LRESULT& _result, HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
681 {
682 if ( message == WM_SETFOCUS )
683 {
684 ::SetFocus(reinterpret_cast<HWND>(wParam));
685 return true;
686 }
687 else if ( message == WM_PAINT )
688 {
689 PAINTSTRUCT ps;
690 HDC dc = ::BeginPaint(hWnd, &ps);
691 ::SelectClipRgn(dc, m_rgn);
692 m_image.Draw(dc, 0, 0);
693 ::EndPaint(hWnd, &ps);
694 return true;
695 }
696 else if ( message == WM_DESTROY )
697 {
698 m_DeleteRgn();
699 }
700 return false;
701 }
702 private:
703 void m_DeleteRgn(void)
704 {
705 if ( m_rgn != NULL )
706 {
707 _DeleteObject(m_rgn);
708 m_rgn = NULL;
709 }
710 }
711 CBitmapImage m_image;
712 HRGN m_rgn;
713 POINT m_hotspot;
714 CDummyWindow m_win;
715 bool m_isChild;
716 };
717
722 class CCursorManager
723 {
724 public:
726 CCursorManager(void) : m_button(0), m_hRgn(NULL)
727 {
728 Zero(m_pos);
729 }
731 bool Create(HWND hParent, CBitmapHandle bmp, COLORREF color, const POINT& hotspot)
732 {
733 m_button = 0;
734 Zero(m_pos);
735 if ( m_win.SetImage(bmp, color, hotspot) )
736 {
737 RECT rc = { 0 };
738 if ( hParent != NULL )
739 {
740 // 親ウィンドウ指定有り
741 ::GetClientRect(hParent, &rc);
742 Clip(rc);
743 }
744 else
745 {
746 // デスクトップ
747 Clip(rc);
748 ::EnumDisplayMonitors(NULL, NULL, ms_MonitorEnumProc, reinterpret_cast<LPARAM>(this));
749 }
750 return m_win.Create(hParent);
751 }
752 return false;
753 }
755 bool SetImage(CBitmapHandle bmp, COLORREF color, const POINT& hotspot)
756 {
757 return m_win.SetImage(bmp, color, hotspot);
758 }
760 void Show(bool isShow)
761 {
762 m_win.Show(isShow);
763 }
765 void Clip(const RECT& rect)
766 {
767 if ( m_hRgn != NULL )
768 {
769 _DeleteObject(m_hRgn);
770 }
771 m_hRgn = ::CreateRectRgnIndirect(&rect);
772 }
774 bool SetPos(int x, int y)
775 {
776 if ( m_hRgn != NULL && ! ::PtInRegion(m_hRgn, x, y) )
777 {
778 // 入っていない
779 bool r = false;
780 if ( ::PtInRegion(m_hRgn, m_pos.x, y) )
781 {
782 // X移動しなければ入る
783 int f = (m_pos.x > x) ? 1 : -1;
784 loop ( i, abs(m_pos.x - x) )
785 {
786 x += f;
787 if ( ::PtInRegion(m_hRgn, x, y) )
788 {
789 r = true;
790 break;
791 }
792 }
793 }
794 else if ( ::PtInRegion(m_hRgn, x, m_pos.y) )
795 {
796 // Y移動しなければ入る
797 int f = (m_pos.y > y) ? 1 : -1;
798 loop ( i, abs(m_pos.y - y) )
799 {
800 y += f;
801 if ( ::PtInRegion(m_hRgn, x, y) )
802 {
803 r = true;
804 break;
805 }
806 }
807 }
808 else
809 {
810 // Y移動に移動
811 int f = (m_pos.y > y) ? 1 : -1;
812 loop ( i, abs(m_pos.y - y) )
813 {
814 y += f;
815 if ( ::PtInRegion(m_hRgn, m_pos.x, y) )
816 {
817 break;
818 }
819 }
820 // X移動に移動
821 f = (m_pos.x > x) ? 1 : -1;
822 loop ( i, abs(m_pos.x - x) )
823 {
824 x += f;
825 if ( ::PtInRegion(m_hRgn, x, y) )
826 {
827 r = true;
828 break;
829 }
830 }
831 }
832 if ( ! r )
833 {
834 return false;
835 }
836 }
837 if ( m_pos.x != x || m_pos.y != y )
838 {
839 m_pos.x = x;
840 m_pos.y = y;
841 m_win.Move(m_pos.x, m_pos.y);
842 return true;
843 }
844 return false;
845 }
847 bool MovePos(int dx, int dy)
848 {
849 return SetPos(m_pos.x + dx, m_pos.y + dy);
850 }
852 const POINT& GetPos(void) const
853 {
854 return m_pos;
855 }
857 BYTE GetButtonState(void) const
858 {
859 return m_button;
860 }
862 void SetButtonFlags(WORD buttonFlags)
863 {
864 loop ( i, 3/*ボタン数*/ * 2 )
865 {
866 if ( (buttonFlags & _BIT(i)) != 0 )
867 {
868 if ( (i & 1) == 0 )
869 {
870 m_button |= _BIT(i / 2);
871 }
872 else
873 {
874 m_button &= ~_BIT(i / 2);
875 }
876 }
877 }
878 }
879
880 private:
882 static BOOL CALLBACK ms_MonitorEnumProc(
883 HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData)
884 {
885 CCursorManager* P = reinterpret_cast<CCursorManager*>(dwData);
886 HRGN& r1 = P->m_hRgn;
887 HRGN r2 = ::CreateRectRgnIndirect(lprcMonitor);
888 VERIFY( ::CombineRgn(r1, r1, r2, RGN_OR) != ERROR );
889 _DeleteObject(r2);
890 return TRUE;
891 }
892 CCursorWindow m_win;
893 POINT m_pos;
894 HRGN m_hRgn;
895 BYTE m_button;
896 };
897
899 class CInner : public IMultiMouseWatcher::IListener
900 {
901 DEFPARENTLISTENER(CMultiMouseManager, IParentListener);
902 public:
904 CInner(void) : m_pListener(NULL)
905 {
906 CBitmapImage bi;
907 bi.Set(1, 1);
908 m_cursorImage = bi;
909 }
911 bool CheckIndex(INDEX index)
912 {
913 if ( ! m_cursores.IsInRange(index) )
914 {
915 m_cursores.SetSize(index + 1);
916 }
917 if ( m_cursores[index] == NULL )
918 {
919 CCursorManager* P = new CCursorManager;
920 if ( ! P->Create(m_hParent, m_cursorImage, m_cursorMaskColor, m_cursorHotspot) )
921 {
922 _GetLastError("CreateWindow");
923 delete P;
924 return false;
925 }
926 if ( ! ::IsRectEmpty(&m_corsorRect) )
927 {
928 P->Clip(m_corsorRect);
929 }
930 m_cursores.Set(index, P);
931 }
932 return true;
933 }
935 virtual void OnMultiMouseEvent(INDEX index, const RAWMOUSE& mouse)
936 {
937 EXCLUSIVE( &m_sync );
938 if ( m_pListener != NULL )
939 {
940 m_pListener->OnMultiMouseEvent(index, mouse);
941 }
942 CCursorManager* P = m_cursores[index];
943 if ( P == NULL )
944 {
945 ASSERT( P != NULL );
946 return;
947 }
948 const POINT& po = P->GetPos();
949 P->SetButtonFlags(mouse.usButtonFlags);
950 if ( P->MovePos(mouse.lLastX, mouse.lLastY) )
951 {
952 //変化有り
953 if ( m_pListener != NULL )
954 {
955 m_pListener->OnMultiMouseMove(index, P->GetButtonState(), po.x, po.y);
956 }
957 }
958 if ( m_pListener != NULL )
959 {
960 if ( (mouse.usButtonFlags & RI_MOUSE_WHEEL) != 0 )
961 {
962 short d = mouse.usButtonData;
963 m_pListener->OnMultiMouseWheel(index, d);
964 }
965 loop ( i, 3/*ボタン数*/ * 2 )
966 {
967 if ( (mouse.usButtonFlags & _BIT(i)) != 0 )
968 {
970 if ( (i & 1) != 0 )
971 {
973 }
974 m_pListener->OnMultiMouseButton(index, CMultiMouseManager::IListener::EButton(i / 2), e, po.x, po.y);
975 }
976 }
977 }
978 }
980 virtual void OnMultiMouseDevice(INDEX index, EDevice device)
981 {
982 EXCLUSIVE( &m_sync );
983 if ( device == Device_Remove )
984 {
985 if ( m_pListener != NULL )
986 {
987 m_pListener->OnMultiMouseDevice(index, device);
988 }
989 return;
990 }
991 if ( ! CheckIndex(index) )
992 {
993 return;
994 }
995 if ( m_pListener != NULL )
996 {
997 m_pListener->OnMultiMouseDevice(index, device);
998 }
999 }
1000 IParentListener* m_pListener;
1002 HWND m_hParent;
1003 CBitmapHandle m_cursorImage;
1004 COLORREF m_cursorMaskColor;
1005 POINT m_cursorHotspot;
1006 RECT m_corsorRect;
1007 CSyncSection m_sync;
1008 };
1009
1011 bool m_IconToBitmap(CBitmapHandle& _bmp, POINT& _hotspot, HCURSOR hCursor, COLORREF color)
1012 {
1013 ICONINFO ii;
1014 if ( ::GetIconInfo(hCursor, &ii) )
1015 {
1016 HBITMAP h = ii.hbmColor;
1017 if ( h == NULL )
1018 {
1019 h = ii.hbmMask;
1020 }
1021 BITMAP bm;
1022 if ( ::GetObject(h, sizeof(BITMAP), &bm) > 0 )
1023 {
1024 CBitmapImage bi;
1025 bi.Set(bm.bmWidth, bm.bmHeight, color);
1026 HDC dc = bi.GetDC();
1027 ::DrawIconEx(dc, 0, 0, hCursor, 0, 0, 0, NULL, DI_NORMAL);
1028 bi.ReleaseDC();
1029 _bmp = bi;
1030 _hotspot.x = ii.xHotspot;
1031 _hotspot.y = ii.yHotspot;
1032 return true;
1033 }
1034 }
1035 return false;
1036 }
1037
1039 const CCursorManager* m_RefCursorManager(INDEX index) const
1040 {
1041 if ( m_in.m_cursores.IsInRange(index) )
1042 {
1043 return m_in.m_cursores[index];
1044 }
1045 return NULL;
1046 }
1047
1049 CCursorManager* m_GetCursorManager(INDEX index)
1050 {
1051 m_in.CheckIndex(index);
1052 return m_in.m_cursores[index];
1053 }
1054
1055 CInner m_in;
1056 IMultiMouseWatcher* m_pWatcher;
1057};
1058
1059
1060
1061}; //TNB
1062
1063
1064
ビットマップイメージ管理関係のヘッダ
#define _BIT(X)
BIT演算
Definition: TnbDef.h:307
#define loop(VAR, CNT)
loop構文.
Definition: TnbDef.h:343
ダミーウィンドウ関係のヘッダ
ポインタ配列管理関係のヘッダ
HBITMAP型ハンドルハンドル
ビットマップイメージ管理クラス
HDC GetDC(void)
[取得]デバイスコンテキストハンドル取得.
bool Set(int cx, int cy, COLORREF color=CLR_INVALID)
[設定] イメージ設定.
bool ReleaseDC(void)
[設定] デバイスコンテキストハンドル返却.
ダミーウィンドウクラス
マルチマウス管理クラス
bool SetCursorImage(INDEX index, HCURSOR hCursor, COLORREF color=RGB(255, 0, 255))
[設定] カーソルイメージ設定.
void SetListener(IListener *P)
[登録] リスナー登録.
CMultiMouseManager(void)
コンストラクタ
bool SetCursorPos(INDEX index, int x, int y)
[設定] カーソル位置設定.
bool SetDefaultCursorImage(int hotspotX, int hotspotY, CBitmapHandle bmp, COLORREF color=CLR_AUTOSELECT)
[設定] デフォルトカーソルイメージ設定.
bool ShowCursor(INDEX index, bool isShow)
[表示] カーソル表示.
bool SetDefaultCursorImage(CBitmapHandle bmp, COLORREF color=CLR_AUTOSELECT)
[設定] デフォルトカーソルイメージ設定.
bool SetDefaultCursorImage(HCURSOR hCursor, COLORREF color=RGB(255, 0, 255))
[設定] デフォルトカーソルイメージ設定.
void Stop(void)
[設定] 停止.
POINT GetCursorPos(INDEX index) const
[取得] カーソル位置取得.
BYTE GetButtonState(INDEX index) const
[取得] ボタン状態取得.
size_t GetMouseCount(void) const
[取得] マウス数取得.
bool ClipCursor(INDEX index, const RECT &rect)
[設定] カーソル稼動範囲設定.
bool IsValid(INDEX index) const
[確認] マウス有効確認.
bool SetCursorImage(INDEX index, CBitmapHandle bmp, COLORREF color=CLR_AUTOSELECT)
[設定] カーソルイメージ設定.
bool Start(IMultiMouseWatcher *pWatcher, HWND hParent=NULL)
[設定] 開始.
bool SetCursorImage(INDEX index, int hotspotX, int hotspotY, CBitmapHandle bmp, COLORREF color=CLR_AUTOSELECT)
[設定] カーソルイメージ設定.
Section排他管理クラス
Definition: TnbSync.h:125
#define EXCLUSIVE(CLS)
簡易排他制御マクロ.
Definition: TnbSync.h:788
void Zero(V &value)
[設定] ゼロクリア.
Definition: TnbDef.h:399
TNB Library
Definition: TnbDoxyTitle.txt:2
ダミーウィンドウクラスのリスナーインターフェース
マルチマウス管理のリスナー
virtual void OnMultiMouseDevice(INDEX index, EDevice device)=0
[通知] デバイス変化通知.
virtual void OnMultiMouseMove(INDEX index, BYTE buttonFlags, int x, int y)=0
[通知] 移動通知.
virtual ~IListener(void)
デストラクタ
static DWORD MakeMouseEventFlags(EButton button, EEvent event)
[作成] マウスイベントフラグ作成.
virtual void OnMultiMouseWheel(INDEX index, int d)=0
[通知] ホイール通知.
virtual void OnMultiMouseButton(INDEX index, EButton button, EEvent event, int x, int y)=0
[通知] ボタン通知.
virtual void OnMultiMouseEvent(INDEX index, const RAWMOUSE &mouse)
[通知] イベント通知.
マルチマウス監視のリスナー
virtual void OnMultiMouseDevice(INDEX index, EDevice device)=0
[通知] デバイス変化通知.
virtual void OnMultiMouseEvent(INDEX index, const RAWMOUSE &mouse)=0
[通知] イベント通知.
virtual ~IListener(void)
デストラクタ
マルチマウス監視インターフェース.
virtual void Stop(void)
[設定] 監視停止.
virtual void SetListener(IListener *P)
[登録] リスナー登録.
virtual size_t GetMouseCount(void) const
[取得] マウス数取得.
virtual bool Start(void)
[設定] 監視開始.