ReactOS  0.4.12-dev-18-gf469aca
mainwnd.c File Reference
#include "precomp.h"
#include <windowsx.h>
Include dependency graph for mainwnd.c:

Go to the source code of this file.

Functions

static BOOL MainWndMenuHint (PMAIN_WND_INFO Info, WORD CmdId, const MENU_HINT *HintArray, DWORD HintsCount, UINT DefHintId)
 
static VOID UpdateMainStatusBar (PMAIN_WND_INFO Info)
 
VOID UpdateServiceCount (PMAIN_WND_INFO Info)
 
VOID SetMenuAndButtonStates (PMAIN_WND_INFO Info)
 
static INT CALLBACK CompareFunc (LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
 
static BOOL pCreateToolbar (PMAIN_WND_INFO Info)
 
static BOOL CreateStatusBar (PMAIN_WND_INFO Info)
 
static BOOL InitMainWnd (PMAIN_WND_INFO Info)
 
static VOID MainWndCommand (PMAIN_WND_INFO Info, WORD CmdId, HWND hControl)
 
static VOID CALLBACK MainWndResize (PMAIN_WND_INFO Info, WORD cx, WORD cy)
 
static LRESULT CALLBACK MainWndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
HWND CreateMainWindow (LPCTSTR lpCaption, int nCmdShow)
 
BOOL InitMainWindowImpl (VOID)
 
VOID UninitMainWindowImpl (VOID)
 

Variables

static const WCHAR szMainWndClass [] = L"ServManWndClass"
 
static const TBBUTTON Buttons []
 
static const MENU_HINT MainMenuHintTable []
 
static const MENU_HINT SystemMenuHintTable []
 

Function Documentation

◆ CompareFunc()

static INT CALLBACK CompareFunc ( LPARAM  lParam1,
LPARAM  lParam2,
LPARAM  lParamSort 
)
static

Definition at line 242 of file mainwnd.c.

Referenced by CLIPOBJ_cEnumStart(), and MainWndProc().

243 {
244  PMAIN_WND_INFO Info = (PMAIN_WND_INFO)lParamSort;
245  WCHAR Item1[256], Item2[256];
246 
247  ListView_GetItemText(Info->hListView, lParam1, Info->SortSelection, Item1, sizeof(Item1) / sizeof(WCHAR));
248  ListView_GetItemText(Info->hListView, lParam2, Info->SortSelection, Item2, sizeof(Item2) / sizeof(WCHAR));
249 
250  return wcscmp(Item1, Item2) * Info->SortDirection;
251 }
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define ListView_GetItemText(hwndLV, i, iSubItem_, pszText_, cchTextMax_)
Definition: commctrl.h:2654
struct TraceInfo Info
INT SortSelection
Definition: precomp.h:61
INT SortDirection
Definition: precomp.h:62
struct _MAIN_WND_INFO * PMAIN_WND_INFO
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
HWND hListView
Definition: precomp.h:49

◆ CreateMainWindow()

HWND CreateMainWindow ( LPCTSTR  lpCaption,
int  nCmdShow 
)

Definition at line 920 of file mainwnd.c.

Referenced by _tWinMain(), and wWinMain().

922 {
924  HWND hMainWnd = NULL;
925 
928  sizeof(MAIN_WND_INFO));
929 
930  if (Info != NULL)
931  {
932  Info->nCmdShow = nCmdShow;
933 
934  hMainWnd = CreateWindowEx(WS_EX_WINDOWEDGE,
936  lpCaption,
940  680,
941  450,
942  NULL,
943  NULL,
944  hInstance,
945  Info);
946  if (hMainWnd == NULL)
947  {
948  //int ret;
949  //ret = GetLastError();
950  GetError();
952  0,
953  Info);
954  }
955  }
956 
957  return hMainWnd;
958 }
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
static const WCHAR szMainWndClass[]
Definition: mainwnd.c:14
#define WS_EX_WINDOWEDGE
Definition: winuser.h:407
#define WS_CLIPCHILDREN
Definition: pedump.c:619
struct TraceInfo Info
VOID GetError(VOID)
Definition: misc.c:192
#define CreateWindowEx
Definition: winuser.h:5621
#define CW_USEDEFAULT
Definition: winuser.h:225
smooth NULL
Definition: ftsmooth.c:416
int nCmdShow
Definition: precomp.h:54
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HWND hMainWnd
Definition: magnifier.c:33
HANDLE ProcessHeap
Definition: servman.c:15
HINSTANCE hInstance
Definition: mainwnd.c:15
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ CreateStatusBar()

static BOOL CreateStatusBar ( PMAIN_WND_INFO  Info)
static

Definition at line 307 of file mainwnd.c.

Referenced by CMainWindow::CreateLayout(), and InitMainWnd().

308 {
309  INT StatWidths[] = {130, -1}; /* widths of status bar */
310 
311  Info->hStatus = CreateWindowEx(0,
313  NULL,
315  0, 0, 0, 0,
316  Info->hMainWnd,
318  hInstance,
319  NULL);
320  if(Info->hStatus == NULL)
321  return FALSE;
322 
323  SendMessage(Info->hStatus,
324  SB_SETPARTS,
325  sizeof(StatWidths) / sizeof(INT),
326  (LPARAM)StatWidths);
327 
328  return TRUE;
329 }
#define TRUE
Definition: types.h:120
#define IDC_STATUSBAR
Definition: resource.h:14
#define WS_CHILD
Definition: pedump.c:617
#define STATUSCLASSNAME
Definition: commctrl.h:1909
int32_t INT
Definition: typedefs.h:56
HWND hStatus
Definition: precomp.h:50
LONG_PTR LPARAM
Definition: windef.h:208
#define CreateWindowEx
Definition: winuser.h:5621
smooth NULL
Definition: ftsmooth.c:416
#define SBARS_SIZEGRIP
Definition: commctrl.h:1893
HINSTANCE hInstance
Definition: mainwnd.c:15
HWND hMainWnd
Definition: precomp.h:48
#define SB_SETPARTS
Definition: commctrl.h:1924
#define SendMessage
Definition: winuser.h:5709
#define WS_VISIBLE
Definition: pedump.c:620
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60

◆ InitMainWindowImpl()

BOOL InitMainWindowImpl ( VOID  )

Definition at line 961 of file mainwnd.c.

Referenced by _tWinMain(), and wWinMain().

