ReactOS  0.4.14-dev-604-gcfdd483
window.h
Go to the documentation of this file.
1 /*
2  * Copyright 2003, 2004, 2005 Martin Fuchs
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
19 
20  //
21  // Explorer clone
22  //
23  // window.h
24  //
25  // Martin Fuchs, 23.07.2003
26  //
27 
28 
30 
31 
32  /*
33  Classes are declared using "struct", not "class" because the default
34  access mode is "public". This way we can list the member functions in a
35  natural order without explicitly specifying any access mode at the begin
36  of the definition.
37  First are public constructors and destructor, then public member functions.
38  After that we list protected member varibables and functions. If needed,
39  private implemenation varibales and functions are positioned at the end.
40  */
41 
42 
45 {
46  ChildWndInfo(HWND hmdiclient)
47  : _hmdiclient(hmdiclient) {}
48 
50 };
51 
52 
58 struct Window : public WindowHandle
59 {
60  Window(HWND hwnd);
61  virtual ~Window();
62 
63 
65 
66  typedef Window* (*CREATORFUNC)(HWND);
67  typedef Window* (*CREATORFUNC_INFO)(HWND, const void*);
68 
69  static HWND Create(CREATORFUNC creator,
70  DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName,
71  DWORD dwStyle, int x, int y, int w, int h,
72  HWND hwndParent=0, HMENU hMenu=0/*, LPVOID lpParam=0*/);
73 
74  static HWND Create(CREATORFUNC_INFO creator, const void* info,
75  DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName,
76  DWORD dwStyle, int x, int y, int w, int h,
77  HWND hwndParent=0, HMENU hMenu=0/*, LPVOID lpParam=0*/);
78 
80 // static Window* create_property_sheet(struct PropertySheetDialog* ppsd, CREATORFUNC creator, const void* info);
81 
84 
85  static Window* get_window(HWND hwnd);
86 #ifndef _MSC_VER
87  template<typename CLASS> static CLASS* get_window(HWND hwnd) {return static_cast<CLASS*>(get_window(hwnd));}
88 #define GET_WINDOW(CLASS, hwnd) Window::get_window<CLASS>(hwnd)
89 #endif
90 
91  static void register_pretranslate(HWND hwnd);
92  static void unregister_pretranslate(HWND hwnd);
93  static BOOL pretranslate_msg(LPMSG pmsg);
94 
95  static void register_dialog(HWND hwnd);
96  static void unregister_dialog(HWND hwnd);
97  static BOOL dispatch_dialog_msg(LPMSG pmsg);
98 
99  static int MessageLoop();
100 
101 
104 
105  static void CancelModes();
106 
107 
108 protected:
109  virtual LRESULT Init(LPCREATESTRUCT pcs); // WM_CREATE processing
110  virtual LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
111  virtual int Command(int id, int code); // WM_COMMAND processing
112  virtual int Notify(int id, NMHDR* pnmh); // WM_NOTIFY processing
113 
115 
116 
118 
119  static const void* s_new_info;
121 
122 
127  };
128 
130 
131 
132  // MDI child creation
133  static HHOOK s_hcbtHook;
136 
139 };
140 
141 #ifdef UNICODE
142 #define NFR_CURRENT NFR_UNICODE
143 #else
144 #define NFR_CURRENT NFR_ANSI
145 #endif
146 
147 
148 #ifdef _MSC_VER
149 template<typename CLASS> struct GetWindowHelper
150 {
151  static CLASS* get_window(HWND hwnd) {
152  return static_cast<CLASS*>(Window::get_window(hwnd));
153  }
154 };
155 #define GET_WINDOW(CLASS, hwnd) GetWindowHelper<CLASS>::get_window(hwnd)
156 #endif
157 
158 
160 template<typename CLASS> struct TypeCheck
161 {
162  static CLASS* dyn_cast(Window* wnd)
163  {return dynamic_cast<CLASS*>(wnd);}
164 };
165 
166 #define WINDOW_DYNAMIC_CAST(CLASS, hwnd) \
167  TypeCheck<CLASS>::dyn_cast(Window::get_window(hwnd))
168 
169 
176 struct SubclassedWindow : public Window
177 {
178  typedef Window super;
179 
181 
182 protected:
184 
186 
187  virtual LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
188  virtual int Command(int id, int code);
189  virtual int Notify(int id, NMHDR* pnmh);
190 };
191 
192 
194 template<typename WND_CLASS> struct WindowCreator
195 {
196  static WND_CLASS* window_creator(HWND hwnd)
197  {
198  return new WND_CLASS(hwnd);
199  }
200 };
201 
202 #define WINDOW_CREATOR(WND_CLASS) \
203  ((Window::CREATORFUNC) WindowCreator<WND_CLASS>::window_creator)
204 
205 
207 template<typename WND_CLASS, typename INFO_CLASS> struct WindowCreatorInfo
208 {
209  static WND_CLASS* window_creator(HWND hwnd, const void* info)
210  {
211  return new WND_CLASS(hwnd, *static_cast<const INFO_CLASS*>(info));
212  }
213 };
214 
215 #define WINDOW_CREATOR_INFO(WND_CLASS, INFO_CLASS) \
216  ((Window::CREATORFUNC_INFO) WindowCreatorInfo<WND_CLASS, INFO_CLASS>::window_creator)
217 
218 
226 struct WindowClass : public WNDCLASSEX
227 {
229 
231  {
232  if (!_atomClass)
233  _atomClass = RegisterClassEx(this);
234 
235  return _atomClass;
236  }
237 
238  operator ATOM() {return Register();}
239 
240  // return LPCTSTR for the CreateWindowEx() parameter
241  operator LPCTSTR() {return (LPCTSTR)(int)Register();}
242 
243 protected:
245 };
246 
249 {
251  : WindowClass(classname, style, wndproc)
252  {
253  hbrBackground = (HBRUSH)(COLOR_BTNFACE+1);
254  }
255 };
256 
259 {
261 };
262 
263 
264  // private message constants
265 #define PM_DISPATCH_COMMAND (WM_APP+0x00)
266 #define PM_TRANSLATE_MSG (WM_APP+0x01)
267 
268 
269 #define SPLIT_WIDTH 5
270 #define DEFAULT_SPLIT_POS 300
271 #define COLOR_SPLITBAR LTGRAY_BRUSH
272 
273 
275 struct MenuInfo
276 {
278 };
279 
280 #define PM_FRM_GET_MENUINFO (WM_APP+0x02)
281 
282 #define Frame_GetMenuInfo(hwnd) ((MenuInfo*)SNDMSG(hwnd, PM_FRM_GET_MENUINFO, 0, 0))
283 
284 
290 struct PreTranslateWindow : public Window
291 {
292  typedef Window super;
293 
296 };
297 
298 
299 
305 {
307 
309 
310  static ChildWindow* create(const ChildWndInfo& info, const RECT& rect, CREATORFUNC_INFO creator,
312 
313  bool go_to(LPCTSTR url);
314 
315 protected:
317 
318  virtual void resize_children(int cx, int cy);
319  virtual String jump_to_int(LPCTSTR url) = 0;
320 
321 protected:
323 
324  WindowHandle _left_hwnd;
325  WindowHandle _right_hwnd;
326  int _focus_pane; // 0: left 1: right
327 
330 
334 
336 
337  void set_url(LPCTSTR url);
338 };
339 
340 #define PM_SETSTATUSTEXT (WM_APP+0x1E)
341 
342 
349 struct DialogWindow : public Window
350 {
351  typedef Window super;
352 
354  : super(hwnd)
355  {
357  }
358 
360  {
361  unregister_dialog(_hwnd);
362  }
363 };
364 
365 
371 struct Dialog : public Window
372 {
373  typedef Window super;
374 
375  Dialog(HWND);
376  ~Dialog();
377 
378  static int DoModal(UINT nid, CREATORFUNC creator, HWND hwndParent=0);
379  static int DoModal(UINT nid, CREATORFUNC_INFO creator, const void* info, HWND hwndParent=0);
380 
381 protected:
383  int Command(int id, int code);
384 };
385 
386 
387 #define PM_FRM_CALC_CLIENT (WM_APP+0x03)
388 #define Frame_CalcFrameClient(hwnd, prt) ((BOOL)SNDMSG(hwnd, PM_FRM_CALC_CLIENT, 0, (LPARAM)(PRECT)prt))
389 
390 #define PM_JUMP_TO_URL (WM_APP+0x25)
391 #define PM_URL_CHANGED (WM_APP+0x26)
392 
393 
395 {
397 
398  void init(struct PropertySheetDialog*);
399 
400 protected:
401  friend struct PropSheetPageDlg;
402 
404 };
405 
406 
409 {
410  PropertySheetDialog(HWND owner);
411 
412  void add(PropSheetPage& psp);
413  int DoModal(int start_page=0);
414 
416 
417 protected:
421 };
422 
423 
425 struct PropSheetPageDlg : public Dialog
426 {
427  typedef Dialog super;
428 
430 
431 protected:
432  friend struct PropertySheetDialog;
433  friend struct PropSheetPage;
434 
436 
437  int Command(int id, int code);
438 };
439 
440 
441 /*
443 struct PropertySheetDlg : public SubclassedWindow
444 {
445  typedef SubclassedWindow super;
446 
447  PropertySheetDlg(HWND hwnd) : super(hwnd) {}
448 };
449 */
450 
451 
452  // Layouting of resizable windows
453 
456  MOVE_LEFT = 0x1,
457  MOVE_RIGHT = 0x2,
458  MOVE_TOP = 0x4,
459  MOVE_BOTTOM = 0x8,
460 
465 
468 };
469 
472 {
474  : _id(id), _flags(flags) {}
475 
477  : _id(GetDlgCtrlID(hwnd)), _flags(flags) {}
478 
480  int _flags;
481 };
482 
483 
485 struct ResizeManager : public std::list<ResizeEntry>
486 {
487  typedef std::list<ResizeEntry> super;
488 
490 
491  void Add(UINT id, int flags)
492  {push_back(ResizeEntry(id, flags));}
493 
494  void Add(HWND hwnd, int flags)
495  {push_back(ResizeEntry(hwnd, flags));}
496 
497  void HandleSize(int cx, int cy);
498  void Resize(int dx, int dy);
499 
501  {
502  lpmmi->ptMinTrackSize.x = _min_wnd_size.cx;
503  lpmmi->ptMinTrackSize.y = _min_wnd_size.cy;
504  }
505 
507 
508 protected:
511 };
512 
513 
515 template<typename BASE> struct ResizeController : public BASE
516 {
517  typedef BASE super;
518 
520  : super(hwnd),
522  {
523  }
524 
526  {
527  switch(nmsg) {
528  case PM_FRM_CALC_CLIENT:
530  return TRUE;
531 
532  case WM_SIZE:
533  if (wparam != SIZE_MINIMIZED)
535  goto def;
536 
537  case WM_GETMINMAXINFO:
539  goto def;
540 
541  default: def:
542  return super::WndProc(nmsg, wparam, lparam);
543  }
544  }
545 
546  virtual void GetClientSpace(PRECT prect)
547  {
548  if (!IsIconic(this->_hwnd)) {
549  GetClientRect(this->_hwnd, prect);
550  } else {
551  WINDOWPLACEMENT wp;
552  GetWindowPlacement(this->_hwnd, &wp);
553  prect->left = prect->top = 0;
559  }
560  }
561 
562 protected:
564 };
565 
566 
572 struct Button : public WindowHandle
573 {
574  Button(HWND parent, LPCTSTR text, int left, int top, int width, int height,
575  int id, DWORD flags=WS_VISIBLE|WS_CHILD|BS_PUSHBUTTON, DWORD exStyle=0);
576 };
577 
578 
584 struct Static : public WindowHandle
585 {
586  Static(HWND parent, LPCTSTR text, int left, int top, int width, int height,
587  int id, DWORD flags=WS_VISIBLE|WS_CHILD|SS_SIMPLE, DWORD ex_flags=0);
588 };
589 
590 
591  // control color message routing for ColorStatic and HyperlinkCtrl
592 
593 #define PM_DISPATCH_CTLCOLOR (WM_APP+0x08)
594 
595 template<typename BASE> struct CtlColorParent : public BASE
596 {
597  typedef BASE super;
598 
600  : super(hwnd) {}
601 
603  {
604  switch(nmsg) {
605  case WM_CTLCOLOR:
606  case WM_CTLCOLORBTN:
607  case WM_CTLCOLORDLG:
609  case WM_CTLCOLORSTATIC: {
610  HWND hctl = (HWND) lparam;
611  return SendMessage(hctl, PM_DISPATCH_CTLCOLOR, wparam, nmsg);
612  }
613 
614  default:
615  return super::WndProc(nmsg, wparam, lparam);
616  }
617  }
618 };
619 
620 
621 #define PM_DISPATCH_DRAWITEM (WM_APP+0x09)
622 
624 template<typename BASE> struct OwnerDrawParent : public BASE
625 {
626  typedef BASE super;
627 
629  : super(hwnd) {}
630 
632  {
633  switch(nmsg) {
634  case WM_DRAWITEM:
635  if (wparam) { // should there be drawn a control?
636  HWND hctl = GetDlgItem(this->_hwnd, wparam);
637 
638  if (hctl)
640  } /*else // or is it a menu entry?
641  ; */
642 
643  return 0;
644 
645  default:
646  return super::WndProc(nmsg, wparam, lparam);
647  }
648  }
649 };
650 
651 
657 {
659 
661  : super(hwnd) {}
662 
663 protected:
665 
666  virtual void DrawItem(LPDRAWITEMSTRUCT dis) = 0;
667 };
668 
669 extern void DrawGrayText(HDC hdc, LPRECT pRect, LPCTSTR text, int dt_flags);
670 
671 
676 /* not yet used
677 struct ColorButton : public OwnerdrawnButton
678 {
679  typedef OwnerdrawnButton super;
680 
681  ColorButton(HWND hwnd, COLORREF textColor)
682  : super(hwnd), _textColor(textColor) {}
683 
684 protected:
685  virtual void DrawItem(LPDRAWITEMSTRUCT dis);
686 
687  COLORREF _textColor;
688 };
689 */
690 
691 
693 {
695 
697  : super(hwnd), _active(false) {}
698 
699  FlatButton(HWND owner, int id)
700  : super(GetDlgItem(owner, IDOK)), _active(false) {}
701 
702 protected:
704  virtual void DrawItem(LPDRAWITEMSTRUCT dis);
705 
708  bool _active;
709 };
710 
711 
718 {
720 
722  : super(hwnd), _hIcon(hIcon), _hBmp(0), _hBrush(hbrush), _flat(flat)
723  {
724  _cx = 16;
725  _cy = 16;
726  }
727 
728  PictureButton(HWND hparent, int id, HICON hIcon, HBRUSH hbrush=GetSysColorBrush(COLOR_BTNFACE), bool flat=false)
729  : super(GetDlgItem(hparent, id)), _hIcon(hIcon), _hBmp(0), _hBrush(hbrush), _flat(flat)
730  {
731  _cx = 16;
732  _cy = 16;
733  }
734 
736  : super(hwnd), _hIcon(0), _hBmp(hBmp), _hBrush(hbrush), _flat(flat)
737  {
738  BITMAP bmp;
739  GetObject(hBmp, sizeof(bmp), &bmp);
740  _cx = bmp.bmWidth;
741  _cy = bmp.bmHeight;
742  }
743 
744  PictureButton(HWND hparent, int id, HBITMAP hBmp, HBRUSH hbrush=GetSysColorBrush(COLOR_BTNFACE), bool flat=false)
745  : super(GetDlgItem(hparent, id)), _hIcon(0), _hBmp(hBmp), _hBrush(hbrush), _flat(flat)
746  {
747  BITMAP bmp;
748  GetObject(hBmp, sizeof(bmp), &bmp);
749  _cx = bmp.bmWidth;
750  _cy = bmp.bmHeight;
751  }
752 
753 protected:
754  virtual void DrawItem(LPDRAWITEMSTRUCT dis);
755 
758  HBRUSH _hBrush;
759 
760  int _cx;
761  int _cy;
762 
763  bool _flat;
764 };
765 
766 
768 {
770 
771  ColorStatic(HWND hwnd, COLORREF textColor=RGB(255,0,0), HBRUSH hbrush_bkgnd=0, HFONT hfont=0)
772  : super(hwnd),
773  _textColor(textColor),
774  _hbrush_bkgnd(hbrush_bkgnd),
775  _hfont(hfont)
776  {
777  }
778 
779  ColorStatic(HWND owner, int id, COLORREF textColor=RGB(255,0,0), HBRUSH hbrush_bkgnd=0, HFONT hfont=0)
780  : super(GetDlgItem(owner, id)),
781  _textColor(textColor),
782  _hbrush_bkgnd(hbrush_bkgnd),
783  _hfont(hfont)
784  {
785  }
786 
787 protected:
789  {
790  if (nmsg == PM_DISPATCH_CTLCOLOR) {
791  HDC hdc = (HDC) wparam;
792 
794 
795  if (_hfont)
797 
798  if (_hbrush_bkgnd)
799  return (LRESULT)_hbrush_bkgnd;
800  else {
803  }
804  } else
805  return super::WndProc(nmsg, wparam, lparam);
806  }
807 
811 };
812 
813 
815 
817 {
819 
820  HyperlinkCtrl(HWND hwnd, COLORREF colorLink=RGB(0,0,255), COLORREF colorVisited=RGB(128,0,128));
821  HyperlinkCtrl(HWND owner, int id, COLORREF colorLink=RGB(0,0,255), COLORREF colorVisited=RGB(128,0,128));
822 
823  ~HyperlinkCtrl();
824 
826 
827 protected:
832 
834 
835  void init();
836 
837  bool LaunchLink()
838  {
839  if (!_cmd.empty()) {
840  HINSTANCE hinst = ShellExecute(GetParent(_hwnd), _T("open"), _cmd, 0, 0, SW_SHOWNORMAL);
841  return (INT_PTR)hinst > HINSTANCE_ERROR;
842  }
843 
844  return true;
845  }
846 };
847 
848 
850 struct ToolTip : public WindowHandle
851 {
852  typedef WindowHandle super;
853 
854  ToolTip(HWND owner);
855 
856  void activate(BOOL active=TRUE)
857  {
858  SendMessage(_hwnd, TTM_ACTIVATE, active, 0);
859  }
860 
861  void add(HWND hparent, HWND htool, LPCTSTR txt=LPSTR_TEXTCALLBACK, LPARAM lparam=0)
862  {
863  TOOLINFO ti = {
864  sizeof(TOOLINFO), TTF_SUBCLASS|TTF_IDISHWND|TTF_TRANSPARENT, hparent, (UINT_PTR)htool,
865  {0,0,0,0}, 0, (LPTSTR)txt, lparam
866  };
867 
868 #ifdef UNICODE
869  if (!SendMessage(_hwnd, TTM_ADDTOOLW, 0, (LPARAM)&ti))
870  SendMessage(_hwnd, TTM_ADDTOOLA, 0, (LPARAM)&ti);
871 #else
872  if (!SendMessage(_hwnd, TTM_ADDTOOLA, 0, (LPARAM)&ti))
873  SendMessage(_hwnd, TTM_ADDTOOLW, 0, (LPARAM)&ti);
874 #endif
875  }
876 
877  void add(HWND hparent, UINT id, const RECT& rect, LPCTSTR txt=LPSTR_TEXTCALLBACK, LPARAM lparam=0)
878  {
879  TOOLINFO ti = {
880  sizeof(TOOLINFO), TTF_SUBCLASS|TTF_TRANSPARENT, hparent, id,
881  {rect.left,rect.top,rect.right,rect.bottom}, 0, (LPTSTR)txt, lparam
882  };
883 
884 #ifdef UNICODE
885  if (!SendMessage(_hwnd, TTM_ADDTOOLW, 0, (LPARAM)&ti))
886  SendMessage(_hwnd, TTM_ADDTOOLA, 0, (LPARAM)&ti);
887 #else
888  if (!SendMessage(_hwnd, TTM_ADDTOOLA, 0, (LPARAM)&ti))
889  SendMessage(_hwnd, TTM_ADDTOOLW, 0, (LPARAM)&ti);
890 #endif
891  }
892 
893  void remove(HWND hparent, HWND htool)
894  {
895  TOOLINFO ti = {
896  sizeof(TOOLINFO), TTF_IDISHWND, hparent, (UINT_PTR)htool,
897  {0,0,0,0}, 0, 0, 0
898  };
899 
900  SendMessage(_hwnd, TTM_DELTOOL, 0, (LPARAM)&ti);
901  }
902 
903  void remove(HWND hparent, UINT id)
904  {
905  TOOLINFO ti = {
906  sizeof(TOOLINFO), 0, hparent, id,
907  {0,0,0,0}, 0, 0, 0
908  };
909 
910  SendMessage(_hwnd, TTM_DELTOOL, 0, (LPARAM)&ti);
911  }
912 };
913 
914 
915 inline int ListView_GetItemData(HWND list_ctrl, int idx)
916 {
917  LV_ITEM item;
918 
919  item.mask = LVIF_PARAM;
920  item.iItem = idx;
921 
922  if (!ListView_GetItem(list_ctrl, &item))
923  return 0;
924 
925  return item.lParam;
926 }
927 
928 inline int ListView_FindItemPara(HWND list_ctrl, LPARAM param)
929 {
930  LVFINDINFO fi;
931 
932  fi.flags = LVFI_PARAM;
933  fi.lParam = param;
934 
935  return ListView_FindItem(list_ctrl, (unsigned)-1, &fi);
936 }
937 
938 inline int ListView_GetFocusedItem(HWND list_ctrl)
939 {
940  int idx = ListView_GetItemCount(list_ctrl);
941 
942  while(--idx >= 0)
943  if (ListView_GetItemState(list_ctrl, idx, LVIS_FOCUSED))
944  break;
945 
946  return idx;
947 }
948 
949 
951 struct ListSort : public WindowHandle
952 {
953  ListSort(HWND hwndListview, PFNLVCOMPARE compare_fct);
954 
955  void toggle_sort(int idx);
956  void sort();
957 
960 
961 protected:
963 
964  static int CALLBACK CompareFunc(LPARAM lparam1, LPARAM lparam2, LPARAM lparamSort);
965 };
966 
967 
969 {
970  TVITEM tvItem;
971 
972  tvItem.mask = TVIF_PARAM;
973  tvItem.hItem = hItem;
974 
975  if (!TreeView_GetItem(hwndTreeView, &tvItem))
976  return 0;
977 
978  return tvItem.lParam;
979 }
980 
981 
983 
984 #define PM_TRAYICON (WM_APP+0x20)
985 
986 #define WINMSG_TASKBARCREATED TEXT("TaskbarCreated")
987 
988 #define WINMSG_SHELLHOOK TEXT("SHELLHOOK")
989 
990 
991 struct TrayIcon
992 {
993  TrayIcon(HWND hparent, UINT id)
994  : _hparent(hparent), _id(id) {}
995 
997  {Remove();}
998 
999  void Add(HICON hIcon, LPCTSTR tooltip=NULL)
1000  {Set(NIM_ADD, _id, hIcon, tooltip);}
1001 
1002  void Modify(HICON hIcon, LPCTSTR tooltip=NULL)
1003  {Set(NIM_MODIFY, _id, hIcon, tooltip);}
1004 
1005  void Remove()
1006  {
1007  NOTIFYICONDATA nid = {
1008  sizeof(NOTIFYICONDATA), // cbSize
1009  _hparent, // hWnd
1010  _id, // uID
1011  };
1012 
1014  }
1015 
1016 protected:
1019 
1020  void Set(DWORD dwMessage, UINT id, HICON hIcon, LPCTSTR tooltip=NULL)
1021  {
1022  NOTIFYICONDATA nid = {
1023  sizeof(NOTIFYICONDATA), // cbSize
1024  _hparent, // hWnd
1025  id, // uID
1026  NIF_MESSAGE|NIF_ICON, // uFlags
1027  PM_TRAYICON, // uCallbackMessage
1028  hIcon // hIcon
1029  };
1030 
1031  if (tooltip)
1032  lstrcpyn(nid.szTip, tooltip, COUNTOF(nid.szTip));
1033 
1034  if (nid.szTip[0])
1035  nid.uFlags |= NIF_TIP;
1036 
1037  Shell_NotifyIcon(dwMessage, &nid);
1038  }
1039 };
1040 
1041 
1042 template<typename BASE> struct TrayIconControllerTemplate : public BASE
1043 {
1044  typedef BASE super;
1045 
1048  {
1049  }
1050 
1052  {
1053  if (nmsg == PM_TRAYICON) {
1054  switch(lparam) {
1055  case WM_MOUSEMOVE:
1057  break;
1058 
1059  case WM_LBUTTONDOWN:
1061  break;
1062 
1063  case WM_LBUTTONDBLCLK:
1065  break;
1066 
1067  case WM_RBUTTONDOWN:
1069  break;
1070 
1071  case WM_RBUTTONDBLCLK:
1073  break;
1074 
1075  case WM_MBUTTONDOWN:
1077  break;
1078 
1079  case WM_MBUTTONDBLCLK:
1081  break;
1082  }
1083 
1084  return 0;
1085  } else if (nmsg == WM_TASKBARCREATED) {
1086  AddTrayIcons();
1087  return 0;
1088  } else
1089  return super::WndProc(nmsg, wparam, lparam);
1090  }
1091 
1092  virtual void AddTrayIcons() = 0;
1093  virtual void TrayMouseOver(UINT id) {}
1094  virtual void TrayClick(UINT id, int btn) {}
1095  virtual void TrayDblClick(UINT id, int btn) {}
1096 
1097 protected:
1099 };
1100 
1101 
1103 {
1105 
1107  : super(hwnd)
1108  {
1109  }
1110 
1111 protected:
1113  {
1114  if (nmsg==WM_KEYDOWN && wparam==VK_RETURN) {
1115  SendParent(WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(_hwnd),1), (LPARAM)_hwnd);
1116  return 0;
1117  } else
1118  return super::WndProc(nmsg, wparam, lparam);
1119  }
1120 };
map< HWND, Window * > WindowMap
Definition: window.h:64
FlatButton(HWND owner, int id)
Definition: window.h:699
static LRESULT CALLBACK WindowWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
Definition: window.cpp:247
virtual void DrawItem(LPDRAWITEMSTRUCT dis)
Definition: window.cpp:965
ResizeEntry(HWND hwnd, int flags)
Definition: window.h:476
POINT ptMinTrackSize
Definition: winuser.h:3605
Definition: window.h:584
#define LV_ITEM
Definition: commctrl.h:2333
WNDPROC _orgWndProc
Definition: window.h:183
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
UINT style
Definition: winuser.h:3177
Management of controls in resizable dialogs.
Definition: window.h:485
structure for managing critical sections as static class information in struct Window
Definition: window.h:124
#define NIF_MESSAGE
Definition: shellapi.h:102
GLint GLint GLsizei width
Definition: gl.h:1546
HICON _hIcon
Definition: window.h:756
static HICON
Definition: imagelist.c:84
HWND _hwnd
Definition: window.h:509
ChildWindow(HWND hwnd, const ChildWndInfo &info)
Definition: window.cpp:359
#define TRUE
Definition: types.h:120
structure to assign RESIZE_FLAGS to dialogs control
Definition: window.h:471
static LRESULT CALLBACK PropSheetCBTHookProc(int code, WPARAM wparam, LPARAM lparam)
Definition: window.cpp:185
#define MAKEWPARAM(l, h)
Definition: winuser.h:3984
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
#define IDOK
Definition: winuser.h:824
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
#define RegisterClassEx
Definition: winuser.h:5812
static HBRUSH hbrush
int _last_split
Definition: window.h:329
long y
Definition: polytest.cpp:48
#define WM_LBUTTONDOWN
Definition: winuser.h:1758
ResizeManager(HWND hwnd)
Definition: window.cpp:776
#define SM_CYMENUSIZE
Definition: winuser.h:1008
static CLASS * get_window(HWND hwnd)
Definition: window.h:87
long x
Definition: polytest.cpp:48
static WindowSet s_dialogs
Definition: window.h:138
HWND _hwndFrame
Definition: window.h:331
NOTIFYICONDATA nid
Definition: magnifier.c:44
CRITICAL_SECTION CritSect
static WND_CLASS * window_creator(HWND hwnd)
Definition: window.h:196
WindowHandle _left_hwnd
Definition: window.h:324
WORD ATOM
Definition: dimm.idl:113
#define TOOLINFO
Definition: commctrl.h:1714
#define WM_CTLCOLORDLG
Definition: winuser.h:1752
int _focus_pane
Definition: window.h:326
~DialogWindow()
Definition: window.h:359
const WCHAR * text
Definition: package.c:1827
ColorStatic(HWND owner, int id, COLORREF textColor=RGB(255, 0, 0), HBRUSH hbrush_bkgnd=0, HFONT hfont=0)
Definition: window.h:779
GLint dy
Definition: linetemp.h:97
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1754
HBRUSH _hbrush_bkgnd
Definition: window.h:809
EditController(HWND hwnd)
Definition: window.h:1106
static StaticWindowData & GetStaticWindowData()
Definition: window.cpp:63
static LRESULT CALLBACK SubclassedWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
Definition: window.cpp:310
DialogWindow(HWND hwnd)
Definition: window.h:353
virtual LRESULT Init(LPCREATESTRUCT pcs)
Definition: window.cpp:241
template class used in macro WINDOW_CREATOR_INFO to the define creater functions for Window objects w...
Definition: window.h:207
Window super
Definition: window.h:373
static HDC
Definition: imagelist.c:92
#define CALLBACK
Definition: compat.h:27
void Add(HICON hIcon, LPCTSTR tooltip=NULL)
Definition: window.h:999
WindowHandle _right_hwnd
Definition: window.h:325
virtual void DrawItem(LPDRAWITEMSTRUCT dis)
Definition: window.cpp:1050
#define ListView_GetItemState(hwndLV, i, mask)
Definition: commctrl.h:2672
static void register_pretranslate(HWND hwnd)
Definition: window.cpp:579
static CREATORFUNC s_window_creator
Definition: window.h:120
LONG top
Definition: windef.h:307
HBRUSH _hBrush
Definition: window.h:758
HANDLE HWND
Definition: compat.h:13
COLORREF _textColor
Definition: window.h:706
#define SM_CXEDGE
Definition: winuser.h:998
PropSheetPageDlg(HWND)
Definition: window.cpp:1406
PropertySheetDialog(HWND owner)
Definition: window.cpp:1324
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
PictureButton(HWND hwnd, HICON hIcon, HBRUSH hbrush=GetSysColorBrush(COLOR_BTNFACE), bool flat=false)
Definition: window.h:721
ListSort(HWND hwndListview, PFNLVCOMPARE compare_fct)
Definition: window.cpp:1274
#define WM_CTLCOLOR
Definition: windowsx.h:4
void remove(HWND hparent, UINT id)
Definition: window.h:903
draw message routing for ColorButton and PictureButton
Definition: window.h:624
static WCHAR String[]
Definition: stringtable.c:55
UINT_PTR WPARAM
Definition: windef.h:207
bool _direction
Definition: window.h:959
String _statusText
Definition: window.h:332
#define WS_CHILD
Definition: pedump.c:617
static void CancelModes()
Definition: window.cpp:295
sorting of list controls
Definition: window.h:951
WCHAR classname[128]
Definition: startup.c:15
LONG left
Definition: windef.h:306
HICON HCURSOR
Definition: windef.h:299
int32_t INT_PTR
Definition: typedefs.h:62
static Window * create_controller(HWND hwnd)
create controller for a new window
Definition: window.cpp:220
dynamic casting of Window pointers
Definition: window.h:160
PictureButton(HWND hparent, int id, HBITMAP hBmp, HBRUSH hbrush=GetSysColorBrush(COLOR_BTNFACE), bool flat=false)
Definition: window.h:744
PFNLVCOMPARE _compare_fct
Definition: window.h:962
LONG right
Definition: windef.h:308
BOOL WINAPI IsIconic(_In_ HWND)
bool LaunchLink()
Definition: window.h:837
void Add(UINT id, int flags)
Definition: window.h:491
static void unregister_dialog(HWND hwnd)
Definition: window.cpp:614
#define VK_RETURN
Definition: winuser.h:2176
void add(HWND hparent, UINT id, const RECT &rect, LPCTSTR txt=LPSTR_TEXTCALLBACK, LPARAM lparam=0)
Definition: window.h:877
& rect
Definition: startmenu.cpp:1413
CHAR * LPTSTR
Definition: xmlstorage.h:192
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
Definition: window.h:1112
static Window * create_mdi_child(const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator)
Definition: window.cpp:118
SubclassedWindow super
Definition: window.h:1104
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
#define LVFI_PARAM
Definition: commctrl.h:2432
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
Definition: window.h:788
TrayIcon(HWND hparent, UINT id)
Definition: window.h:993
#define TTM_ADDTOOLA
Definition: commctrl.h:1782
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
Definition: window.cpp:760
~Dialog()
Definition: window.cpp:696
information structure for creation of a MDI child window
Definition: window.h:44
int WINAPI GetDlgCtrlID(_In_ HWND)
void HandleSize(int cx, int cy)
Definition: window.cpp:788
#define TTM_ACTIVATE
Definition: commctrl.h:1780
virtual void TrayClick(UINT id, int btn)
Definition: window.h:1094
String _cmd
Definition: window.h:825
int WINAPI SetBkMode(_In_ HDC, _In_ int)
Definition: dc.c:1032
Definition: window.c:28
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
Definition: window.cpp:865
int _flags
Definition: window.h:480
#define WM_CTLCOLORBTN
Definition: winuser.h:1751
OwnerdrawnButton super
Definition: window.h:719
COLORREF _colorVisited
Definition: window.h:829
void Remove()
Definition: window.h:1005
unsigned int BOOL
Definition: ntddk_ex.h:94
static LRESULT CALLBACK MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam)
Definition: window.cpp:142
void SetMinMaxInfo(LPMINMAXINFO lpmmi)
Definition: window.h:500
static INT_PTR CALLBACK DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
Definition: window.cpp:1411
OwnerDrawParent(HWND hwnd)
Definition: window.h:628
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#define ShellExecute
Definition: shellapi.h:689
PreTranslateWindow(HWND)
Definition: window.cpp:678
void DrawGrayText(HDC hdc, LPRECT pRect, LPCTSTR text, int dt_flags)
Definition: window.cpp:891
template class used in macro WINDOW_CREATOR to define the creater functions for Window objects
Definition: window.h:194
#define PM_FRM_CALC_CLIENT
Definition: window.h:387
#define WM_CTLCOLORSCROLLBAR
Definition: winuser.h:1753
#define TTF_IDISHWND
Definition: commctrl.h:1760
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
Definition: window.h:602
CHAR szTip[128]
Definition: shellapi.h:235
unsigned int idx
Definition: utils.c:41
FlatButton(HWND hwnd)
Definition: window.h:696
#define TRANSPARENT
Definition: wingdi.h:949
#define WINMSG_TASKBARCREATED
Definition: window.h:986
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:581
OwnerdrawnButton super
Definition: window.h:694
HTREEITEM hItem
Definition: treelist.h:37
static WindowSet s_pretranslate_windows
Definition: window.h:137
#define NIF_TIP
Definition: shellapi.h:104
smooth NULL
Definition: ftsmooth.c:416
#define PROPSHEETHEADER
Definition: prsht.h:374
static HWND hwndParent
Definition: cryptui.c:300
#define SM_CYSIZEFRAME
Definition: winuser.h:985
LONG cx
Definition: windef.h:334
#define WM_KEYDOWN
Definition: winuser.h:1697
LONG_PTR LPARAM
Definition: windef.h:208
#define SM_CYEDGE
Definition: winuser.h:999
virtual int Notify(int id, NMHDR *pnmh)
Definition: window.cpp:290
set< HWND > WindowSet
Definition: window.h:29
#define ListView_GetItemCount(hwnd)
Definition: commctrl.h:2303
static const WCHAR start_page[]
Definition: general.c:38
static HWND Create(CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0)
Definition: window.cpp:87
PictureButton(HWND hwnd, HBITMAP hBmp, HBRUSH hbrush=GetSysColorBrush(COLOR_BTNFACE), bool flat=false)
Definition: window.h:735
MenuInfo * _menu_info
Definition: window.h:322
static WND_CLASS * window_creator(HWND hwnd, const void *info)
Definition: window.h:209
ColorStatic(HWND hwnd, COLORREF textColor=RGB(255, 0, 0), HBRUSH hbrush_bkgnd=0, HFONT hfont=0)
Definition: window.h:771
void activate(BOOL active=TRUE)
Definition: window.h:856
NOTIFYICONDATAA NOTIFYICONDATA
Definition: shellapi.h:675
#define NIF_ICON
Definition: shellapi.h:103
PropSheetPage(UINT nid, Window::CREATORFUNC dlg_creator)
Definition: window.cpp:1306
Dialog super
Definition: window.h:427
CtlColorParent(HWND hwnd)
Definition: window.h:599
HFONT _hfont
Definition: window.h:810
BOOL WINAPI GetWindowPlacement(_In_ HWND, _Inout_ WINDOWPLACEMENT *)
static HFONT hfont
HBRUSH hbrBackground
Definition: winuser.h:3184
HCURSOR _crsr_link
Definition: window.h:831
#define WM_RBUTTONDOWN
Definition: winuser.h:1761
#define SM_CXSIZEFRAME
Definition: winuser.h:983
#define PM_TRAYICON
Definition: window.h:984
void remove(HWND hparent, HWND htool)
Definition: window.h:893
LPARAM lParam
Definition: treeview.c:155
virtual void AddTrayIcons()=0
#define _T(x)
Definition: vfdio.h:22
int ListView_FindItemPara(HWND list_ctrl, LPARAM param)
Definition: window.h:928
static HHOOK s_hcbtHook
Definition: window.h:133
COLORREF _textColor
Definition: window.h:828
#define SM_CYCAPTION
Definition: winuser.h:953
Definition: window.h:466
r parent
Definition: btrfs.c:2869
SIZE _min_wnd_size
Definition: window.h:506
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
SubclassedWindow super
Definition: window.h:769
#define GetStockBrush(i)
Definition: windowsx.h:282
#define WM_SIZE
Definition: winuser.h:1593
Definition: window.h:462
Controller base template class for resizable dialogs.
Definition: window.h:515
static const WCHAR url[]
Definition: encode.c:1432
DWORD COLORREF
Definition: windef.h:300
#define HOLLOW_BRUSH
Definition: wingdi.h:898
Hyperlink Controls.
Definition: window.h:816
GLfloat param
Definition: glext.h:5796
#define RGB(r, g, b)
Definition: wingdi.h:2939
RESIZE_FLAGS
Flags to specify how to move and resize controls when resizing their parent window.
Definition: window.h:455
HBITMAP _hBmp
Definition: window.h:757
window class with gray background color
Definition: window.h:248
Property Sheet dialog.
Definition: window.h:408
int WINAPI GetSystemMetrics(_In_ int)
WindowHandle super
Definition: window.h:852
unsigned long DWORD
Definition: ntddk_ex.h:95
static BOOL pretranslate_msg(LPMSG pmsg)
Definition: window.cpp:589
GLint left
Definition: glext.h:7726
static void unregister_pretranslate(HWND hwnd)
Definition: window.cpp:584
String _url
Definition: window.h:333
#define NIM_DELETE
Definition: shellapi.h:93
#define SIZE_MINIMIZED
Definition: winuser.h:2481
ATOM _atomClass
Definition: window.h:244
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
#define PM_DISPATCH_CTLCOLOR
Definition: window.h:593
HWND _hmdiclient
Definition: window.h:49
#define GetObject
Definition: wingdi.h:4467
Definition: _map.h:44
BITMAP bmp
Definition: alphablend.c:62
virtual void TrayMouseOver(UINT id)
Definition: window.h:1093
static ChildWindow * create(const ChildWndInfo &info, const RECT &rect, CREATORFUNC_INFO creator, LPCTSTR classname, LPCTSTR title=NULL, DWORD style=0)
Definition: window.cpp:369
GLbitfield flags
Definition: glext.h:7161
#define BASE
Definition: adler32.c:10
WindowClass(LPCTSTR classname, UINT style=0, WNDPROC wndproc=Window::WindowWndProc)
Definition: window.cpp:31
int _sort_crit
Definition: window.h:958
std::list< ResizeEntry > super
Definition: window.h:487
HWND hwndTreeView
Definition: eventvwr.c:82
CritSect _map_crit_sect
Definition: window.h:125
LRESULT PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0)
Definition: window.cpp:667
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
Definition: window.h:631
virtual LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
Definition: window.cpp:280
void set_url(LPCTSTR url)
Definition: window.cpp:567
HDC hdc
Definition: main.c:9
Property Sheet Page (inner dialog)
Definition: window.h:425
HyperlinkCtrl(HWND hwnd, COLORREF colorLink=RGB(0, 0, 255), COLORREF colorVisited=RGB(128, 0, 128))
Definition: window.cpp:1186
#define COLOR_BTNFACE
Definition: winuser.h:918
virtual int Command(int id, int code)
Definition: window.cpp:348
bool _flat
Definition: window.h:763
Definition: window.h:467
virtual void DrawItem(LPDRAWITEMSTRUCT dis)=0
Definition: window.h:461
IconWindowClass(LPCTSTR classname, UINT nid, UINT style=0, WNDPROC wndproc=Window::WindowWndProc)
Definition: window.cpp:47
#define WM_LBUTTONDBLCLK
Definition: winuser.h:1760
Window *(* CREATORFUNC_INFO)(HWND, const void *)
Definition: window.h:67
void add(HWND hparent, HWND htool, LPCTSTR txt=LPSTR_TEXTCALLBACK, LPARAM lparam=0)
Definition: window.h:861
ToolTip(HWND owner)
Definition: window.cpp:1265
#define false
Definition: stdbool.h:38
#define WM_MBUTTONDBLCLK
Definition: winuser.h:1766
int Command(int id, int code)
Definition: window.cpp:1451
PreTranslateWindow super
Definition: window.h:306
static int CALLBACK CompareFunc(LPARAM lparam1, LPARAM lparam2, LPARAM lparamSort)
#define WM_COMMAND
Definition: winuser.h:1722
SubclassedWindow super
Definition: window.h:818
ChildWndInfo(HWND hmdiclient)
Definition: window.h:46
virtual ~Window()
Definition: window.cpp:79
menu info structure
Definition: window.h:275
static WindowMap s_wnd_map
Definition: window.h:117
HWND _hparent
Definition: window.h:1017
#define BS_PUSHBUTTON
Definition: pedump.c:651
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
#define SelectFont(hdc, hfont)
Definition: windowsx.h:491
void sort()
Definition: window.cpp:1292
COLORREF _textColor
Definition: window.h:808
static CLASS * dyn_cast(Window *wnd)
Definition: window.h:162
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
Definition: window.cpp:1119
window class with specified icon from resources
Definition: window.h:258
#define RegisterWindowMessage
Definition: winuser.h:5815
#define TVITEM
Definition: commctrl.h:3361
LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
Definition: solitaire.cpp:598
PictureButton(HWND hparent, int id, HICON hIcon, HBRUSH hbrush=GetSysColorBrush(COLOR_BTNFACE), bool flat=false)
Definition: window.h:728
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2881
int Command(int id, int code)
Definition: window.cpp:765
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:888
ResizeEntry(UINT id, int flags)
Definition: window.h:473
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HWND WINAPI GetParent(_In_ HWND)
#define SS_SIMPLE
Definition: pedump.c:702
BASE super
Definition: window.h:597
UINT _id
Definition: window.h:479
static const void * s_new_info
Definition: window.h:119
#define SW_SHOWNORMAL
Definition: winuser.h:764
Window super
Definition: window.h:351
virtual void TrayDblClick(UINT id, int btn)
Definition: window.h:1095
static ATOM item
Definition: dde.c:856
const UINT WM_TASKBARCREATED
Definition: window.h:1098
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
Definition: window.cpp:388
virtual String jump_to_int(LPCTSTR url)=0
BtnWindowClass(LPCTSTR classname, UINT style=0, WNDPROC wndproc=Window::WindowWndProc)
Definition: window.h:250
Button(HWND parent, LPCTSTR text, int left, int top, int width, int height, int id, DWORD flags=WS_VISIBLE|WS_CHILD|BS_PUSHBUTTON, DWORD exStyle=0)
Definition: window.cpp:857
static void register_dialog(HWND hwnd)
Definition: window.cpp:609
HICON hIcon
Definition: msconfig.c:44
int DoModal(int start_page=0)
Definition: window.cpp:1338
Window::CREATORFUNC _dlg_creator
Definition: window.h:403
virtual void resize_children(int cx, int cy)
Definition: window.cpp:527
#define TTM_ADDTOOLW
Definition: commctrl.h:1783
Definition: bl.h:1331
Definition: window.h:371
#define WM_MBUTTONDOWN
Definition: winuser.h:1764
ResizeManager _resize_mgr
Definition: window.h:563
#define list
Definition: rosglue.h:35
static int MessageLoop()
Definition: window.cpp:629
int _split_pos
Definition: window.h:328
int(CALLBACK * PFNLVCOMPARE)(LPARAM, LPARAM, LPARAM)
Definition: commctrl.h:2696
int ListView_GetFocusedItem(HWND list_ctrl)
Definition: window.h:938
unsigned int UINT
Definition: ndis.h:50
#define WM_MOUSEMOVE
Definition: winuser.h:1757
#define LVFINDINFO
Definition: commctrl.h:2459
void Modify(HICON hIcon, LPCTSTR tooltip=NULL)
Definition: window.h:1002
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLint dx
Definition: linetemp.h:97
vector< PROPSHEETPAGE > Vector
Definition: window.h:418
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
Definition: window.h:525
static INT_PTR CALLBACK DialogProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
Definition: window.cpp:725
#define NIM_ADD
Definition: shellapi.h:91
~TrayIcon()
Definition: window.h:996
#define WM_DRAWITEM
Definition: winuser.h:1627
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
Definition: window.h:1051
#define TTF_TRANSPARENT
Definition: commctrl.h:1766
SIZE _last_size
Definition: window.h:510
OwnerdrawnButton(HWND hwnd)
Definition: window.h:660
RECT rcNormalPosition
Definition: winuser.h:3270
virtual LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
Definition: window.cpp:343
bool go_to(LPCTSTR url)
Definition: window.cpp:553
bool _active
Definition: window.h:708
ATOM Register()
Definition: window.h:230
HMENU _hMenuView
Definition: window.h:277
_Out_opt_ int * cx
Definition: commctrl.h:581
CritSect _create_crit_sect
Definition: window.h:126
#define ListView_FindItem(hwnd, iStart, plvfi)
Definition: commctrl.h:2466
#define ListView_GetItem(hwnd, pitem)
Definition: commctrl.h:2390
#define Shell_NotifyIcon
Definition: shellapi.h:687
#define SendMessage
Definition: winuser.h:5818
Window *(* CREATORFUNC)(HWND)
Definition: window.h:66
#define LVIF_PARAM
Definition: commctrl.h:2307
#define HINSTANCE_ERROR
Definition: winbase.h:509
#define WM_RBUTTONDBLCLK
Definition: winuser.h:1763
#define PM_DISPATCH_DRAWITEM
Definition: window.h:621
static struct myctx * mcs
Definition: adnstest.c:53
#define HIWORD(l)
Definition: typedefs.h:246
static int DoModal(UINT nid, CREATORFUNC creator, HWND hwndParent=0)
Definition: window.cpp:701
Static(HWND parent, LPCTSTR text, int left, int top, int width, int height, int id, DWORD flags=WS_VISIBLE|WS_CHILD|SS_SIMPLE, DWORD ex_flags=0)
Definition: window.cpp:875
GLenum GLuint id
Definition: glext.h:5579
static HINSTANCE hinst
Definition: edit.c:551
LONG bottom
Definition: windef.h:309
Window(HWND hwnd)
Definition: window.cpp:71
static BOOL dispatch_dialog_msg(LPMSG pmsg)
Definition: window.cpp:619
Window super
Definition: window.h:178
virtual int Command(int id, int code)
Definition: window.cpp:285
UINT _id
Definition: window.h:1018
#define COUNTOF(x)
Definition: utility.h:93
stack< String > _url_history
Definition: window.h:335
LRESULT SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0)
Definition: window.cpp:657
static HBITMAP
Definition: button.c:44
ResizeController(HWND hwnd)
Definition: window.h:519
virtual int Notify(int id, NMHDR *pnmh)
Definition: window.cpp:353
#define TVIF_PARAM
Definition: commctrl.h:3264
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
COLORREF _activeColor
Definition: window.h:707
int ListView_GetItemData(HWND list_ctrl, int idx)
Definition: window.h:915
void init(struct PropertySheetDialog *)
#define LPSTR_TEXTCALLBACK
Definition: commctrl.h:2379
LONG_PTR LRESULT
Definition: windef.h:209
LPARAM TreeView_GetItemData(HWND hwndTreeView, HTREEITEM hItem)
Definition: window.h:968
Arabic default style
Definition: afstyles.h:93
virtual void GetClientSpace(PRECT prect)
Definition: window.h:546
#define WS_VISIBLE
Definition: pedump.c:620
HBRUSH WINAPI GetSysColorBrush(_In_ int)
Definition: _set.h:46
encapsulation of tool tip controls
Definition: window.h:850
Dialog(HWND)
Definition: window.cpp:690
void Set(DWORD dwMessage, UINT id, HICON hIcon, LPCTSTR tooltip=NULL)
Definition: window.h:1020
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
LONG cy
Definition: windef.h:335
TrayIconControllerTemplate(HWND hwnd)
Definition: window.h:1046
SubclassedWindow super
Definition: window.h:658
void add(PropSheetPage &psp)
Definition: window.cpp:1333
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
Definition: window.cpp:1222
static char title[]
Definition: ps.c:92
#define WM_GETMINMAXINFO
Definition: winuser.h:1622
#define LOWORD(l)
Definition: pedump.c:82
#define TTF_SUBCLASS
Definition: commctrl.h:1763
static Window * get_window(HWND hwnd)
get window controller from window handle
Definition: window.cpp:203
void init()
Definition: window.cpp:1208
#define TreeView_GetItem(hwnd, pitem)
Definition: commctrl.h:3486
#define LVIS_FOCUSED
Definition: commctrl.h:2314
#define PROPSHEETPAGE
Definition: prsht.h:371
#define TTM_DELTOOL
Definition: commctrl.h:1836
#define NIM_MODIFY
Definition: shellapi.h:92
HFONT _hfont
Definition: window.h:830
void toggle_sort(int idx)
Definition: window.cpp:1282
static UINT WPARAM wparam
Definition: combo.c:716
#define lstrcpyn
Definition: winbase.h:3709
void Add(HWND hwnd, int flags)
Definition: window.h:494
void Resize(int dx, int dy)
Definition: window.cpp:847
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
Definition: window.h:572
SubclassedWindow(HWND)
Definition: window.cpp:301