ReactOS  0.4.14-dev-376-gaedba84
group.c File Reference
#include "progman.h"
Include dependency graph for group.c:

Go to the source code of this file.

Typedefs

typedef HRESULT(WINAPIETDTProc) (HWND, DWORD)
 
typedef HRESULT(WINAPISWTProc) (HWND, LPCWSTR, LPCWSTR)
 

Functions

static BOOL InitUxTheme (VOID)
 
HRESULT WINAPI EnableThemeDialogTexture (_In_ HWND hwnd, _In_ DWORD dwFlags)
 
HRESULT WINAPI SetWindowTheme (_In_ HWND hwnd, _In_ LPCWSTR pszSubAppName, _In_ LPCWSTR pszSubIdList)
 
static LRESULT CALLBACK GROUP_GroupWndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
ATOM GROUP_RegisterGroupWinClass (VOID)
 
VOID GROUP_NewGroup (GROUPFORMAT format, BOOL bIsCommonGroup)
 
PROGGROUPGROUP_AddGroup (GROUPFORMAT format, BOOL bIsCommonGroup, LPCWSTR lpszName, LPCWSTR lpszGrpFile, INT left, INT top, INT right, INT bottom, INT xMin, INT yMin, INT nCmdShow, WORD cxIcon, WORD cyIcon, BOOL bOverwriteFileOk, BOOL bSuppressShowWindow)
 
VOID GROUP_ModifyGroup (PROGGROUP *hGroup)
 
VOID GROUP_DeleteGroup (PROGGROUP *hGroup)
 
VOID GROUP_ShowGroupWindow (PROGGROUP *hGroup)
 
PROGGROUPGROUP_ActiveGroup (VOID)
 

Variables

static HMODULE hUxTheme = NULL
 
static ETDTProc fnEnableThemeDialogTexture = NULL
 
static SWTProc fnSetWindowTheme = NULL
 

Typedef Documentation

◆ ETDTProc

typedef HRESULT(WINAPI* ETDTProc) (HWND, DWORD)

Definition at line 40 of file group.c.

◆ SWTProc

typedef HRESULT(WINAPI* SWTProc) (HWND, LPCWSTR, LPCWSTR)

Definition at line 43 of file group.c.

Function Documentation

◆ EnableThemeDialogTexture()

HRESULT WINAPI EnableThemeDialogTexture ( _In_ HWND  hwnd,
_In_ DWORD  dwFlags 
)

Definition at line 81 of file group.c.

83 {
84  if (!InitUxTheme())
86 
89 
91 }
static BOOL InitUxTheme(VOID)
Definition: group.c:48
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
static ETDTProc fnEnableThemeDialogTexture
Definition: group.c:41

◆ GROUP_ActiveGroup()

PROGGROUP* GROUP_ActiveGroup ( VOID  )

Definition at line 671 of file group.c.

672 {
673  return Globals.hActiveGroup;
674 }
CLIPBOARD_GLOBALS Globals
Definition: clipbrd.c:13

Referenced by DIALOG_NEW_DlgProc(), MAIN_MainWndProc(), and MAIN_MenuCommand().

◆ GROUP_AddGroup()

PROGGROUP* GROUP_AddGroup ( GROUPFORMAT  format,
BOOL  bIsCommonGroup,
LPCWSTR  lpszName,
LPCWSTR  lpszGrpFile,
INT  left,
INT  top,
INT  right,
INT  bottom,
INT  xMin,
INT  yMin,
INT  nCmdShow,
WORD  cxIcon,
WORD  cyIcon,
BOOL  bOverwriteFileOk,
BOOL  bSuppressShowWindow 
)

Definition at line 435 of file group.c.