962 {
963  WNDCLASSEX wc = {0};
964 
965  wc.cbSize = sizeof(WNDCLASSEX);
967  wc.hInstance = hInstance;
968  wc.hIcon = LoadIcon(hInstance,
970  wc.hCursor = LoadCursor(NULL,
971  IDC_ARROW);
972  wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
977  IMAGE_ICON,
978  16,
979  16,
980  LR_SHARED);
981 
982  return RegisterClassEx(&wc) != (ATOM)0;
983 }
static const WCHAR szMainWndClass[]
Definition: mainwnd.c:14
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define IDR_MAINMENU
Definition: resource.h:40
static HICON
Definition: imagelist.c:84
LPCSTR lpszMenuName
Definition: winuser.h:3163
#define LR_SHARED
Definition: winuser.h:1090
#define IMAGE_ICON
Definition: winuser.h:212
#define RegisterClassEx
Definition: winuser.h:5703
HCURSOR hCursor
Definition: winuser.h:3161
WNDPROC lpfnWndProc
Definition: winuser.h:3156
LPCSTR lpszClassName
Definition: winuser.h:3164
WORD ATOM
Definition: dimm.idl:113
HICON hIconSm
Definition: winuser.h:3165
HINSTANCE hInstance
Definition: winuser.h:3159
smooth NULL
Definition: ftsmooth.c:416
UINT cbSize
Definition: winuser.h:3154
HBRUSH hbrBackground
Definition: winuser.h:3162
HICON hIcon
Definition: winuser.h:3160
static LRESULT CALLBACK MainWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: mainwnd.c:636
#define COLOR_BTNFACE
Definition: winuser.h:918
#define LoadCursor
Definition: winuser.h:5678
HINSTANCE hInstance
Definition: mainwnd.c:15
#define IDI_SM_ICON
Definition: resource.h:66
#define IDC_ARROW
Definition: winuser.h:682
#define LoadImage
Definition: winuser.h:5681
WNDCLASSEXA WNDCLASSEX
Definition: winuser.h:5585
#define LoadIcon
Definition: winuser.h:5679

◆ InitMainWnd()

static BOOL InitMainWnd ( PMAIN_WND_INFO  Info)
static

Definition at line 333 of file mainwnd.c.

Referenced by MainWndProc().

334 {
335  if (!pCreateToolbar(Info))
336  {
337  DisplayString(L"error creating toolbar");
338  return FALSE;
339  }
340 
341  if (!CreateListView(Info))
342  {
343  DisplayString(L"error creating list view");
344  return FALSE;
345  }
346 
347  if (!CreateStatusBar(Info))
348  DisplayString(L"error creating status bar");
349 
350  /* Create Popup Menu */
353 
354  Info->bIsUserAnAdmin = TRUE;// IsUserAnAdmin();
355  if (Info->bIsUserAnAdmin)
356  {
357  HMENU hMainMenu = GetMenu(Info->hMainWnd);
358 
359  SendMessage(Info->hTool,
360  TB_SETSTATE,
361  ID_CREATE,
363  if (hMainMenu)
364  {
365  EnableMenuItem(hMainMenu,
366  ID_CREATE,
367  MF_ENABLED);
368  }
370  ID_CREATE,
371  MF_ENABLED);
372  }
373 
374  return TRUE;
375 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define TRUE
Definition: types.h:120
static BOOL CreateStatusBar(PMAIN_WND_INFO Info)
Definition: mainwnd.c:307
#define TB_SETSTATE
Definition: commctrl.h:1024
#define ID_CREATE
Definition: resource.h:26
HMENU hMainMenu
Definition: mplay32.c:19
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
LONG_PTR LPARAM
Definition: windef.h:208
#define MAKELONG(a, b)
Definition: typedefs.h:248
#define IDR_POPUP
Definition: resource.h:7
static BOOL pCreateToolbar(PMAIN_WND_INFO Info)
Definition: mainwnd.c:255
#define MF_ENABLED
Definition: winuser.h:128
static const WCHAR L[]
Definition: oid.c:1087
HWND hTool
Definition: precomp.h:51
HMENU hShortcutMenu
Definition: precomp.h:53
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
VOID DisplayString(LPWSTR Msg)
Definition: misc.c:211
BOOL bIsUserAnAdmin
Definition: precomp.h:66
#define LoadMenu
Definition: winuser.h:5683
HINSTANCE hInstance
Definition: mainwnd.c:15
HWND hMainWnd
Definition: precomp.h:48
BOOL CreateListView(PMAIN_WND_INFO Info)
Definition: listview.c:355
#define SendMessage
Definition: winuser.h:5709
#define TBSTATE_ENABLED
Definition: commctrl.h:944
HMENU WINAPI GetMenu(_In_ HWND)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60

◆ MainWndCommand()

static VOID MainWndCommand ( PMAIN_WND_INFO  Info,
WORD  CmdId,
HWND  hControl 
)
static

Definition at line 379 of file mainwnd.c.

Referenced by MainWndProc().

382 {
383  UNREFERENCED_PARAMETER(hControl);
384 
385  switch (CmdId)
386  {
387  case ID_PROP:
388  {
389  if (Info->SelectedItem != NO_ITEM_SELECTED)
390  {
391  Info->bDlgOpen = TRUE;
392  OpenPropSheet(Info);
393  Info->bDlgOpen = FALSE;
395  }
396  }
397  break;
398 
399  case ID_REFRESH:
400  {
401  RefreshServiceList(Info);
403 
404  /* disable menus and buttons */
406 
407  /* clear the service in the status bar */
408  SendMessage(Info->hStatus,
409  SB_SETTEXT,
410  1,
411  L'\0');
412  }
413  break;
414 
415  case ID_EXPORT:
416  {
417  ExportFile(Info);
418  SetFocus(Info->hListView);
419  }
420  break;
421 
422  case ID_CREATE:
423  {
424  INT ret;
425 
428  Info->hMainWnd,
430  (LPARAM)Info);
431  if (ret == IDOK)
432  RefreshServiceList(Info);
433 
434  SetFocus(Info->hListView);
435  }
436  break;
437 
438  case ID_DELETE:
439  {
441  {
444  Info->hMainWnd,
446  (LPARAM)Info);
447  }
448  else
449  {
450  WCHAR Buf[60];
453  Buf,
454  sizeof(Buf) / sizeof(WCHAR));
455  DisplayString(Buf);
456  }
457 
458  SetFocus(Info->hListView);
459 
460  }
461  break;
462 
463  case ID_START:
464  {
468  ACTION_START,
469  NULL); //FIXME: Add start params
470 
474  SetFocus(Info->hListView);
475 
476  }
477  break;
478 
479  case ID_STOP:
483  ACTION_STOP,
484  NULL);
485 
489  SetFocus(Info->hListView);
490 
491  break;
492 
493  case ID_PAUSE:
497  ACTION_PAUSE,
498  NULL);
499 
503  SetFocus(Info->hListView);
504  break;
505 
506  case ID_RESUME:
511  NULL);
512 
516  SetFocus(Info->hListView);
517  break;
518 
519  case ID_RESTART:
524  NULL);
525 
529  SetFocus(Info->hListView);
530  break;
531 
532  case ID_HELP:
534  L"Help is not yet implemented\n",
535  L"Note!",
537  SetFocus(Info->hListView);
538  break;
539 
540  case ID_EXIT:
541  PostMessage(Info->hMainWnd,
542  WM_CLOSE,
543  0,
544  0);
545  break;
546 
547  case ID_VIEW_LARGE:
550 
555  MF_BYCOMMAND);
556  break;
557 
558  case ID_VIEW_SMALL:
561 
566  MF_BYCOMMAND);
567  break;
568 
569  case ID_VIEW_LIST:
571  LVS_LIST);
575  ID_VIEW_LIST,
576  MF_BYCOMMAND);
577  break;
578 
579  case ID_VIEW_DETAILS:
581  LVS_REPORT);
586  MF_BYCOMMAND);
587  break;
588 
589  case ID_VIEW_CUST:
590  break;
591 
592  case ID_ABOUT:
595  Info->hMainWnd,
597  SetFocus(Info->hListView);
598  break;
599 
600  }
601 }
#define ID_RESUME
Definition: resource.h:23
#define MAKEINTRESOURCE
Definition: winuser.h:591
VOID OpenPropSheet(PMAIN_WND_INFO Info)
Definition: propsheet.c:30
#define ID_VIEW_DETAILS
Definition: resource.h:38
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
#define ID_REFRESH
Definition: resource.h:18
#define MF_BYCOMMAND
Definition: winuser.h:202
INT_PTR CALLBACK DeleteDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: delete.c:57
#define ACTION_START
Definition: precomp.h:37
#define ID_EXPORT
Definition: resource.h:19
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define IDD_DLG_DELETE
Definition: resource.h:197
#define LVS_REPORT
Definition: commctrl.h:2232
BOOL WINAPI CheckMenuRadioItem(_In_ HMENU, _In_ UINT, _In_ UINT, _In_ UINT, _In_ UINT)
#define ACTION_STOP
Definition: precomp.h:38
BOOL RunActionWithProgress(HWND hParent, LPWSTR ServiceName, LPWSTR DisplayName, UINT Action, PVOID Param)
Definition: progress.c:322
HWND WINAPI SetFocus(_In_opt_ HWND)
#define ID_CREATE
Definition: resource.h:26
int32_t INT
Definition: typedefs.h:56
HWND hStatus
Definition: precomp.h:50
INT SelectedItem
Definition: precomp.h:60
#define DialogBox
Definition: winuser.h:5627
#define ID_DELETE
Definition: resource.h:27
#define IDD_DLG_CREATE
Definition: resource.h:183
#define ID_PAUSE
Definition: resource.h:22
LONG_PTR LPARAM
Definition: windef.h:208
#define IDD_ABOUTBOX
Definition: resource.h:8
#define LVSTATUS
Definition: precomp.h:29
#define SERVICE_RUNNING
Definition: winsvc.h:24
smooth NULL
Definition: ftsmooth.c:416
#define ListView_Arrange(hwndLV, code)
Definition: commctrl.h:2503
#define ID_ABOUT
Definition: charmap.c:18
#define ACTION_RESUME
Definition: precomp.h:40
static INT_PTR CALLBACK AboutDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: about.c:15
#define LVS_LIST
Definition: commctrl.h:2234
#define PostMessage
Definition: winuser.h:5698
#define ID_VIEW_LIST
Definition: resource.h:37
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
#define WM_CLOSE
Definition: winuser.h:1603
BOOL RefreshServiceList(PMAIN_WND_INFO Info)
Definition: listview.c:247
#define LVS_ICON
Definition: commctrl.h:2231
#define ID_START
Definition: resource.h:20
VOID ExportFile(PMAIN_WND_INFO Info)
Definition: export.c:98
#define MB_ICONINFORMATION
Definition: winuser.h:796
#define DialogBoxParam
Definition: winuser.h:5630
int ret
static const WCHAR L[]
Definition: oid.c:1087
#define SB_SETTEXT
Definition: commctrl.h:1919
#define ID_RESTART
Definition: resource.h:24
#define IDS_DELETE_STOP
Definition: resource.h:201
#define ID_VIEW_SMALL
Definition: resource.h:36
VOID DisplayString(LPWSTR Msg)
Definition: misc.c:211
#define ID_EXIT
Definition: resource.h:10
#define ACTION_PAUSE
Definition: precomp.h:39
VOID ChangeListViewText(PMAIN_WND_INFO Info, ENUM_SERVICE_STATUS_PROCESS *pService, UINT Column)
Definition: listview.c:105
#define NO_ITEM_SELECTED
Definition: precomp.h:24
BOOL UpdateServiceStatus(ENUM_SERVICE_STATUS_PROCESS *pService)
Definition: query.c:373
ENUM_SERVICE_STATUS_PROCESS * pCurrentService
Definition: precomp.h:57
HINSTANCE hInstance
Definition: mainwnd.c:15
HWND hMainWnd
Definition: precomp.h:48
#define ID_PROP
Definition: resource.h:17
VOID SetListViewStyle(HWND hListView, DWORD View)
Definition: listview.c:34
#define MB_OK
Definition: winuser.h:784
VOID SetMenuAndButtonStates(PMAIN_WND_INFO Info)
Definition: mainwnd.c:151
BOOL bDlgOpen
Definition: precomp.h:64
#define SendMessage
Definition: winuser.h:5709
#define LVA_DEFAULT
Definition: commctrl.h:2497
INT_PTR CALLBACK CreateDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: create.c:218
#define ID_VIEW_CUST
Definition: resource.h:34
#define ID_HELP
Definition: resource.h:28
SERVICE_STATUS_PROCESS ServiceStatusProcess
Definition: winsvc.h:137
HMENU WINAPI GetMenu(_In_ HWND)
#define LoadString
Definition: winuser.h:5685
#define ID_STOP
Definition: resource.h:21
#define LVS_SMALLICON
Definition: commctrl.h:2233
#define ACTION_RESTART
Definition: precomp.h:41
#define ID_VIEW_LARGE
Definition: resource.h:35
HWND hListView
Definition: precomp.h:49

◆ MainWndMenuHint()