440 {
441  PROGGROUP* hGroup;
442  PROGGROUP* hPrior;
443  PROGGROUP** p;
444  LPWSTR hName;
445  LPWSTR hGrpFile;
446  LPCWSTR GroupFileName;
447  INT skip;
448  INT width;
449  INT height;
450  INT seqnum;
452  WINDOWPLACEMENT WndPl;
453 
454  WndPl.length = sizeof(WndPl);
455 
456  // FIXME: Use system default position in case we don't place the window at a given (x,y) coordinate.
457 
458  if (bIsCommonGroup)
459  {
460  if (swscanf(lpszGrpFile,
461  L"%d %d %d %d %d %d %d %n",
462  &WndPl.rcNormalPosition.left,
463  &WndPl.rcNormalPosition.top,
464  &WndPl.rcNormalPosition.right,
465  &WndPl.rcNormalPosition.bottom,
466  &WndPl.ptMinPosition.x,
467  &WndPl.ptMinPosition.y,
468  &WndPl.showCmd,
469  &skip) == 7)
470  {
471  WndPl.flags = WPF_SETMINPOSITION;
474  GroupFileName = &lpszGrpFile[skip];
475  }
476  else
477  {
478 #if 0 // FIXME!
481  WndPl.rcNormalPosition.right = 0;
482  WndPl.rcNormalPosition.bottom = 0;
485  WndPl.showCmd = SW_SHOWNORMAL;
486  GroupFileName = lpszGrpFile;
487 #else
488  WndPl.flags = WPF_SETMINPOSITION;
489  WndPl.ptMinPosition.x = xMin;
490  WndPl.ptMinPosition.y = yMin;
491  WndPl.rcNormalPosition.left = left;
492  WndPl.rcNormalPosition.top = top;
493  WndPl.rcNormalPosition.right = right;
495  width = right - left;
496  height = bottom - top;
497  WndPl.showCmd = nCmdShow;
498  GroupFileName = lpszGrpFile;
499 #endif
500  }
501  }
502  else
503  {
504  WndPl.flags = WPF_SETMINPOSITION;
505  WndPl.ptMinPosition.x = xMin;
506  WndPl.ptMinPosition.y = yMin;
507  WndPl.rcNormalPosition.left = left;
508  WndPl.rcNormalPosition.top = top;
509  WndPl.rcNormalPosition.right = right;
511  width = right - left;
512  height = bottom - top;
513  WndPl.showCmd = nCmdShow;
514  GroupFileName = lpszGrpFile;
515  }
516 
517  hGroup = Alloc(HEAP_ZERO_MEMORY, sizeof(*hGroup));
518  hName = Alloc(HEAP_ZERO_MEMORY, (wcslen(lpszName) + 1) * sizeof(WCHAR));
519  hGrpFile = Alloc(HEAP_ZERO_MEMORY, (wcslen(GroupFileName) + 1) * sizeof(WCHAR));
520  if (!hGroup || !hName || !hGrpFile)
521  {
523  if (hGroup) Free(hGroup);
524  if (hName) Free(hName);
525  if (hGrpFile) Free(hGrpFile);
526  return NULL;
527  }
528  memcpy(hName , lpszName , (wcslen(lpszName) + 1) * sizeof(WCHAR));
529  memcpy(hGrpFile, GroupFileName, (wcslen(GroupFileName) + 1) * sizeof(WCHAR));
530 
531  Globals.hActiveGroup = hGroup;
532 
533  seqnum = 1;
534  hPrior = NULL;
535  for (p = &Globals.hGroups; *p; p = &hPrior->hNext)
536  {
537  hPrior = *p;
538  if (hPrior->seqnum >= seqnum)
539  seqnum = hPrior->seqnum + 1;
540  }
541  *p = hGroup;
542 
543  hGroup->hPrior = hPrior;
544  hGroup->hNext = NULL;
545  hGroup->format = format;
546  hGroup->bIsCommonGroup = bIsCommonGroup;
547  hGroup->hName = hName;
548  hGroup->hGrpFile = hGrpFile;
549  hGroup->bOverwriteFileOk = bOverwriteFileOk;
550  hGroup->seqnum = seqnum;
551  hGroup->nCmdShow = nCmdShow;
552 #if 0
553  hGroup->x = x;
554  hGroup->y = y;
555  hGroup->width = width;
556  hGroup->height = height;
557 #endif
558  hGroup->iconx = cxIcon;
559  hGroup->icony = cyIcon;
560  hGroup->hPrograms = NULL;
561  hGroup->hActiveProgram = NULL;
562  hGroup->TagsSize = 0;
563  hGroup->Tags = NULL;
564 
566  mcs.szTitle = lpszName;
567  mcs.hOwner = NULL;
568  mcs.x = WndPl.rcNormalPosition.left;
569  mcs.y = WndPl.rcNormalPosition.top;
570  mcs.cx = width;
571  mcs.cy = height;
572  mcs.style = 0;
573  mcs.lParam = (LPARAM)hGroup;
574 
575  hGroup->hWnd = (HWND)SendMessageW(Globals.hMDIWnd, WM_MDICREATE, 0, (LPARAM)&mcs);
576 
577  SetWindowPlacement(hGroup->hWnd, &WndPl);
578 
579 #if 1
580  if (!bSuppressShowWindow) /* FIXME shouldn't be necessary */
581 #endif
582  UpdateWindow(hGroup->hWnd);
583 
584  return hGroup;
585 }
GLint GLint GLsizei width
Definition: gl.h:1546
long y
Definition: polytest.cpp:48
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
long x
Definition: polytest.cpp:48
INT seqnum
Definition: progman.h:130
INT icony
Definition: progman.h:137
INT height
Definition: progman.h:135
PROGGROUP * hPrior
Definition: progman.h:114
INT iconx
Definition: progman.h:136
BOOL WINAPI UpdateWindow(_In_ HWND)
LONG top
Definition: windef.h:292
HANDLE HWND
Definition: compat.h:13
HWND hWnd
Definition: progman.h:116
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define IDS_OUT_OF_MEMORY
Definition: resource.h:63
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
LPWSTR hGrpFile
Definition: progman.h:129
BOOL WINAPI SetWindowPlacement(_In_ HWND hWnd, _In_ const WINDOWPLACEMENT *)
int32_t INT
Definition: typedefs.h:56
GROUPFORMAT format
Definition: progman.h:125
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION Free
Definition: exfuncs.h:656
CLIPBOARD_GLOBALS Globals
Definition: clipbrd.c:13
SIZE_T TagsSize
Definition: progman.h:142
LPWSTR hName
Definition: progman.h:138
#define CW_USEDEFAULT
Definition: winuser.h:225
PROGGROUP * hNext
Definition: progman.h:115
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
GLint GLint bottom
Definition: glext.h:7726
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define WPF_SETMINPOSITION
Definition: winuser.h:2508
PVOID Alloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
Definition: main.c:63
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
static const WCHAR L[]
Definition: oid.c:1250
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
INT width
Definition: progman.h:134
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
POINT ptMinPosition
Definition: winuser.h:3267
#define SW_SHOWNORMAL
Definition: winuser.h:764
PROGRAM * hActiveProgram
Definition: progman.h:140
#define STRING_GROUP_WIN_CLASS_NAME
Definition: progman.h:252
INT nCmdShow
Definition: progman.h:131
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define MB_OK
Definition: winuser.h:784
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define WM_MDICREATE
Definition: winuser.h:1794
#define skip(...)
Definition: atltest.h:64
RECT rcNormalPosition
Definition: winuser.h:3269
#define IDS_ERROR
Definition: resource.h:18
static struct myctx * mcs
Definition: adnstest.c:53
BOOL bIsCommonGroup
Definition: progman.h:126
LONG bottom
Definition: windef.h:294
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
PVOID Tags
Definition: progman.h:143
GLfloat GLfloat p
Definition: glext.h:8902
WCHAR * LPWSTR
Definition: xmlstorage.h:184
BOOL bOverwriteFileOk
Definition: progman.h:128
PROGRAM * hPrograms
Definition: progman.h:139
_Check_return_ _CRTIMP int __cdecl swscanf(_In_z_ const wchar_t *_Src, _In_z_ _Scanf_format_string_ const wchar_t *_Format,...)
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
INT MAIN_MessageBoxIDS(UINT ids_text, UINT ids_title, WORD type)
Definition: main.c:1159