static BOOL MainWndMenuHint ( PMAIN_WND_INFO  Info,
WORD  CmdId,
const MENU_HINT HintArray,
DWORD  HintsCount,
UINT  DefHintId 
)
static

Definition at line 80 of file mainwnd.c.

Referenced by MainWndProc().

85 {
86  BOOL Found = FALSE;
87  const MENU_HINT *LastHint;
88  UINT HintId = DefHintId;
89 
90  LastHint = HintArray + HintsCount;
91  while (HintArray != LastHint)
92  {
93  if (HintArray->CmdId == CmdId)
94  {
95  HintId = HintArray->HintId;
96  Found = TRUE;
97  break;
98  }
99  HintArray++;
100  }
101 
103  SB_SIMPLEID,
104  hInstance,
105  HintId);
106 
107  return Found;
108 }
#define TRUE
Definition: types.h:120
UINT HintId
Definition: precomp.h:87
HWND hStatus
Definition: precomp.h:50
#define SB_SIMPLEID
Definition: precomp.h:15
WORD CmdId
Definition: precomp.h:86
return Found
Definition: dirsup.c:1270
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned int UINT
Definition: ndis.h:50
HINSTANCE hInstance
Definition: mainwnd.c:15
BOOL StatusBarLoadString(IN HWND hStatusBar, IN INT PartId, IN HINSTANCE hInstance, IN UINT uID)
Definition: misc.c:150

◆ MainWndProc()

static LRESULT CALLBACK MainWndProc ( HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 636 of file mainwnd.c.

Referenced by InitMainWindowImpl().

640 {
642  LRESULT Ret = 0;
643 
644  /* Get the window context */
645  Info = (PMAIN_WND_INFO)GetWindowLongPtr(hwnd,
646  GWLP_USERDATA);
647  if (Info == NULL && msg != WM_CREATE)
648  {
649  goto HandleDefaultMessage;
650  }
651 
652  switch(msg)
653  {
654  case WM_CREATE:
655  {
656  Info = (PMAIN_WND_INFO)(((LPCREATESTRUCT)lParam)->lpCreateParams);
657 
658  /* Initialize the main window context */
659  Info->hMainWnd = hwnd;
661 
662  SetWindowLongPtr(hwnd,
664  (LONG_PTR)Info);
665 
666  if (!InitMainWnd(Info))
667  return -1;
668 
669  /* Fill the list-view before showing the main window */
670  RefreshServiceList(Info);
671 
672  /* Show the window */
673  ShowWindow(hwnd,
674  Info->nCmdShow);
675 
676  SetFocus(Info->hListView);
677  }
678  break;
679 
680  case WM_SIZE:
681  {
682  MainWndResize(Info,
683  LOWORD(lParam),
684  HIWORD(lParam));
685  }
686  break;
687 
688  case WM_NOTIFY:
689  {
690  LPNMHDR pnmhdr = (LPNMHDR)lParam;
691 
692  switch (pnmhdr->code)
693  {
694  case NM_DBLCLK:
695  {
696  POINT pt;
697  RECT rect;
698 
699  GetCursorPos(&pt);
700  GetWindowRect(Info->hListView, &rect);
701 
702  if (PtInRect(&rect, pt))
703  {
704  SendMessage(hwnd,
705  WM_COMMAND,
706  //ID_PROP,
707  MAKEWPARAM((WORD)ID_PROP, (WORD)0),
708  0);
709  }
710 
711  //OpenPropSheet(Info);
712  }
713  break;
714 
715  case NM_RETURN:
716  {
717  SendMessage(hwnd,
718  WM_COMMAND,
719  //ID_PROP,
720  MAKEWPARAM((WORD)ID_PROP, (WORD)0),
721  0);
722  }
723  break;
724 
725  case LVN_COLUMNCLICK:
726  {
728  HDITEM hdi;
729 
730  /* get pending sort direction for clicked column */
731  hdi.mask = HDI_LPARAM;
732  (void)Header_GetItem(Info->hHeader, pnmv->iSubItem, &hdi);
733 
734  /* get new sort parameters */
735  Info->SortSelection = pnmv->iSubItem;
736  Info->SortDirection = hdi.lParam;
737 
738  /* set new sort direction and save */
739  hdi.lParam = (hdi.lParam == ORD_ASCENDING) ?
741 
742  (void)Header_SetItem(Info->hHeader, pnmv->iSubItem, &hdi);
743 
745  CompareFunc,
746  (LPARAM)Info);
747  }
748  break;
749  case LVN_ITEMCHANGED:
750  {
752 
753  if (pnmv->uNewState != 0)
754  {
755  ListViewSelectionChanged(Info, pnmv);
757  }
758  }
759  break;
760 
761  case TTN_GETDISPINFO:
762  {
763  LPTOOLTIPTEXT lpttt;
764  UINT idButton;
765 
766  lpttt = (LPTOOLTIPTEXT)lParam;
767 
768  /* Specify the resource identifier of the descriptive
769  * text for the given button. */
770  idButton = (UINT)lpttt->hdr.idFrom;
771  switch (idButton)
772  {
773  case ID_PROP:
774  lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_PROP);
775  break;
776 
777  case ID_REFRESH:
778  lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_REFRESH);
779  break;
780 
781  case ID_EXPORT:
782  lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_EXPORT);
783  break;
784 
785  case ID_CREATE:
786  lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_CREATE);
787  break;
788 
789  case ID_DELETE:
790  lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_DELETE);
791  break;
792 
793  case ID_START:
794  lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_START);
795  break;
796 
797  case ID_STOP:
798  lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_STOP);
799  break;
800 
801  case ID_PAUSE:
802  lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_PAUSE);
803  break;
804 
805  case ID_RESTART:
806  lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_RESTART);
807  break;
808  }
809  }
810  break;
811  }
812  }
813  break;
814 
815  case WM_CONTEXTMENU:
816  {
817  POINT pt;
818  RECT lvRect;
819 
820  INT xPos = GET_X_LPARAM(lParam);
821  INT yPos = GET_Y_LPARAM(lParam);
822 
823  GetCursorPos(&pt);
824 
825  /* display popup when cursor is in the list view */
826  GetWindowRect(Info->hListView, &lvRect);
827  if (PtInRect(&lvRect, pt))
828  {
831  xPos,
832  yPos,
833  Info->hMainWnd,
834  NULL);
835  }
836  }
837  break;
838 
839  case WM_COMMAND:
840  {
841  MainWndCommand(Info,
842  LOWORD(wParam),
843  (HWND)lParam);
844  goto HandleDefaultMessage;
845  }
846 
847  case WM_MENUSELECT:
848  {
849  if (Info->hStatus != NULL)
850  {
851  if (!MainWndMenuHint(Info,
852  LOWORD(wParam),
854  sizeof(MainMenuHintTable) / sizeof(MainMenuHintTable[0]),
856  {
857  MainWndMenuHint(Info,
858  LOWORD(wParam),
860  sizeof(SystemMenuHintTable) / sizeof(SystemMenuHintTable[0]),
862  }
863  }
864  }
865  break;
866 
867  case WM_ENTERMENULOOP:
868  {
869  Info->bInMenuLoop = TRUE;
870  UpdateMainStatusBar(Info);
871  break;
872  }
873 
874  case WM_EXITMENULOOP:
875  {
876  Info->bInMenuLoop = FALSE;
877  UpdateMainStatusBar(Info);
878  break;
879  }
880 
881  case WM_CLOSE:
882  {
883  FreeServiceList(Info);
884  DestroyMenu(Info->hShortcutMenu);
885  DestroyWindow(hwnd);
886  }
887  break;
888 
889  case WM_DESTROY:
890  {
892  0,
893  Info);
894  SetWindowLongPtr(hwnd,
896  0);
897 
898  PostQuitMessage(0);
899  }
900  break;
901 
902  default:
903  {
904 HandleDefaultMessage:
905 
906  Ret = DefWindowProc(hwnd,
907  msg,
908  wParam,
909  lParam);
910  }
911  break;
912  }
913 
914  return Ret;
915 }
static const MENU_HINT SystemMenuHintTable[]
Definition: mainwnd.c:69
#define IDS_HINT_BLANK
Definition: resource.h:94
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define TRUE
Definition: types.h:120
#define MAKEWPARAM(l, h)
Definition: winuser.h:3916
#define ID_REFRESH
Definition: resource.h:18
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:47
#define IDS_TOOLTIP_STOP
Definition: resource.h:19
#define WM_CONTEXTMENU
Definition: richedit.h:64
UINT uNewState
Definition: commctrl.h:3006
#define ID_EXPORT
Definition: resource.h:19
#define IDS_TOOLTIP_DELETE
Definition: resource.h:53
#define pt(x, y)
Definition: drawing.c:79
VOID ListViewSelectionChanged(PMAIN_WND_INFO Info, LPNMLISTVIEW pnmv)
Definition: listview.c:48
static VOID UpdateMainStatusBar(PMAIN_WND_INFO Info)
Definition: mainwnd.c:112
#define LVN_ITEMCHANGED
Definition: commctrl.h:3101
BOOL WINAPI TrackPopupMenuEx(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _In_ HWND, _In_opt_ LPTPMPARAMS)
static BOOL MainWndMenuHint(PMAIN_WND_INFO Info, WORD CmdId, const MENU_HINT *HintArray, DWORD HintsCount, UINT DefHintId)
Definition: mainwnd.c:80
HWND WINAPI SetFocus(_In_opt_ HWND)
static BOOL InitMainWnd(PMAIN_WND_INFO Info)
Definition: mainwnd.c:333
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2635
#define HDITEM
Definition: commctrl.h:682
BOOL WINAPI DestroyWindow(_In_ HWND)
#define ID_CREATE
Definition: resource.h:26
int32_t INT
Definition: typedefs.h:56
static const MENU_HINT MainMenuHintTable[]
Definition: mainwnd.c:39
#define SetWindowLongPtr
Definition: treelist.c:70
HWND hStatus
Definition: precomp.h:50
& rect
Definition: startmenu.cpp:1413
WPARAM wParam
Definition: combotst.c:138
struct TraceInfo Info
struct tagNMHDR * LPNMHDR
INT SelectedItem
Definition: precomp.h:60
INT SortSelection
Definition: precomp.h:61
#define IDS_TOOLTIP_CREATE
Definition: resource.h:52
UINT code
Definition: winuser.h:3112
#define TPM_RIGHTBUTTON
Definition: winuser.h:2334
BOOL bInMenuLoop
Definition: precomp.h:65
#define ID_DELETE
Definition: resource.h:27
#define IDS_TOOLTIP_PROP
Definition: resource.h:49
#define ID_PAUSE
Definition: resource.h:22
LONG_PTR LPARAM
Definition: windef.h:208
#define WM_ENTERMENULOOP
Definition: winuser.h:1780
#define WM_MENUSELECT
Definition: winuser.h:1723
#define Header_GetItem(hwndHD, i, phdi)
Definition: commctrl.h:736
#define TTN_GETDISPINFO
Definition: commctrl.h:1848
#define GWLP_USERDATA
Definition: treelist.c:63
#define WM_EXITMENULOOP
Definition: winuser.h:1781
UINT msg
Definition: msvc.h:92
smooth NULL
Definition: ftsmooth.c:416
static VOID CALLBACK MainWndResize(PMAIN_WND_INFO Info, WORD cx, WORD cy)
Definition: mainwnd.c:605
#define GET_X_LPARAM(lp)
Definition: precomp.h:67
switch(r->id)
Definition: btrfs.c:2676
#define IDS_TOOLTIP_RESTART
Definition: resource.h:57
#define DefWindowProc
Definition: ros2win.h:31
#define WM_DESTROY
Definition: winuser.h:1591
#define ORD_ASCENDING
Definition: precomp.h:43
#define LPTOOLTIPTEXT
Definition: commctrl.h:1860
int nCmdShow
Definition: precomp.h:54
INT SortDirection
Definition: precomp.h:62
#define WM_SIZE
Definition: winuser.h:1593
#define IDS_TOOLTIP_REFRESH
Definition: resource.h:50
#define WM_CLOSE
Definition: winuser.h:1603
unsigned int UINT
Definition: ndis.h:50
struct _MAIN_WND_INFO * PMAIN_WND_INFO
unsigned short WORD
Definition: ntddk_ex.h:93
BOOL RefreshServiceList(PMAIN_WND_INFO Info)
Definition: listview.c:247
#define ID_START
Definition: resource.h:20
#define IDS_TOOLTIP_PAUSE
Definition: resource.h:25
#define ID_RESTART
Definition: resource.h:24
HMENU hShortcutMenu
Definition: precomp.h:53
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define WM_COMMAND
Definition: winuser.h:1716
#define ORD_DESCENDING
Definition: precomp.h:44
HANDLE ProcessHeap
Definition: servman.c:15
BOOL WINAPI DestroyMenu(_In_ HMENU)
#define NM_RETURN
Definition: commctrl.h:132
#define NO_ITEM_SELECTED
Definition: precomp.h:24
#define NM_DBLCLK
Definition: commctrl.h:131
struct tagNMLISTVIEW * LPNMLISTVIEW
#define IDS_TOOLTIP_EXPORT
Definition: resource.h:51
static INT CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
Definition: mainwnd.c:242
HWND hMainWnd
Definition: precomp.h:48
#define ID_PROP
Definition: resource.h:17
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define LVN_COLUMNCLICK
Definition: commctrl.h:3109
VOID SetMenuAndButtonStates(PMAIN_WND_INFO Info)
Definition: mainwnd.c:151
#define ListView_SortItemsEx(hwndLV, _pfnCompare, _lPrm)
Definition: commctrl.h:2771
#define GET_Y_LPARAM(lp)
Definition: precomp.h:68
HWND hHeader
Definition: precomp.h:52
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)
#define HDI_LPARAM
Definition: commctrl.h:691
#define SendMessage
Definition: winuser.h:5709
#define WM_CREATE
Definition: winuser.h:1590
#define HIWORD(l)
Definition: typedefs.h:246
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
static VOID MainWndCommand(PMAIN_WND_INFO Info, WORD CmdId, HWND hControl)
Definition: mainwnd.c:379
#define IDS_TOOLTIP_START
Definition: resource.h:54
#define GetWindowLongPtr
Definition: treelist.c:73
#define Header_SetItem(hwndHD, i, phdi)
Definition: commctrl.h:743
LONG_PTR LRESULT
Definition: windef.h:209
#define UINT
Definition: msvc.h:27
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:394
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define ID_STOP
Definition: resource.h:21
#define WM_NOTIFY
Definition: richedit.h:61
HWND hListView
Definition: precomp.h:49
VOID FreeServiceList(PMAIN_WND_INFO Info)
Definition: query.c:257