Referenced by GROUP_NewGroup().

◆ GROUP_DeleteGroup()

VOID GROUP_DeleteGroup ( PROGGROUP hGroup)

Definition at line 627 of file group.c.

628 {
629  if (Globals.hActiveGroup == hGroup)
630  Globals.hActiveGroup = NULL;
631 
632  if (hGroup->hPrior)
633  hGroup->hPrior->hNext = hGroup->hNext;
634  else
635  Globals.hGroups = hGroup->hNext;
636 
637  if (hGroup->hNext)
638  hGroup->hNext->hPrior = hGroup->hPrior;
639 
640  while (hGroup->hPrograms)
642 
643  /* FIXME Update progman.ini */
644 
645  SendMessageW(Globals.hMDIWnd, WM_MDIDESTROY, (WPARAM)hGroup->hWnd, 0);
646 
647  if (hGroup->Tags)
648  Free(hGroup->Tags);
649  Free(hGroup->hName);
650  Free(hGroup->hGrpFile);
651  Free(hGroup);
652 }
PROGGROUP * hPrior
Definition: progman.h:114
HWND hWnd
Definition: progman.h:116
UINT_PTR WPARAM
Definition: windef.h:207
LPWSTR hGrpFile
Definition: progman.h:129
VOID PROGRAM_DeleteProgram(PROGRAM *hProgram, BOOL bUpdateGrpFile)
Definition: program.c:289
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION Free
Definition: exfuncs.h:656
CLIPBOARD_GLOBALS Globals
Definition: clipbrd.c:13
LPWSTR hName
Definition: progman.h:138
PROGGROUP * hNext
Definition: progman.h:115
smooth NULL
Definition: ftsmooth.c:416
#define WM_MDIDESTROY
Definition: winuser.h:1795
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
PVOID Tags
Definition: progman.h:143
PROGRAM * hPrograms
Definition: progman.h:139

Referenced by MAIN_MenuCommand().

◆ GROUP_GroupWndProc()