◆ MainWndResize()

static VOID CALLBACK MainWndResize ( PMAIN_WND_INFO  Info,
WORD  cx,
WORD  cy 
)
static

Definition at line 605 of file mainwnd.c.

Referenced by MainWndProc().

608 {
609  RECT rcClient, rcTool, rcStatus;
610  int lvHeight, iToolHeight, iStatusHeight;
611 
612  /* Size toolbar and get height */
613  SendMessage(Info->hTool, TB_AUTOSIZE, 0, 0);
614  GetWindowRect(Info->hTool, &rcTool);
615  iToolHeight = rcTool.bottom - rcTool.top;
616 
617  /* Size status bar and get height */
618  SendMessage(Info->hStatus, WM_SIZE, 0, 0);
619  GetWindowRect(Info->hStatus, &rcStatus);
620  iStatusHeight = rcStatus.bottom - rcStatus.top;
621 
622  /* Calculate remaining height and size list view */
623  GetClientRect(Info->hMainWnd, &rcClient);
624  lvHeight = rcClient.bottom - iToolHeight - iStatusHeight;
625  SetWindowPos(Info->hListView,
626  NULL,
627  0,
628  iToolHeight,
629  rcClient.right,
630  lvHeight,
631  SWP_NOZORDER);
632 }
LONG top
Definition: windef.h:297
#define SWP_NOZORDER
Definition: winuser.h:1232
LONG right
Definition: windef.h:298
HWND hStatus
Definition: precomp.h:50
#define TB_AUTOSIZE
Definition: commctrl.h:1107
smooth NULL
Definition: ftsmooth.c:416
#define WM_SIZE
Definition: winuser.h:1593
HWND hTool
Definition: precomp.h:51
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HWND hMainWnd
Definition: precomp.h:48
#define SendMessage
Definition: winuser.h:5709
LONG bottom
Definition: windef.h:299
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
HWND hListView
Definition: precomp.h:49

◆ pCreateToolbar()

static BOOL pCreateToolbar ( PMAIN_WND_INFO  Info)
static

Definition at line 255 of file mainwnd.c.

Referenced by InitMainWnd().

256 {
257  INT numButtons = sizeof(Buttons) / sizeof(Buttons[0]);
258 
259  Info->hTool = CreateWindowEx(0,
261  NULL,
263  0, 0, 0, 0,
264  Info->hMainWnd,
265  0,
266  hInstance,
267  NULL);
268  if(Info->hTool != NULL)
269  {
270  HIMAGELIST hImageList;
271 
272  SendMessage(Info->hTool,
274  0,
276 
277  SendMessage(Info->hTool,
279  sizeof(Buttons[0]),
280  0);
281 
282  hImageList = InitImageList(IDB_PROP,
283  IDB_RESTART,
286  IMAGE_BITMAP);
287  if (hImageList == NULL)
288  return FALSE;
289 
292  0,
293  (LPARAM)hImageList));
294 
295  SendMessage(Info->hTool,
297  numButtons,
298  (LPARAM)Buttons);
299 
300  return TRUE;
301  }
302 
303  return FALSE;
304 }
#define TB_BUTTONSTRUCTSIZE
Definition: commctrl.h:1104
#define TRUE
Definition: types.h:120
#define TBSTYLE_EX_HIDECLIPPEDBUTTONS
Definition: commctrl.h:983
#define IDB_PROP
Definition: resource.h:72
#define WS_CHILD
Definition: pedump.c:617
int32_t INT
Definition: typedefs.h:56
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:893
LONG_PTR LPARAM
Definition: windef.h:208
#define CreateWindowEx
Definition: winuser.h:5621
#define TOOLBARCLASSNAME
Definition: commctrl.h:916
smooth NULL
Definition: ftsmooth.c:416
#define TB_SETIMAGELIST
Definition: commctrl.h:1120
int WINAPI GetSystemMetrics(_In_ int)
#define TBSTYLE_TOOLTIPS
Definition: commctrl.h:959
#define SM_CXSMICON
Definition: winuser.h:1002
HWND hTool
Definition: precomp.h:51
HIMAGELIST InitImageList(UINT StartResource, UINT EndResource, UINT Width, UINT Height, ULONG type)
Definition: misc.c:219
#define TB_ADDBUTTONS
Definition: commctrl.h:1241
HINSTANCE hInstance
Definition: mainwnd.c:15
HWND hMainWnd
Definition: precomp.h:48
#define IMAGE_BITMAP
Definition: winuser.h:211
#define SendMessage
Definition: winuser.h:5709
#define IDB_RESTART
Definition: resource.h:80
#define WS_VISIBLE
Definition: pedump.c:620
static const TBBUTTON Buttons[]
Definition: mainwnd.c:17
#define TBSTYLE_FLAT
Definition: commctrl.h:962
#define TB_SETEXTENDEDSTYLE
Definition: commctrl.h:1160

◆ SetMenuAndButtonStates()

VOID SetMenuAndButtonStates ( PMAIN_WND_INFO  Info)

Definition at line 151 of file mainwnd.c.

Referenced by MainWndCommand(), MainWndProc(), and SetButtonStates().

152 {
154  UINT i;
155 
156  /* get handle to menu */
157  hMainMenu = GetMenu(Info->hMainWnd);
158 
159  /* set all to greyed */
160  for (i = ID_START; i <= ID_RESTART; i++)
161  {
162  EnableMenuItem(hMainMenu, i, MF_GRAYED);
164  SendMessage(Info->hTool, TB_SETSTATE, i,
166  }
167 
168  if (Info->SelectedItem != NO_ITEM_SELECTED)
169  {
170  LPQUERY_SERVICE_CONFIG lpServiceConfig = NULL;
171  DWORD Flags, State;
172 
173  /* allow user to delete service */
174  if (Info->bIsUserAnAdmin)
175  {
178  EnableMenuItem(hMainMenu, ID_DELETE, MF_ENABLED);
180  }
181 
184 
185  lpServiceConfig = GetServiceConfig(Info->pCurrentService->lpServiceName);
186 
187  if (lpServiceConfig && lpServiceConfig->dwStartType != SERVICE_DISABLED)
188  {
189  if (State == SERVICE_STOPPED)
190  {
191  EnableMenuItem(hMainMenu, ID_START, MF_ENABLED);
195  }
196 
197  if ( (Flags & SERVICE_ACCEPT_STOP) && (State == SERVICE_RUNNING) )
198  {
199  EnableMenuItem(hMainMenu, ID_RESTART, MF_ENABLED);
203  }
204  }
205 
206  if(lpServiceConfig)
207  HeapFree(GetProcessHeap(), 0, lpServiceConfig);
208 
209  if ( (Flags & SERVICE_ACCEPT_STOP) && (State == SERVICE_RUNNING) )
210  {
211  EnableMenuItem(hMainMenu, ID_STOP, MF_ENABLED);
215  }
216 
217  if ( (Flags & SERVICE_ACCEPT_PAUSE_CONTINUE) && (State == SERVICE_RUNNING) )
218  {
219  EnableMenuItem(hMainMenu, ID_PAUSE, MF_ENABLED);
223  }
224  }
225  else
226  {
227  /* disable tools which rely on a selected service */
228  EnableMenuItem(hMainMenu, ID_PROP, MF_GRAYED);
229  EnableMenuItem(hMainMenu, ID_DELETE, MF_GRAYED);
236  }
237 
238 }
#define TBSTATE_INDETERMINATE
Definition: commctrl.h:946
#define TB_SETSTATE
Definition: commctrl.h:1024
#define SERVICE_ACCEPT_STOP
Definition: winsvc.h:28
INT SelectedItem
Definition: precomp.h:60
#define SERVICE_DISABLED
Definition: cmtypes.h:977
HMENU hMainMenu
Definition: mplay32.c:19
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
GLenum GLclampf GLint i
Definition: glfuncs.h:14
#define SERVICE_STOPPED
Definition: winsvc.h:21
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define ID_DELETE
Definition: resource.h:27
#define ID_PAUSE
Definition: resource.h:22
LONG_PTR LPARAM
Definition: windef.h:208
#define SERVICE_RUNNING
Definition: winsvc.h:24
#define MAKELONG(a, b)
Definition: typedefs.h:248
smooth NULL
Definition: ftsmooth.c:416
#define SERVICE_ACCEPT_PAUSE_CONTINUE
Definition: winsvc.h:29
#define GetProcessHeap()
Definition: compat.h:395
#define MF_ENABLED
Definition: winuser.h:128
unsigned int UINT
Definition: ndis.h:50
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ID_START
Definition: resource.h:20
HWND hTool
Definition: precomp.h:51
LPQUERY_SERVICE_CONFIG GetServiceConfig(LPWSTR lpServiceName)
Definition: query.c:29
#define ID_RESTART
Definition: resource.h:24
HMENU hShortcutMenu
Definition: precomp.h:53
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
BOOL bIsUserAnAdmin
Definition: precomp.h:66
enum State_ State
Definition: pofuncs.h:54
#define NO_ITEM_SELECTED
Definition: precomp.h:24
ENUM_SERVICE_STATUS_PROCESS * pCurrentService
Definition: precomp.h:57
HWND hMainWnd
Definition: precomp.h:48
#define ID_PROP
Definition: resource.h:17
#define SendMessage
Definition: winuser.h:5709
#define TBSTATE_ENABLED
Definition: commctrl.h:944
#define MF_GRAYED
Definition: winuser.h:129
SERVICE_STATUS_PROCESS ServiceStatusProcess
Definition: winsvc.h:137
HMENU WINAPI GetMenu(_In_ HWND)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
#define HeapFree(x, y, z)
Definition: compat.h:394
#define ID_STOP
Definition: resource.h:21

◆ UninitMainWindowImpl()

VOID UninitMainWindowImpl ( VOID  )

Definition at line 987 of file mainwnd.c.

Referenced by _tWinMain(), and wWinMain().

988 {
990  hInstance);
991 }
static const WCHAR szMainWndClass[]
Definition: mainwnd.c:14
HINSTANCE hInstance
Definition: mainwnd.c:15
#define UnregisterClass
Definition: winuser.h:5727

◆ UpdateMainStatusBar()

static VOID UpdateMainStatusBar ( PMAIN_WND_INFO  Info)
static

Definition at line 112 of file mainwnd.c.

Referenced by MainWndProc().

113 {
114  if (Info->hStatus != NULL)
115  {
116  SendMessage(Info->hStatus,
117  SB_SIMPLE,
118  (WPARAM)Info->bInMenuLoop,
119  0);
120  }
121 }
HWND hStatus
Definition: precomp.h:50
UINT_PTR WPARAM
Definition: windef.h:207
BOOL bInMenuLoop
Definition: precomp.h:65
#define SB_SIMPLE
Definition: commctrl.h:1928
smooth NULL
Definition: ftsmooth.c:416
#define SendMessage
Definition: winuser.h:5709

◆ UpdateServiceCount()

VOID UpdateServiceCount ( PMAIN_WND_INFO  Info)

Definition at line 124 of file mainwnd.c.

Referenced by DeleteDialogProc(), and RefreshServiceList().