static LRESULT CALLBACK GROUP_GroupWndProc ( HWND  hWnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 117 of file group.c.

118 {
119  PROGGROUP* group;
120  INT iItem;
121  LVITEMW lvItem;
122  POINT pt;
123 
125 
126  switch (uMsg)
127  {
128  case WM_NCCREATE:
129  {
132  group = (PROGGROUP*)pMDIcs->lParam;
134 
135  if (group->bIsCommonGroup)
136  {
137  DefMDIChildProcW(hWnd, WM_SETICON, ICON_BIG,
138  (LPARAM)CopyImage(Globals.hCommonGroupIcon,
139  IMAGE_ICON,
143  DefMDIChildProcW(hWnd, WM_SETICON, ICON_SMALL,
144  (LPARAM)CopyImage(Globals.hCommonGroupIcon,
145  IMAGE_ICON,
149  }
150  else
151  {
152  DefMDIChildProcW(hWnd, WM_SETICON, ICON_BIG,
153  (LPARAM)CopyImage(Globals.hPersonalGroupIcon,
154  IMAGE_ICON,
158  DefMDIChildProcW(hWnd, WM_SETICON, ICON_SMALL,
159  (LPARAM)CopyImage(Globals.hPersonalGroupIcon,
160  IMAGE_ICON,
164  }
165  break;
166  }
167 
168  case WM_NCDESTROY:
169  SetWindowLongPtrW(hWnd, 0, 0);
170  break;
171 
172  case WM_CREATE:
173  {
174  DWORD dwStyle;
175  RECT rect;
177  group->hListView = CreateWindowW(WC_LISTVIEW,
178  NULL,
180  0, 0,
181  rect.right - rect.left,
182  rect.bottom - rect.top,
183  hWnd,
184  NULL,
186  NULL);
187  dwStyle = (GetWindowLongPtrW(group->hListView, GWL_STYLE) | LVS_SHOWSELALWAYS) & ~LVS_AUTOARRANGE;
188  SetWindowLongPtrW(group->hListView, GWL_STYLE, dwStyle);
191  InitUxTheme();
192  SetWindowTheme(group->hListView, L"Explorer", NULL);
194  SendMessageA(group->hListView, LVM_SETIMAGELIST, 0, (LPARAM)group->hListLarge);
195  SendMessageA(group->hListView, LVM_SETICONSPACING, 0, MAKELPARAM(80, 64));
196  break;
197  }
198 
199  case WM_DESTROY:
200  {
201  SendMessageA(group->hListView, LVM_SETIMAGELIST, 0, 0);
202  ImageList_Destroy(group->hListLarge);
203  DestroyWindow(group->hListView);
204  break;
205  }
206 
207  case WM_SIZE:
208  {
209  RECT rect;
210  rect.left = 0;
211  rect.top = 0;
212  rect.right = LOWORD(lParam);
213  rect.bottom = HIWORD(lParam);
215  MoveWindow(group->hListView, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, TRUE);
216  break;
217  }
218 
219  case WM_CLOSE:
221  break;
222 
223  case WM_SYSCOMMAND:
224  if (wParam == SC_CLOSE) wParam = SC_MINIMIZE;
225  break;
226 
227  case WM_CHILDACTIVATE:
228  case WM_NCLBUTTONDOWN:
229  Globals.hActiveGroup = (PROGGROUP*)GetWindowLongPtrW(hWnd, 0);
230  Globals.hActiveGroup->hActiveProgram = NULL;
231  break;
232 
233  case WM_NOTIFY:
234  switch (((LPNMHDR)lParam)->code)
235  {
236  case NM_CLICK:
237  {
238  iItem = ((LPNMITEMACTIVATE)lParam)->iItem;
239  if (iItem == -1)
240  {
241  group->hActiveProgram = NULL;
242  break;
243  }
244 
245  lvItem.mask = LVIF_PARAM;
246  lvItem.iItem = iItem;
247  SendMessageW(group->hListView, LVM_GETITEMW, 0, (LPARAM)&lvItem);
248  group->hActiveProgram = (PROGRAM*)lvItem.lParam;
249  break;
250  }
251 
252  case NM_DBLCLK:
253  {
254  iItem = ((LPNMITEMACTIVATE)lParam)->iItem;
255  if (iItem == -1)
256  break;
257 
258  lvItem.mask = LVIF_PARAM;
259  lvItem.iItem = iItem;
260  SendMessageW(group->hListView, LVM_GETITEMW, 0, (LPARAM)&lvItem);
261  /* ... or use group->hActiveProgram */
263  break;
264  }
265 
266  case LVN_BEGINDRAG:
267  {
268  POINT ptMin;
269 
270  BOOL bFirst = TRUE;
271  for (iItem = SendMessageA(group->hListView, LVM_GETNEXTITEM, -1, LVNI_SELECTED);
272  iItem != -1;
273  iItem = SendMessageA(group->hListView, LVM_GETNEXTITEM, iItem, LVNI_SELECTED))
274  {
275  if (bFirst)
276  {
277  group->hDragImageList = (HIMAGELIST)SendMessageA(group->hListView,
279  iItem,
280  (LPARAM)&pt);
281  ptMin = pt;
282  bFirst = FALSE;
283  }
284  else
285  {
286  HIMAGELIST hOneImageList, hTempImageList;
287 
288  hOneImageList = (HIMAGELIST)SendMessageA(group->hListView,
290  iItem,
291  (LPARAM)&pt);
292  hTempImageList = ImageList_Merge(group->hDragImageList,
293  0,
294  hOneImageList,
295  0,
296  pt.x - ptMin.x,
297  pt.y - ptMin.y);
298  ImageList_Destroy(group->hDragImageList);
299  ImageList_Destroy(hOneImageList);
300  group->hDragImageList = hTempImageList;
301  ptMin.x = min(ptMin.x, pt.x);
302  ptMin.y = min(ptMin.y, pt.y);
303  }
304  }
305  // pt = ((LPNMLISTVIEW)lParam)->ptAction;
306  pt.x = ((LPNMLISTVIEW)lParam)->ptAction.x;
307  pt.y = ((LPNMLISTVIEW)lParam)->ptAction.y;
308  group->ptStart = pt;
309  pt.x -= ptMin.x;
310  pt.y -= ptMin.y;
311  ImageList_BeginDrag(group->hDragImageList, 0, pt.x, pt.y);
312  MapWindowPoints(group->hListView, Globals.hMDIWnd, &pt, 1);
313  ImageList_DragEnter(Globals.hMDIWnd, pt.x, pt.y);
314  group->bDragging = TRUE;
315  group->hOldCursor = GetCursor();
316  SetCapture(group->hWnd);
317 
318  break;
319  }
320  }
321  break;
322 
323  case WM_MOUSEMOVE:
324  if (group->bDragging)
325  {
326  pt.x = GET_X_LPARAM(lParam);
327  pt.y = GET_Y_LPARAM(lParam);
328  MapWindowPoints(group->hWnd, Globals.hMDIWnd, &pt, 1);
329  ImageList_DragMove(pt.x, pt.y);
330  }
331  break;
332 
333  case WM_LBUTTONUP:
334  if (group->bDragging)
335  {
336  // LVHITTESTINFO lvhti;
337  POINT ptHit;
338 
339  group->bDragging = FALSE;
340  ImageList_DragLeave(Globals.hMDIWnd);
342  ImageList_Destroy(group->hDragImageList);
343  ReleaseCapture();
344  SetCursor(group->hOldCursor);
345  ptHit.x = GET_X_LPARAM(lParam);
346  ptHit.y = GET_Y_LPARAM(lParam);
347  MapWindowPoints(group->hWnd, group->hListView, &ptHit, 1);
348  for (iItem = SendMessageA(group->hListView, LVM_GETNEXTITEM, -1, LVNI_SELECTED);
349  iItem != -1;
350  iItem = SendMessageA(group->hListView, LVM_GETNEXTITEM, iItem, LVNI_SELECTED))
351  {
352  SendMessageA(group->hListView, LVM_GETITEMPOSITION, iItem, (LPARAM)&pt);
353  pt.x += ptHit.x - group->ptStart.x;
354  pt.y += ptHit.y - group->ptStart.y;
355  SendMessageA(group->hListView, LVM_SETITEMPOSITION, iItem, MAKELPARAM(pt.x, pt.y));
356  }
357  }
358  break;
359  }
360 
361  return DefMDIChildProcW(hWnd, uMsg, wParam, lParam);
362 }
#define WM_NCLBUTTONDOWN
Definition: winuser.h:1674
struct tagMDICREATESTRUCTW * LPMDICREATESTRUCTW
static BOOL InitUxTheme(VOID)
Definition: group.c:48
#define TRUE
Definition: types.h:120
#define IMAGE_ICON
Definition: winuser.h:212
#define LVN_BEGINDRAG
Definition: commctrl.h:3136
long y
Definition: polytest.cpp:48
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
long x
Definition: polytest.cpp:48
#define LVS_SHOWSELALWAYS
Definition: commctrl.h:2263
#define pt(x, y)
Definition: drawing.c:79
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define MAKELPARAM(l, h)
Definition: winuser.h:3947
BOOL WINAPI ImageList_DragMove(INT x, INT y)
Definition: imagelist.c:1070
HWND hWnd
Definition: settings.c:17
LRESULT WINAPI DefMDIChildProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define GET_X_LPARAM(lp)
Definition: windowsx.h:274
BOOL WINAPI AdjustWindowRectEx(_Inout_ LPRECT, _In_ DWORD, _In_ BOOL, _In_ DWORD)
#define GWL_EXSTYLE
Definition: winuser.h:845
#define SM_CYSMICON
Definition: winuser.h:1003
HCURSOR WINAPI GetCursor(void)
Definition: cursoricon.c:2649
#define LVNI_SELECTED
Definition: commctrl.h:2420
#define WS_CHILD
Definition: pedump.c:617
#define LVM_SETICONSPACING
Definition: commctrl.h:2717
#define GetWindowLongPtrW
Definition: winuser.h:4730
#define LVM_CREATEDRAGIMAGE
Definition: commctrl.h:2648
VOID WINAPI ImageList_EndDrag(void)
Definition: imagelist.c:1847
#define WM_NCCREATE
Definition: winuser.h:1665
BOOL WINAPI DestroyWindow(_In_ HWND)
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4217
int32_t INT
Definition: typedefs.h:56
& rect
Definition: startmenu.cpp:1413
WPARAM wParam
Definition: combotst.c:138
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
#define ICON_SMALL
Definition: tnclass.cpp:48
CLIPBOARD_GLOBALS Globals
Definition: clipbrd.c:13
BOOL WINAPI ImageList_DragEnter(HWND hwndLock, INT x, INT y)
Definition: imagelist.c:958
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
unsigned int BOOL
Definition: ntddk_ex.h:94
#define WM_CHILDACTIVATE
Definition: winuser.h:1620
#define LVS_EX_SNAPTOGRID
Definition: commctrl.h:2744
LPARAM lParam
Definition: commctrl.h:2364
HANDLE WINAPI CopyImage(_In_ HANDLE, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:1956
#define SM_CXICON
Definition: winuser.h:962
VOID PROGRAM_ExecuteProgram(PROGRAM *hProgram)
Definition: program.c:274
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define LVS_AUTOARRANGE
Definition: commctrl.h:2268
struct tagNMITEMACTIVATE * LPNMITEMACTIVATE
#define WM_DESTROY
Definition: winuser.h:1591
HIMAGELIST WINAPI ImageList_Merge(HIMAGELIST himl1, INT i1, HIMAGELIST himl2, INT i2, INT dx, INT dy)
Definition: imagelist.c:2300
GLboolean GLuint group
Definition: glext.h:11120
#define LVS_EX_BORDERSELECT
Definition: commctrl.h:2740
#define WS_OVERLAPPED
Definition: pedump.c:615
#define LVM_SETITEMPOSITION
Definition: commctrl.h:2476
#define WM_SIZE
Definition: winuser.h:1593
#define ILC_COLOR24
Definition: commctrl.h:353
#define WM_CLOSE
Definition: winuser.h:1603
#define WM_NCDESTROY
Definition: winuser.h:1666
int WINAPI GetSystemMetrics(_In_ int)
unsigned long DWORD
Definition: ntddk_ex.h:95
#define LVM_SETEXTENDEDLISTVIEWSTYLE
Definition: commctrl.h:2720
UINT mask
Definition: commctrl.h:2356
#define SM_CXSMICON
Definition: winuser.h:1002
BOOL WINAPI ImageList_BeginDrag(HIMAGELIST himlTrack, INT iTrack, INT dxHotspot, INT dyHotspot)
Definition: imagelist.c:638
#define SM_CYICON
Definition: winuser.h:963
static const WCHAR L[]
Definition: oid.c:1250
LPVOID lpCreateParams
Definition: winuser.h:2929
struct _IMAGELIST * HIMAGELIST
Definition: commctrl.h:320
#define ILC_MASK
Definition: commctrl.h:347
#define NM_CLICK
Definition: commctrl.h:130
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
#define LVM_GETEXTENDEDLISTVIEWSTYLE
Definition: commctrl.h:2723
#define SC_MINIMIZE
Definition: winuser.h:2561
#define GWL_STYLE
Definition: winuser.h:846
#define LVM_SETIMAGELIST
Definition: commctrl.h:2299
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HWND WINAPI SetCapture(_In_ HWND hWnd)
#define LR_COPYFROMRESOURCE
Definition: winuser.h:1089
BOOL WINAPI ImageList_DragLeave(HWND hwndLock)
Definition: imagelist.c:992
#define NM_DBLCLK
Definition: commctrl.h:131
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
struct tagNMLISTVIEW * LPNMLISTVIEW
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_LBUTTONUP
Definition: winuser.h:1759
struct tagCREATESTRUCTW * LPCREATESTRUCTW
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define min(a, b)
Definition: monoChain.cc:55
#define WM_MOUSEMOVE
Definition: winuser.h:1757
#define GET_Y_LPARAM(lp)
Definition: windowsx.h:275
#define WC_LISTVIEW
Definition: commctrl.h:2255
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2888
#define SC_CLOSE
Definition: winuser.h:2567
#define LVM_GETITEMW
Definition: commctrl.h:2386
#define LVIF_PARAM
Definition: commctrl.h:2307
#define WM_CREATE
Definition: winuser.h:1590
#define HIWORD(l)
Definition: typedefs.h:246
#define SetWindowLongPtrW
Definition: winuser.h:5247
HINSTANCE hInstance
Definition: precomp.h:43
#define LVM_GETNEXTITEM
Definition: commctrl.h:2429
#define WS_VISIBLE
Definition: pedump.c:620
#define WM_SYSCOMMAND
Definition: winuser.h:1723
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define LVM_GETITEMPOSITION
Definition: commctrl.h:2479
#define WM_NOTIFY
Definition: richedit.h:61
#define ICON_BIG
Definition: tnclass.cpp:51
HRESULT WINAPI SetWindowTheme(_In_ HWND hwnd, _In_ LPCWSTR pszSubAppName, _In_ LPCWSTR pszSubIdList)
Definition: group.c:95

Referenced by GROUP_RegisterGroupWinClass().

◆ GROUP_ModifyGroup()

VOID GROUP_ModifyGroup ( PROGGROUP hGroup)

Definition at line 596 of file group.c.

597 {
598  WCHAR Dest[MAX_PATHNAME_LEN]; // szName
599  WCHAR szGrpFile[MAX_PATHNAME_LEN]; // szFile
600 
601  wcsncpy(Dest, hGroup->hName, ARRAYSIZE(Dest));
602  wcsncpy(szGrpFile, hGroup->hGrpFile, ARRAYSIZE(szGrpFile));
603 
604  if (!DIALOG_GroupAttributes(hGroup->format, Dest, szGrpFile, MAX_PATHNAME_LEN))
605  return;
606 
607  if (wcscmp(szGrpFile, hGroup->hGrpFile))
608  hGroup->bOverwriteFileOk = FALSE;
609 
610  MAIN_ReplaceString(&hGroup->hName, Dest);
611  MAIN_ReplaceString(&hGroup->hGrpFile, szGrpFile);
612 
613  GRPFILE_WriteGroupFile(hGroup);
614 
615  /* FIXME Delete old GrpFile if GrpFile changed */
616 
617  /* FIXME Update progman.ini */
618 
619  SetWindowTextW(hGroup->hWnd, Dest);
620 }
BOOL DIALOG_GroupAttributes(GROUPFORMAT format, LPWSTR lpszTitle, LPWSTR lpszGrpFile, INT nSize)
Definition: dialog.c:484
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
HWND hWnd
Definition: progman.h:116
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
LPWSTR hGrpFile
Definition: progman.h:129
GROUPFORMAT format
Definition: progman.h:125
LPWSTR hName
Definition: progman.h:138
BOOL GRPFILE_WriteGroupFile(PROGGROUP *hGroup)
Definition: grpfile.c:358
#define MAX_PATHNAME_LEN
Definition: progman.h:54
__wchar_t WCHAR
Definition: xmlstorage.h:180
VOID MAIN_ReplaceString(LPWSTR *string, LPWSTR replace)
Definition: main.c:1192
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_CRTIMP wchar_t *__cdecl wcsncpy(wchar_t *_Dest, const wchar_t *_Source, size_t _Count)
BOOL bOverwriteFileOk
Definition: progman.h:128

Referenced by MAIN_MenuCommand().

◆ GROUP_NewGroup()

VOID GROUP_NewGroup ( GROUPFORMAT  format,
BOOL  bIsCommonGroup 
)

Definition at line 392 of file group.c.

393 {
394  HANDLE hFile;
395  WCHAR szGrpFile[MAX_PATHNAME_LEN] = L"";
397 
398  // ZeroMemory(szTitle, sizeof(szTitle));
399  // ZeroMemory(szGrpFile, sizeof(szGrpFile));
400 
402  return;
403 
404  /*
405  * Just check whether the group file does exist. If it does, close the handle, because GRPFILE_ReadGroupFile will
406  * reopen the file for loading. If it doesn't exist, we create a new one.
407  */
410  {
411  /* File doesn't exist */
412  PROGGROUP* hGroup = GROUP_AddGroup(format, bIsCommonGroup, szTitle, szGrpFile,
415  0, 0, SW_SHOWNORMAL, 0, 0, FALSE, FALSE);
416  if (hGroup)
417  GRPFILE_WriteGroupFile(hGroup);
418  }
419  else
420  {
421  /* File exist */
423  GRPFILE_ReadGroupFile(szGrpFile, bIsCommonGroup);
424  }
425 
426  /* FIXME Update progman.ini */
427 }
#define DEF_GROUP_WIN_XPOS
Definition: progman.h:62
BOOL DIALOG_GroupAttributes(GROUPFORMAT format, LPWSTR lpszTitle, LPWSTR lpszGrpFile, INT nSize)
Definition: dialog.c:484
#define CloseHandle
Definition: compat.h:406
#define DEF_GROUP_WIN_YPOS
Definition: progman.h:63
DWORD GRPFILE_ReadGroupFile(LPCWSTR lpszPath, BOOL bIsCommonGroup)
Definition: grpfile.c:65
#define INVALID_HANDLE_VALUE
Definition: compat.h:399
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
#define FILE_SHARE_READ
Definition: compat.h:125
PROGGROUP * GROUP_AddGroup(GROUPFORMAT format, BOOL bIsCommonGroup, LPCWSTR lpszName, LPCWSTR lpszGrpFile, INT left, INT top, INT right, INT bottom, INT xMin, INT yMin, INT nCmdShow, WORD cxIcon, WORD cyIcon, BOOL bOverwriteFileOk, BOOL bSuppressShowWindow)
Definition: group.c:435
BOOL GRPFILE_WriteGroupFile(PROGGROUP *hGroup)
Definition: grpfile.c:358
smooth NULL
Definition: ftsmooth.c:416
#define MAX_PATHNAME_LEN
Definition: progman.h:54
#define OPEN_EXISTING
Definition: compat.h:434
#define DEF_GROUP_WIN_HEIGHT
Definition: progman.h:65
__wchar_t WCHAR
Definition: xmlstorage.h:180
TCHAR szTitle[MAX_LOADSTRING]
Definition: magnifier.c:35
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
static const WCHAR L[]
Definition: oid.c:1250
#define GENERIC_READ
Definition: compat.h:124
_In_ HANDLE hFile
Definition: mswsock.h:90
#define SW_SHOWNORMAL
Definition: winuser.h:764
#define CreateFileW
Definition: compat.h:408
#define DEF_GROUP_WIN_WIDTH
Definition: progman.h:64

Referenced by MAIN_MenuCommand().

◆ GROUP_RegisterGroupWinClass()

ATOM GROUP_RegisterGroupWinClass ( VOID  )

Definition at line 369 of file group.c.

370 {
371  WNDCLASSW wndClass;
372 
373  wndClass.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;
374  wndClass.lpfnWndProc = GROUP_GroupWndProc;
375  wndClass.cbClsExtra = 0;
376  wndClass.cbWndExtra = sizeof(LONG_PTR);
377  wndClass.hInstance = Globals.hInstance;
380  wndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
381  wndClass.lpszMenuName = NULL;
383 
384  return RegisterClassW(&wndClass);
385 }
#define LONG_PTR
Definition: treelist.c:79
UINT style
Definition: winuser.h:3150
LPCWSTR lpszMenuName
Definition: winuser.h:3158
static LRESULT CALLBACK GROUP_GroupWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: group.c:117
#define CS_HREDRAW
Definition: winuser.h:648
int cbClsExtra
Definition: winuser.h:3152
#define COLOR_WINDOW
Definition: winuser.h:908
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
CLIPBOARD_GLOBALS Globals
Definition: clipbrd.c:13
WNDPROC lpfnWndProc
Definition: winuser.h:3151
smooth NULL
Definition: ftsmooth.c:416
LPCWSTR lpszClassName
Definition: winuser.h:3159
#define CS_VREDRAW
Definition: winuser.h:653
int cbWndExtra
Definition: winuser.h:3153
HICON hIcon
Definition: winuser.h:3155
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2074
#define CS_DBLCLKS
Definition: winuser.h:646
HCURSOR hCursor
Definition: winuser.h:3156
#define STRING_GROUP_WIN_CLASS_NAME
Definition: progman.h:252
HBRUSH hbrBackground
Definition: winuser.h:3157
HINSTANCE hInstance
Definition: winuser.h:3154
#define IDI_GROUP_ICON
Definition: resource.h:43
#define IDC_ARROW
Definition: winuser.h:682
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HINSTANCE hInstance
Definition: precomp.h:43

Referenced by wWinMain().

◆ GROUP_ShowGroupWindow()

VOID GROUP_ShowGroupWindow ( PROGGROUP hGroup)

Definition at line 660 of file group.c.

661 {
662  ShowWindow(hGroup->hWnd, hGroup->nCmdShow);
663  UpdateWindow(hGroup->hWnd);
664 }
BOOL WINAPI UpdateWindow(_In_ HWND)
HWND hWnd
Definition: progman.h:116
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
INT nCmdShow
Definition: progman.h:131

◆ InitUxTheme()

static BOOL InitUxTheme ( VOID  )
static

Definition at line 48 of file group.c.

49 {
50  if (hUxTheme) return TRUE;
51 
52  hUxTheme = LoadLibraryW(L"uxtheme.dll");
53  if (hUxTheme == NULL) return FALSE;
54 
56  (ETDTProc)GetProcAddress(hUxTheme, "EnableThemeDialogTexture");
58  (SWTProc)GetProcAddress(hUxTheme, "SetWindowTheme");
59 
60  return TRUE;
61 }
static HMODULE hUxTheme
Definition: group.c:38
#define TRUE
Definition: types.h:120
#define LoadLibraryW(x)
Definition: compat.h:412
smooth NULL
Definition: ftsmooth.c:416
static SWTProc fnSetWindowTheme
Definition: group.c:44
HRESULT(WINAPI * ETDTProc)(HWND, DWORD)
Definition: group.c:40
static const WCHAR L[]
Definition: oid.c:1250
static ETDTProc fnEnableThemeDialogTexture
Definition: group.c:41
HRESULT(WINAPI * SWTProc)(HWND, LPCWSTR, LPCWSTR)
Definition: group.c:43
#define GetProcAddress(x, y)
Definition: compat.h:418

Referenced by EnableThemeDialogTexture(), GROUP_GroupWndProc(), and SetWindowTheme().

◆ SetWindowTheme()

HRESULT WINAPI SetWindowTheme ( _In_ HWND  hwnd,
_In_ LPCWSTR  pszSubAppName,
_In_ LPCWSTR  pszSubIdList 
)

Definition at line 95 of file group.c.

98 {
99  if (!InitUxTheme())
101 
102  if (!fnSetWindowTheme)
104 
105  return fnSetWindowTheme(hwnd, pszSubAppName, pszSubIdList);
106 }
static BOOL InitUxTheme(VOID)
Definition: group.c:48
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
static SWTProc fnSetWindowTheme
Definition: group.c:44

Referenced by GROUP_GroupWndProc().

Variable Documentation

◆ fnEnableThemeDialogTexture

ETDTProc fnEnableThemeDialogTexture = NULL
static

Definition at line 41 of file group.c.

Referenced by EnableThemeDialogTexture(), and InitUxTheme().

◆ fnSetWindowTheme

SWTProc fnSetWindowTheme = NULL
static

Definition at line 44 of file group.c.

Referenced by InitUxTheme(), and SetWindowTheme().

◆ hUxTheme

HMODULE hUxTheme = NULL
static

Definition at line 38 of file group.c.

Referenced by InitUxTheme().