125 {
126  LPWSTR lpNumServices;
127 
128  if (AllocAndLoadString(&lpNumServices,
129  hInstance,
131  {
132  WCHAR szNumServices[32];
133 
134  INT NumListedServ = ListView_GetItemCount(Info->hListView);
135 
136  _snwprintf(szNumServices,
137  31,
138  lpNumServices,
139  NumListedServ);
140 
141  SendMessage(Info->hStatus,
142  SB_SETTEXT,
143  0,
144  (LPARAM)szNumServices);
145 
146  LocalFree(lpNumServices);
147  }
148 }
__wchar_t WCHAR
Definition: xmlstorage.h:180
static INT AllocAndLoadString(OUT LPTSTR *lpTarget, IN HINSTANCE hInst, IN UINT uID)
Definition: misc.c:60
int32_t INT
Definition: typedefs.h:56
HWND hStatus
Definition: precomp.h:50
LONG_PTR LPARAM
Definition: windef.h:208
int _snwprintf(wchar_t *buffer, size_t count, const wchar_t *format,...)
#define ListView_GetItemCount(hwnd)
Definition: commctrl.h:2277
#define IDS_NUM_SERVICES
Definition: resource.h:64
#define SB_SETTEXT
Definition: commctrl.h:1919
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
HINSTANCE hInstance
Definition: mainwnd.c:15
#define SendMessage
Definition: winuser.h:5709
WCHAR * LPWSTR
Definition: xmlstorage.h:184
HWND hListView
Definition: precomp.h:49

Variable Documentation

◆ Buttons

const TBBUTTON Buttons[]
static
Initial value:
=
{
{15, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0},
{15, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0},
}
#define TBICON_DELETE
Definition: resource.h:87
#define ID_REFRESH
Definition: resource.h:18
#define ID_EXPORT
Definition: resource.h:19
#define TBSTATE_INDETERMINATE
Definition: commctrl.h:946
#define ID_CREATE
Definition: resource.h:26
#define BTNS_BUTTON
Definition: commctrl.h:968
#define ID_DELETE
Definition: resource.h:27
#define ID_PAUSE
Definition: resource.h:22
#define TBICON_START
Definition: resource.h:88
#define TBICON_PROP
Definition: resource.h:83
#define TBICON_EXPORT
Definition: resource.h:85
#define BTNS_SEP
Definition: commctrl.h:969
#define TBICON_RESTART
Definition: resource.h:91
#define ID_START
Definition: resource.h:20
#define TBICON_REFRESH
Definition: resource.h:84
#define ID_RESTART
Definition: resource.h:24
#define TBICON_CREATE
Definition: resource.h:86
#define TBICON_PAUSE
Definition: resource.h:90
#define ID_PROP
Definition: resource.h:17
#define TBICON_STOP
Definition: resource.h:60
#define TBSTATE_ENABLED
Definition: commctrl.h:944
#define ID_STOP
Definition: resource.h:21

Definition at line 17 of file mainwnd.c.

Referenced by MainWndCreateToolbarClient(), and pCreateToolbar().

◆ MainMenuHintTable

const MENU_HINT MainMenuHintTable[]
static
Initial value:
= {
}
#define IDS_HINT_EXIT
Definition: resource.h:96
#define ID_RESUME
Definition: resource.h:23
#define IDS_HINT_ABOUT
Definition: resource.h:117
#define ID_VIEW_DETAILS
Definition: resource.h:38
#define ID_REFRESH
Definition: resource.h:18
#define ID_CONNECT
Definition: resource.h:30
#define IDS_HINT_EXPORT
Definition: resource.h:95
#define ID_EXPORT
Definition: resource.h:19
#define IDS_HINT_LARGE
Definition: resource.h:110
#define IDS_HINT_REFRESH
Definition: resource.h:104
#define IDS_HINT_CUST
Definition: resource.h:114
#define IDS_HINT_STOP
Definition: resource.h:100
#define IDS_HINT_EDIT
Definition: resource.h:105
#define IDS_HINT_DETAILS
Definition: resource.h:113
#define ID_CREATE
Definition: resource.h:26
#define ID_DELETE
Definition: resource.h:27
#define ID_PAUSE
Definition: resource.h:22
#define IDS_HINT_CONNECT
Definition: resource.h:98
#define ID_ABOUT
Definition: charmap.c:18
#define IDS_HINT_HELP
Definition: resource.h:116
#define ID_VIEW_LIST
Definition: resource.h:37
#define ID_EDIT
Definition: resource.h:25
#define IDS_HINT_PROP
Definition: resource.h:108
#define IDS_HINT_START
Definition: resource.h:99
#define ID_START
Definition: resource.h:20
#define IDS_HINT_RESUME
Definition: resource.h:102
#define ID_RESTART
Definition: resource.h:24
#define ID_VIEW_SMALL
Definition: resource.h:36
#define ID_EXIT
Definition: resource.h:10
#define IDS_HINT_LIST
Definition: resource.h:112
#define ID_PROP
Definition: resource.h:17
#define IDS_HINT_DELETE
Definition: resource.h:107
#define IDS_HINT_SMALL
Definition: resource.h:111
#define ID_VIEW_CUST
Definition: resource.h:34
#define ID_HELP
Definition: resource.h:28
#define IDS_HINT_CREATE
Definition: resource.h:106
#define IDS_HINT_PAUSE
Definition: resource.h:101
#define IDS_HINT_RESTART
Definition: resource.h:103
#define ID_STOP
Definition: resource.h:21
#define ID_VIEW_LARGE
Definition: resource.h:35

Definition at line 39 of file mainwnd.c.

◆ SystemMenuHintTable

const MENU_HINT SystemMenuHintTable[]
static
Initial value:
= {
}
#define SC_RESTORE
Definition: winuser.h:2552
#define IDS_HINT_SYS_MINIMIZE
Definition: resource.h:123
#define SC_MAXIMIZE
Definition: winuser.h:2542
#define IDS_HINT_SYS_MOVE
Definition: resource.h:121
#define IDS_HINT_SYS_RESTORE
Definition: resource.h:120
#define IDS_HINT_SYS_SIZE
Definition: resource.h:122
#define SC_MINIMIZE
Definition: winuser.h:2540
#define SC_SIZE
Definition: winuser.h:2538
#define IDS_HINT_SYS_MAXIMIZE
Definition: resource.h:124
#define SC_MOVE
Definition: winuser.h:2539
#define SC_CLOSE
Definition: winuser.h:2546
#define IDS_HINT_SYS_CLOSE
Definition: resource.h:125

Definition at line 69 of file mainwnd.c.

◆ szMainWndClass

const WCHAR szMainWndClass[] = L"ServManWndClass"
static

Definition at line 14 of file mainwnd.c.

Referenced by CreateMainWindow(), InitMainWindowImpl(), and UninitMainWindowImpl().