ReactOS  0.4.15-dev-1070-ge1a01de
mainwnd.c File Reference
#include "precomp.h"
#include <windowsx.h>
#include <shellapi.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 243 of file mainwnd.c.

244 {
245  PMAIN_WND_INFO Info = (PMAIN_WND_INFO)lParamSort;
246  WCHAR Item1[256], Item2[256];
247 
248  ListView_GetItemText(Info->hListView, lParam1, Info->SortSelection, Item1, sizeof(Item1) / sizeof(WCHAR));
249  ListView_GetItemText(Info->hListView, lParam2, Info->SortSelection, Item2, sizeof(Item2) / sizeof(WCHAR));
250 
251  return wcscmp(Item1, Item2) * Info->SortDirection;
252 }
#define ListView_GetItemText(hwndLV, i, iSubItem_, pszText_, cchTextMax_)
Definition: commctrl.h:2680
struct TraceInfo Info
__wchar_t WCHAR
Definition: xmlstorage.h:180
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)

Referenced by CLIPOBJ_cEnumStart(), and MainWndProc().

◆ CreateMainWindow()

HWND CreateMainWindow ( LPCTSTR  lpCaption,
int  nCmdShow 
)

Definition at line 925 of file mainwnd.c.

927 {
929  HWND hMainWnd = NULL;
930 
933  sizeof(MAIN_WND_INFO));
934 
935  if (Info != NULL)
936  {
937  Info->nCmdShow = nCmdShow;
938 
941  lpCaption,
945  680,
946  450,
947  NULL,
948  NULL,
949  hInstance,
950  Info);
951  if (hMainWnd == NULL)
952  {
953  //int ret;
954  //ret = GetLastError();
955  GetError();
957  0,
958  Info);
959  }
960  }
961 
962  return hMainWnd;
963 }
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
static const WCHAR szMainWndClass[]
Definition: mainwnd.c:15
#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:5730
#define CW_USEDEFAULT
Definition: winuser.h:225
smooth NULL
Definition: ftsmooth.c:416
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HWND hMainWnd
Definition: magnifier.c:32
HANDLE ProcessHeap
Definition: servman.c:15
HINSTANCE hInstance
Definition: mainwnd.c:15
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define HeapFree(x, y, z)
Definition: compat.h:483

Referenced by _tWinMain(), and wWinMain().

◆ CreateStatusBar()

static BOOL CreateStatusBar ( PMAIN_WND_INFO  Info)
static

Definition at line 308 of file mainwnd.c.

309 {
310  INT StatWidths[] = {130, -1}; /* widths of status bar */
311 
312  Info->hStatus = CreateWindowEx(0,
314  NULL,
316  0, 0, 0, 0,
317  Info->hMainWnd,
319  hInstance,
320  NULL);
321  if(Info->hStatus == NULL)
322  return FALSE;
323 
324  SendMessage(Info->hStatus,
325  SB_SETPARTS,
326  sizeof(StatWidths) / sizeof(INT),
327  (LPARAM)StatWidths);
328 
329  return TRUE;
330 }
#define IDC_STATUSBAR
Definition: resource.h:12
#define TRUE
Definition: types.h:120
#define WS_CHILD
Definition: pedump.c:617
#define STATUSCLASSNAME
Definition: commctrl.h:1935
int32_t INT
Definition: typedefs.h:58
struct TraceInfo Info
#define FALSE
Definition: types.h:117
#define CreateWindowEx
Definition: winuser.h:5730
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define SBARS_SIZEGRIP
Definition: commctrl.h:1919
HINSTANCE hInstance
Definition: mainwnd.c:15
#define SB_SETPARTS
Definition: commctrl.h:1950
#define SendMessage
Definition: winuser.h:5818
#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

Referenced by InitMainWnd().

◆ InitMainWindowImpl()

BOOL InitMainWindowImpl ( VOID  )

Definition at line 966 of file mainwnd.c.

967 {
968  WNDCLASSEX wc = {0};
969 
970  wc.cbSize = sizeof(WNDCLASSEX);
972  wc.hInstance = hInstance;
973  wc.hIcon = LoadIcon(hInstance,
975  wc.hCursor = LoadCursor(NULL,
976  IDC_ARROW);
977  wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
982  IMAGE_ICON,
983  16,
984  16,
985  LR_SHARED);
986 
987  return RegisterClassEx(&wc) != (ATOM)0;
988 }
static const WCHAR szMainWndClass[]
Definition: mainwnd.c:15
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define IDR_MAINMENU
Definition: resource.h:40
static HICON
Definition: imagelist.c:84
LPCSTR lpszMenuName
Definition: winuser.h:3185
#define LR_SHARED
Definition: winuser.h:1090
#define IMAGE_ICON
Definition: winuser.h:212
#define RegisterClassEx
Definition: winuser.h:5812
HCURSOR hCursor
Definition: winuser.h:3183
WNDPROC lpfnWndProc
Definition: winuser.h:3178
LPCSTR lpszClassName
Definition: winuser.h:3186
WORD ATOM
Definition: dimm.idl:113
HICON hIconSm
Definition: winuser.h:3187
HINSTANCE hInstance
Definition: winuser.h:3181
smooth NULL
Definition: ftsmooth.c:416
UINT cbSize
Definition: winuser.h:3176
HBRUSH hbrBackground
Definition: winuser.h:3184
HICON hIcon
Definition: winuser.h:3182
static LRESULT CALLBACK MainWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: mainwnd.c:641
#define COLOR_BTNFACE
Definition: winuser.h:918
#define LoadCursor
Definition: winuser.h:5787
HINSTANCE hInstance
Definition: mainwnd.c:15
#define IDI_SM_ICON
Definition: resource.h:64
#define IDC_ARROW
Definition: winuser.h:682
#define LoadImage
Definition: winuser.h:5790
WNDCLASSEXA WNDCLASSEX
Definition: winuser.h:5694
#define LoadIcon
Definition: winuser.h:5788

Referenced by _tWinMain(), and wWinMain().

◆ InitMainWnd()

static BOOL InitMainWnd ( PMAIN_WND_INFO  Info)
static

Definition at line 334 of file mainwnd.c.

335 {
336  if (!pCreateToolbar(Info))
337  {
338  DisplayString(L"error creating toolbar");
339  return FALSE;
340  }
341 
342  if (!CreateListView(Info))
343  {
344  DisplayString(L"error creating list view");
345  return FALSE;
346  }
347 
348  if (!CreateStatusBar(Info))
349  DisplayString(L"error creating status bar");
350 
351  /* Create Popup Menu */
352  Info->hShortcutMenu = LoadMenu(hInstance,
354 
355  Info->bIsUserAnAdmin = TRUE;// IsUserAnAdmin();
356  if (Info->bIsUserAnAdmin)
357  {
358  HMENU hMainMenu = GetMenu(Info->hMainWnd);
359 
360  SendMessage(Info->hTool,
361  TB_SETSTATE,
362  ID_CREATE,
364  if (hMainMenu)
365  {
367  ID_CREATE,
368  MF_ENABLED);
369  }
370  EnableMenuItem(GetSubMenu(Info->hShortcutMenu, 0),
371  ID_CREATE,
372  MF_ENABLED);
373  }
374 
375  return TRUE;
376 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
static BOOL CreateStatusBar(PMAIN_WND_INFO Info)
Definition: mainwnd.c:308
#define TRUE
Definition: types.h:120
#define TB_SETSTATE
Definition: commctrl.h:1050
#define ID_CREATE
Definition: resource.h:24
struct TraceInfo Info
HMENU hMainMenu
Definition: mplay32.c:25
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define FALSE
Definition: types.h:117
#define MAKELONG(a, b)
Definition: typedefs.h:249
#define IDR_POPUP
Definition: resource.h:7
LONG_PTR LPARAM
Definition: windef.h:208
static BOOL pCreateToolbar(PMAIN_WND_INFO Info)
Definition: mainwnd.c:256
#define MF_ENABLED
Definition: winuser.h:128
static const WCHAR L[]
Definition: oid.c:1250
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
VOID DisplayString(LPWSTR Msg)
Definition: misc.c:211
#define LoadMenu
Definition: winuser.h:5792
HINSTANCE hInstance
Definition: mainwnd.c:15
BOOL CreateListView(PMAIN_WND_INFO Info)
Definition: listview.c:355
#define SendMessage
Definition: winuser.h:5818
#define TBSTATE_ENABLED
Definition: commctrl.h:970
HMENU WINAPI GetMenu(_In_ HWND)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60

Referenced by MainWndProc().

◆ MainWndCommand()

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

Definition at line 379 of file mainwnd.c.

382 {
383  UNREFERENCED_PARAMETER(hControl);
384 
385  WCHAR szAppName[256];
386  WCHAR szAppAuthors[256];
387  HICON hIcon;
388 
389  switch (CmdId)
390  {
391  case ID_PROP:
392  {
393  if (Info->SelectedItem != NO_ITEM_SELECTED)
394  {
395  Info->bDlgOpen = TRUE;
397  Info->bDlgOpen = FALSE;
399  }
400  }
401  break;
402 
403  case ID_REFRESH:
404  {
406  Info->SelectedItem = NO_ITEM_SELECTED;
407 
408  /* disable menus and buttons */
410 
411  /* clear the service in the status bar */
412  SendMessage(Info->hStatus,
413  SB_SETTEXT,
414  1,
415  L'\0');
416  }
417  break;
418 
419  case ID_EXPORT:
420  {
421  ExportFile(Info);
422  SetFocus(Info->hListView);
423  }
424  break;
425 
426  case ID_CREATE:
427  {
428  INT ret;
429 
432  Info->hMainWnd,
434  (LPARAM)Info);
435  if (ret == IDOK)
437 
438  SetFocus(Info->hListView);
439  }
440  break;
441 
442  case ID_DELETE:
443  {
444  if (Info->pCurrentService->ServiceStatusProcess.dwCurrentState != SERVICE_RUNNING)
445  {
448  Info->hMainWnd,
450  (LPARAM)Info);
451  }
452  else
453  {
454  WCHAR Buf[60];
457  Buf,
458  sizeof(Buf) / sizeof(WCHAR));
459  DisplayString(Buf);
460  }
461 
462  SetFocus(Info->hListView);
463 
464  }
465  break;
466 
467  case ID_START:
468  {
469  RunActionWithProgress(Info->hMainWnd,
470  Info->pCurrentService->lpServiceName,
471  Info->pCurrentService->lpDisplayName,
472  ACTION_START,
473  NULL); //FIXME: Add start params
474 
475  UpdateServiceStatus(Info->pCurrentService);
476  ChangeListViewText(Info, Info->pCurrentService, LVSTATUS);
478  SetFocus(Info->hListView);
479 
480  }
481  break;
482 
483  case ID_STOP:
484  RunActionWithProgress(Info->hMainWnd,
485  Info->pCurrentService->lpServiceName,
486  Info->pCurrentService->lpDisplayName,
487  ACTION_STOP,
488  NULL);
489 
490  UpdateServiceStatus(Info->pCurrentService);
491  ChangeListViewText(Info, Info->pCurrentService, LVSTATUS);
493  SetFocus(Info->hListView);
494 
495  break;
496 
497  case ID_PAUSE:
498  RunActionWithProgress(Info->hMainWnd,
499  Info->pCurrentService->lpServiceName,
500  Info->pCurrentService->lpDisplayName,
501  ACTION_PAUSE,
502  NULL);
503 
504  UpdateServiceStatus(Info->pCurrentService);
505  ChangeListViewText(Info, Info->pCurrentService, LVSTATUS);
507  SetFocus(Info->hListView);
508  break;
509 
510  case ID_RESUME:
511  RunActionWithProgress(Info->hMainWnd,
512  Info->pCurrentService->lpServiceName,
513  Info->pCurrentService->lpDisplayName,
515  NULL);
516 
517  UpdateServiceStatus(Info->pCurrentService);
518  ChangeListViewText(Info, Info->pCurrentService, LVSTATUS);
520  SetFocus(Info->hListView);
521  break;
522 
523  case ID_RESTART:
524  RunActionWithProgress(Info->hMainWnd,
525  Info->pCurrentService->lpServiceName,
526  Info->pCurrentService->lpDisplayName,
528  NULL);
529 
530  UpdateServiceStatus(Info->pCurrentService);
531  ChangeListViewText(Info, Info->pCurrentService, LVSTATUS);
533  SetFocus(Info->hListView);
534  break;
535 
536  case ID_HELP:
538  L"Help is not yet implemented\n",
539  L"Note!",
541  SetFocus(Info->hListView);
542  break;
543 
544  case ID_EXIT:
545  PostMessage(Info->hMainWnd,
546  WM_CLOSE,
547  0,
548  0);
549  break;
550 
551  case ID_VIEW_LARGE:
552  SetListViewStyle(Info->hListView, LVS_ICON);
553  ListView_Arrange(Info->hListView, LVA_DEFAULT);
554 
555  CheckMenuRadioItem(GetMenu(Info->hMainWnd),
559  MF_BYCOMMAND);
560  break;
561 
562  case ID_VIEW_SMALL:
563  SetListViewStyle(Info->hListView, LVS_SMALLICON);
564  ListView_Arrange(Info->hListView, LVA_DEFAULT);
565 
566  CheckMenuRadioItem(GetMenu(Info->hMainWnd),
570  MF_BYCOMMAND);
571  break;
572 
573  case ID_VIEW_LIST:
574  SetListViewStyle(Info->hListView,
575  LVS_LIST);
576  CheckMenuRadioItem(GetMenu(Info->hMainWnd),
579  ID_VIEW_LIST,
580  MF_BYCOMMAND);
581  break;
582 
583  case ID_VIEW_DETAILS:
584  SetListViewStyle(Info->hListView,
585  LVS_REPORT);
586  CheckMenuRadioItem(GetMenu(Info->hMainWnd),
590  MF_BYCOMMAND);
591  break;
592 
593  case ID_VIEW_CUST:
594  break;
595 
596  case ID_ABOUT:
598  LoadStringW(hInstance, IDS_APPAUTHORS, szAppAuthors, _countof(szAppAuthors));
599 
601  ShellAboutW(Info->hMainWnd, szAppName, szAppAuthors, hIcon);
603  break;
604 
605  }
606 }
#define ID_RESUME
Definition: resource.h:21
#define IDS_APPAUTHORS
Definition: resource.h:8
#define MAKEINTRESOURCE
Definition: winuser.h:591
static HICON
Definition: imagelist.c:84
VOID OpenPropSheet(PMAIN_WND_INFO Info)
Definition: propsheet.c:30
#define ID_VIEW_DETAILS
Definition: resource.h:36
#define IDOK
Definition: winuser.h:824
#define ID_REFRESH
Definition: resource.h:16
#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:39
#define ID_EXPORT
Definition: resource.h:17
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define IDD_DLG_DELETE
Definition: resource.h:195
#define LVS_REPORT
Definition: commctrl.h:2258
BOOL WINAPI CheckMenuRadioItem(_In_ HMENU, _In_ UINT, _In_ UINT, _In_ UINT, _In_ UINT)
#define ACTION_STOP
Definition: precomp.h:40
BOOL RunActionWithProgress(HWND hParent, LPWSTR ServiceName, LPWSTR DisplayName, UINT Action, PVOID Param)
Definition: progress.c:372
HWND WINAPI SetFocus(_In_opt_ HWND)
#define ID_CREATE
Definition: resource.h:24
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int32_t INT
Definition: typedefs.h:58
struct TraceInfo Info
#define FALSE
Definition: types.h:117
#define ID_DELETE
Definition: resource.h:25
#define IDD_DLG_CREATE
Definition: resource.h:181
#define ID_PAUSE
Definition: resource.h:20
#define LVSTATUS
Definition: precomp.h:31
#define SERVICE_RUNNING
Definition: winsvc.h:24
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define ListView_Arrange(hwndLV, code)
Definition: commctrl.h:2529
#define ID_ABOUT
Definition: charmap.c:18
#define ACTION_RESUME
Definition: precomp.h:42
#define LVS_LIST
Definition: commctrl.h:2260
#define PostMessage
Definition: winuser.h:5807
#define ID_VIEW_LIST
Definition: resource.h:35
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _countof(array)
Definition: sndvol32.h:68
#define WM_CLOSE
Definition: winuser.h:1603
BOOL RefreshServiceList(PMAIN_WND_INFO Info)
Definition: listview.c:247
#define LVS_ICON
Definition: commctrl.h:2257
#define ID_START
Definition: resource.h:18
VOID ExportFile(PMAIN_WND_INFO Info)
Definition: export.c:98
#define MB_ICONINFORMATION
Definition: winuser.h:796
#define DialogBoxParam
Definition: winuser.h:5739
int ret
static const WCHAR L[]
Definition: oid.c:1250
#define SB_SETTEXT
Definition: commctrl.h:1945
BOOL WINAPI ShellAboutW(HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff, HICON hIcon)
#define ID_RESTART
Definition: resource.h:22
#define IDS_DELETE_STOP
Definition: resource.h:199
#define ID_VIEW_SMALL
Definition: resource.h:34
VOID DisplayString(LPWSTR Msg)
Definition: misc.c:211
#define ID_EXIT
Definition: resource.h:10
#define IDS_APPNAME
Definition: resource.h:49
TCHAR szAppName[128]
Definition: solitaire.cpp:16
#define ACTION_PAUSE
Definition: precomp.h:41
VOID ChangeListViewText(PMAIN_WND_INFO Info, ENUM_SERVICE_STATUS_PROCESS *pService, UINT Column)
Definition: listview.c:105
#define NO_ITEM_SELECTED
Definition: precomp.h:26
BOOL UpdateServiceStatus(ENUM_SERVICE_STATUS_PROCESS *pService)
Definition: query.c:373
HICON hIcon
Definition: msconfig.c:44
HINSTANCE hInstance
Definition: mainwnd.c:15
#define ID_PROP
Definition: resource.h:15
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:152
#define IDI_SM_ICON
Definition: resource.h:64
#define SendMessage
Definition: winuser.h:5818
#define LVA_DEFAULT
Definition: commctrl.h:2523
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
INT_PTR CALLBACK CreateDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: create.c:218
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define ID_VIEW_CUST
Definition: resource.h:32
#define ID_HELP
Definition: resource.h:26
HMENU WINAPI GetMenu(_In_ HWND)
#define LoadString
Definition: winuser.h:5794
#define ID_STOP
Definition: resource.h:19
#define LVS_SMALLICON
Definition: commctrl.h:2259
#define ACTION_RESTART
Definition: precomp.h:43
#define ID_VIEW_LARGE
Definition: resource.h:33

Referenced by MainWndProc().

◆ MainWndMenuHint()

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

Definition at line 81 of file mainwnd.c.

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

Referenced by MainWndProc().

◆ MainWndProc()

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

Definition at line 641 of file mainwnd.c.

645 {
647  LRESULT Ret = 0;
648 
649  /* Get the window context */
651  GWLP_USERDATA);
652  if (Info == NULL && msg != WM_CREATE)
653  {
654  goto HandleDefaultMessage;
655  }
656 
657  switch(msg)
658  {
659  case WM_CREATE:
660  {
661  Info = (PMAIN_WND_INFO)(((LPCREATESTRUCT)lParam)->lpCreateParams);
662 
663  /* Initialize the main window context */
664  Info->hMainWnd = hwnd;
665  Info->SelectedItem = NO_ITEM_SELECTED;
666 
669  (LONG_PTR)Info);
670 
671  if (!InitMainWnd(Info))
672  return -1;
673 
674  /* Fill the list-view before showing the main window */
676 
677  /* Show the window */
679  Info->nCmdShow);
680 
681  SetFocus(Info->hListView);
682  }
683  break;
684 
685  case WM_SIZE:
686  {
688  LOWORD(lParam),
689  HIWORD(lParam));
690  }
691  break;
692 
693  case WM_NOTIFY:
694  {
695  LPNMHDR pnmhdr = (LPNMHDR)lParam;
696 
697  switch (pnmhdr->code)
698  {
699  case NM_DBLCLK:
700  {
701  POINT pt;
702  RECT rect;
703 
704  GetCursorPos(&pt);
705  GetWindowRect(Info->hListView, &rect);
706 
707  if (PtInRect(&rect, pt))
708  {
710  WM_COMMAND,
711  //ID_PROP,
712  MAKEWPARAM((WORD)ID_PROP, (WORD)0),
713  0);
714  }
715 
716  //OpenPropSheet(Info);
717  }
718  break;
719 
720  case NM_RETURN:
721  {
723  WM_COMMAND,
724  //ID_PROP,
725  MAKEWPARAM((WORD)ID_PROP, (WORD)0),
726  0);
727  }
728  break;
729 
730  case LVN_COLUMNCLICK:
731  {
733  HDITEM hdi;
734 
735  /* get pending sort direction for clicked column */
736  hdi.mask = HDI_LPARAM;
737  (void)Header_GetItem(Info->hHeader, pnmv->iSubItem, &hdi);
738 
739  /* get new sort parameters */
740  Info->SortSelection = pnmv->iSubItem;
741  Info->SortDirection = hdi.lParam;
742 
743  /* set new sort direction and save */
744  hdi.lParam = (hdi.lParam == ORD_ASCENDING) ?
746 
747  (void)Header_SetItem(Info->hHeader, pnmv->iSubItem, &hdi);
748 
749  (void)ListView_SortItemsEx(Info->hListView,
750  CompareFunc,
751  (LPARAM)Info);
752  }
753  break;
754  case LVN_ITEMCHANGED:
755  {
757 
758  if (pnmv->uNewState != 0)
759  {
762  }
763  }
764  break;
765 
766  case TTN_GETDISPINFO:
767  {
768  LPTOOLTIPTEXT lpttt;
769  UINT idButton;
770 
771  lpttt = (LPTOOLTIPTEXT)lParam;
772 
773  /* Specify the resource identifier of the descriptive
774  * text for the given button. */
775  idButton = (UINT)lpttt->hdr.idFrom;
776  switch (idButton)
777  {
778  case ID_PROP:
779  lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_PROP);
780  break;
781 
782  case ID_REFRESH:
783  lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_REFRESH);
784  break;
785 
786  case ID_EXPORT:
787  lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_EXPORT);
788  break;
789 
790  case ID_CREATE:
791  lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_CREATE);
792  break;
793 
794  case ID_DELETE:
795  lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_DELETE);
796  break;
797 
798  case ID_START:
799  lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_START);
800  break;
801 
802  case ID_STOP:
803  lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_STOP);
804  break;
805 
806  case ID_PAUSE:
807  lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_PAUSE);
808  break;
809 
810  case ID_RESTART:
811  lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_RESTART);
812  break;
813  }
814  }
815  break;
816  }
817  }
818  break;
819 
820  case WM_CONTEXTMENU:
821  {
822  POINT pt;
823  RECT lvRect;
824 
825  INT xPos = GET_X_LPARAM(lParam);
826  INT yPos = GET_Y_LPARAM(lParam);
827 
828  GetCursorPos(&pt);
829 
830  /* display popup when cursor is in the list view */
831  GetWindowRect(Info->hListView, &lvRect);
832  if (PtInRect(&lvRect, pt))
833  {
834  TrackPopupMenuEx(GetSubMenu(Info->hShortcutMenu, 0),
836  xPos,
837  yPos,
838  Info->hMainWnd,
839  NULL);
840  }
841  }
842  break;
843 
844  case WM_COMMAND:
845  {
847  LOWORD(wParam),
848  (HWND)lParam);
849  goto HandleDefaultMessage;
850  }
851 
852  case WM_MENUSELECT:
853  {
854  if (Info->hStatus != NULL)
855  {
856  if (!MainWndMenuHint(Info,
857  LOWORD(wParam),
859  sizeof(MainMenuHintTable) / sizeof(MainMenuHintTable[0]),
861  {
863  LOWORD(wParam),
865  sizeof(SystemMenuHintTable) / sizeof(SystemMenuHintTable[0]),
867  }
868  }
869  }
870  break;
871 
872  case WM_ENTERMENULOOP:
873  {
874  Info->bInMenuLoop = TRUE;
876  break;
877  }
878 
879  case WM_EXITMENULOOP:
880  {
881  Info->bInMenuLoop = FALSE;
883  break;
884  }
885 
886  case WM_CLOSE:
887  {
889  DestroyMenu(Info->hShortcutMenu);
891  }
892  break;
893 
894  case WM_DESTROY:
895  {
897  0,
898  Info);
901  0);
902 
903  PostQuitMessage(0);
904  }
905  break;
906 
907  default:
908  {
909 HandleDefaultMessage:
910 
911  Ret = DefWindowProc(hwnd,
912  msg,
913  wParam,
914  lParam);
915  }
916  break;
917  }
918 
919  return Ret;
920 }
static const MENU_HINT SystemMenuHintTable[]
Definition: mainwnd.c:70
#define IDS_HINT_BLANK
Definition: resource.h:92
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define MAKEWPARAM(l, h)
Definition: winuser.h:3984
#define ID_REFRESH
Definition: resource.h:16
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define IDS_TOOLTIP_STOP
Definition: resource.h:19
#define WM_CONTEXTMENU
Definition: richedit.h:64
UINT uNewState
Definition: commctrl.h:3032
#define ID_EXPORT
Definition: resource.h:17
#define IDS_TOOLTIP_DELETE
Definition: resource.h:51
#define TRUE
Definition: types.h:120
#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:113
#define LVN_ITEMCHANGED
Definition: commctrl.h:3127
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:81
#define GET_X_LPARAM(lp)
Definition: windowsx.h:274
HWND WINAPI SetFocus(_In_opt_ HWND)
static BOOL InitMainWnd(PMAIN_WND_INFO Info)
Definition: mainwnd.c:334
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2635
#define HDITEM
Definition: commctrl.h:693
BOOL WINAPI DestroyWindow(_In_ HWND)
#define ID_CREATE
Definition: resource.h:24
int32_t INT
Definition: typedefs.h:58
static const MENU_HINT MainMenuHintTable[]
Definition: mainwnd.c:40
#define SetWindowLongPtr
Definition: treelist.c:70
& rect
Definition: startmenu.cpp:1413
WPARAM wParam
Definition: combotst.c:138
struct TraceInfo Info
struct tagNMHDR * LPNMHDR
#define IDS_TOOLTIP_CREATE
Definition: resource.h:50
UINT code
Definition: winuser.h:3134
#define TPM_RIGHTBUTTON
Definition: winuser.h:2355
#define FALSE
Definition: types.h:117
#define ID_DELETE
Definition: resource.h:25
#define IDS_TOOLTIP_PROP
Definition: resource.h:47
#define ID_PAUSE
Definition: resource.h:20
#define WM_ENTERMENULOOP
Definition: winuser.h:1786
#define WM_MENUSELECT
Definition: winuser.h:1729
#define Header_GetItem(hwndHD, i, phdi)
Definition: commctrl.h:747
#define TTN_GETDISPINFO
Definition: commctrl.h:1874
#define GWLP_USERDATA
Definition: treelist.c:63
#define WM_EXITMENULOOP
Definition: winuser.h:1787
smooth NULL
Definition: ftsmooth.c:416
static VOID CALLBACK MainWndResize(PMAIN_WND_INFO Info, WORD cx, WORD cy)
Definition: mainwnd.c:610
LONG_PTR LPARAM
Definition: windef.h:208
switch(r->id)
Definition: btrfs.c:2980
#define IDS_TOOLTIP_RESTART
Definition: resource.h:55
#define DefWindowProc
Definition: ros2win.h:31
#define WM_DESTROY
Definition: winuser.h:1591
#define ORD_ASCENDING
Definition: precomp.h:45
#define LPTOOLTIPTEXT
Definition: commctrl.h:1886
#define WM_SIZE
Definition: winuser.h:1593
#define IDS_TOOLTIP_REFRESH
Definition: resource.h:48
#define WM_CLOSE
Definition: winuser.h:1603
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:18
#define IDS_TOOLTIP_PAUSE
Definition: resource.h:25
#define ID_RESTART
Definition: resource.h:22
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define WM_COMMAND
Definition: winuser.h:1722
#define ORD_DESCENDING
Definition: precomp.h:46
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:26
#define NM_DBLCLK
Definition: commctrl.h:131
struct tagNMLISTVIEW * LPNMLISTVIEW
#define IDS_TOOLTIP_EXPORT
Definition: resource.h:49
static INT CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
Definition: mainwnd.c:243
#define ID_PROP
Definition: resource.h:15
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned int UINT
Definition: ndis.h:50
#define LVN_COLUMNCLICK
Definition: commctrl.h:3135
VOID SetMenuAndButtonStates(PMAIN_WND_INFO Info)
Definition: mainwnd.c:152
#define ListView_SortItemsEx(hwndLV, _pfnCompare, _lPrm)
Definition: commctrl.h:2797
#define GET_Y_LPARAM(lp)
Definition: windowsx.h:275
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)
#define msg(x)
Definition: auth_time.c:54
#define HDI_LPARAM
Definition: commctrl.h:702
#define SendMessage
Definition: winuser.h:5818
#define WM_CREATE
Definition: winuser.h:1590
#define HIWORD(l)
Definition: typedefs.h:247
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:52
#define GetWindowLongPtr
Definition: treelist.c:73
#define Header_SetItem(hwndHD, i, phdi)
Definition: commctrl.h:754
LONG_PTR LRESULT
Definition: windef.h:209
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:483
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define ID_STOP
Definition: resource.h:19
#define WM_NOTIFY
Definition: richedit.h:61
VOID FreeServiceList(PMAIN_WND_INFO Info)
Definition: query.c:257

Referenced by InitMainWindowImpl().

◆ MainWndResize()

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

Definition at line 610 of file mainwnd.c.

613 {
614  RECT rcClient, rcTool, rcStatus;
615  int lvHeight, iToolHeight, iStatusHeight;
616 
617  /* Size toolbar and get height */
618  SendMessage(Info->hTool, TB_AUTOSIZE, 0, 0);
619  GetWindowRect(Info->hTool, &rcTool);
620  iToolHeight = rcTool.bottom - rcTool.top;
621 
622  /* Size status bar and get height */
623  SendMessage(Info->hStatus, WM_SIZE, 0, 0);
624  GetWindowRect(Info->hStatus, &rcStatus);
625  iStatusHeight = rcStatus.bottom - rcStatus.top;
626 
627  /* Calculate remaining height and size list view */
628  GetClientRect(Info->hMainWnd, &rcClient);
629  lvHeight = rcClient.bottom - iToolHeight - iStatusHeight;
630  SetWindowPos(Info->hListView,
631  NULL,
632  0,
633  iToolHeight,
634  rcClient.right,
635  lvHeight,
636  SWP_NOZORDER);
637 }
LONG top
Definition: windef.h:307
#define SWP_NOZORDER
Definition: winuser.h:1232
LONG right
Definition: windef.h:308
struct TraceInfo Info
#define TB_AUTOSIZE
Definition: commctrl.h:1133
smooth NULL
Definition: ftsmooth.c:416
#define WM_SIZE
Definition: winuser.h:1593
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define SendMessage
Definition: winuser.h:5818
LONG bottom
Definition: windef.h:309
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)

Referenced by MainWndProc().

◆ pCreateToolbar()

static BOOL pCreateToolbar ( PMAIN_WND_INFO  Info)
static

Definition at line 256 of file mainwnd.c.

257 {
258  INT numButtons = sizeof(Buttons) / sizeof(Buttons[0]);
259 
260  Info->hTool = CreateWindowEx(0,
262  NULL,
264  0, 0, 0, 0,
265  Info->hMainWnd,
266  0,
267  hInstance,
268  NULL);
269  if(Info->hTool != NULL)
270  {
271  HIMAGELIST hImageList;
272 
273  SendMessage(Info->hTool,
275  0,
277 
278  SendMessage(Info->hTool,
280  sizeof(Buttons[0]),
281  0);
282 
283  hImageList = InitImageList(IDB_PROP,
284  IDB_RESTART,
287  IMAGE_BITMAP);
288  if (hImageList == NULL)
289  return FALSE;
290 
293  0,
294  (LPARAM)hImageList));
295 
296  SendMessage(Info->hTool,
298  numButtons,
299  (LPARAM)Buttons);
300 
301  return TRUE;
302  }
303 
304  return FALSE;
305 }
#define TB_BUTTONSTRUCTSIZE
Definition: commctrl.h:1130
#define TBSTYLE_EX_HIDECLIPPEDBUTTONS
Definition: commctrl.h:1009
#define TRUE
Definition: types.h:120
#define IDB_PROP
Definition: resource.h:70
#define WS_CHILD
Definition: pedump.c:617
int32_t INT
Definition: typedefs.h:58
struct TraceInfo Info
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
#define FALSE
Definition: types.h:117
#define CreateWindowEx
Definition: winuser.h:5730
#define TOOLBARCLASSNAME
Definition: commctrl.h:942
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define TB_SETIMAGELIST
Definition: commctrl.h:1146
int WINAPI GetSystemMetrics(_In_ int)
#define TBSTYLE_TOOLTIPS
Definition: commctrl.h:985
#define SM_CXSMICON
Definition: winuser.h:1002
HIMAGELIST InitImageList(UINT StartResource, UINT EndResource, UINT Width, UINT Height, ULONG type)
Definition: misc.c:219
#define TB_ADDBUTTONS
Definition: commctrl.h:1267
HINSTANCE hInstance
Definition: mainwnd.c:15
#define IMAGE_BITMAP
Definition: winuser.h:211
#define SendMessage
Definition: winuser.h:5818
#define IDB_RESTART
Definition: resource.h:78
#define WS_VISIBLE
Definition: pedump.c:620
static const TBBUTTON Buttons[]
Definition: mainwnd.c:18
#define TBSTYLE_FLAT
Definition: commctrl.h:988
#define TB_SETEXTENDEDSTYLE
Definition: commctrl.h:1186

Referenced by InitMainWnd().

◆ SetMenuAndButtonStates()

VOID SetMenuAndButtonStates ( PMAIN_WND_INFO  Info)

Definition at line 152 of file mainwnd.c.

153 {
155  UINT i;
156 
157  /* get handle to menu */
158  hMainMenu = GetMenu(Info->hMainWnd);
159 
160  /* set all to greyed */
161  for (i = ID_START; i <= ID_RESTART; i++)
162  {
164  EnableMenuItem(GetSubMenu(Info->hShortcutMenu, 0), i, MF_GRAYED);
165  SendMessage(Info->hTool, TB_SETSTATE, i,
167  }
168 
169  if (Info->SelectedItem != NO_ITEM_SELECTED)
170  {
171  LPQUERY_SERVICE_CONFIG lpServiceConfig = NULL;
172  DWORD Flags, State;
173 
174  /* allow user to delete service */
175  if (Info->bIsUserAnAdmin)
176  {
180  EnableMenuItem(GetSubMenu(Info->hShortcutMenu, 0), ID_DELETE, MF_ENABLED);
181  }
182 
183  Flags = Info->pCurrentService->ServiceStatusProcess.dwControlsAccepted;
184  State = Info->pCurrentService->ServiceStatusProcess.dwCurrentState;
185 
186  lpServiceConfig = GetServiceConfig(Info->pCurrentService->lpServiceName);
187 
188  if (lpServiceConfig && lpServiceConfig->dwStartType != SERVICE_DISABLED)
189  {
190  if (State == SERVICE_STOPPED)
191  {
193  EnableMenuItem(GetSubMenu(Info->hShortcutMenu, 0), ID_START, MF_ENABLED);
196  }
197 
199  {
201  EnableMenuItem(GetSubMenu(Info->hShortcutMenu, 0), ID_RESTART, MF_ENABLED);
204  }
205  }
206 
207  if(lpServiceConfig)
208  HeapFree(GetProcessHeap(), 0, lpServiceConfig);
209 
211  {
213  EnableMenuItem(GetSubMenu(Info->hShortcutMenu, 0), ID_STOP, MF_ENABLED);
216  }
217 
219  {
221  EnableMenuItem(GetSubMenu(Info->hShortcutMenu, 0), ID_PAUSE, MF_ENABLED);
224  }
225  }
226  else
227  {
228  /* disable tools which rely on a selected service */
231  EnableMenuItem(GetSubMenu(Info->hShortcutMenu, 0), ID_PROP, MF_GRAYED);
232  EnableMenuItem(GetSubMenu(Info->hShortcutMenu, 0), ID_DELETE, MF_GRAYED);
237  }
238 
239 }
#define TBSTATE_INDETERMINATE
Definition: commctrl.h:972
#define TB_SETSTATE
Definition: commctrl.h:1050
#define SERVICE_ACCEPT_STOP
Definition: winsvc.h:28
_In_ ULONG _In_ ULONG State
Definition: potypes.h:516
struct TraceInfo Info
#define SERVICE_DISABLED
Definition: cmtypes.h:979
HMENU hMainMenu
Definition: mplay32.c:25
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define SERVICE_STOPPED
Definition: winsvc.h:21
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define ID_DELETE
Definition: resource.h:25
#define ID_PAUSE
Definition: resource.h:20
#define SERVICE_RUNNING
Definition: winsvc.h:24
#define MAKELONG(a, b)
Definition: typedefs.h:249
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define SERVICE_ACCEPT_PAUSE_CONTINUE
Definition: winsvc.h:29
#define GetProcessHeap()
Definition: compat.h:484
#define MF_ENABLED
Definition: winuser.h:128
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ID_START
Definition: resource.h:18
LPQUERY_SERVICE_CONFIG GetServiceConfig(LPWSTR lpServiceName)
Definition: query.c:29
#define ID_RESTART
Definition: resource.h:22
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define NO_ITEM_SELECTED
Definition: precomp.h:26
#define ID_PROP
Definition: resource.h:15
unsigned int UINT
Definition: ndis.h:50
#define SendMessage
Definition: winuser.h:5818
#define TBSTATE_ENABLED
Definition: commctrl.h:970
#define MF_GRAYED
Definition: winuser.h:129
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:483
#define ID_STOP
Definition: resource.h:19

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

◆ UninitMainWindowImpl()

VOID UninitMainWindowImpl ( VOID  )

Definition at line 992 of file mainwnd.c.

993 {
995  hInstance);
996 }
static const WCHAR szMainWndClass[]
Definition: mainwnd.c:15
HINSTANCE hInstance
Definition: mainwnd.c:15
#define UnregisterClass
Definition: winuser.h:5836

Referenced by _tWinMain(), and wWinMain().

◆ UpdateMainStatusBar()

static VOID UpdateMainStatusBar ( PMAIN_WND_INFO  Info)
static

Definition at line 113 of file mainwnd.c.

114 {
115  if (Info->hStatus != NULL)
116  {
117  SendMessage(Info->hStatus,
118  SB_SIMPLE,
119  (WPARAM)Info->bInMenuLoop,
120  0);
121  }
122 }
UINT_PTR WPARAM
Definition: windef.h:207
struct TraceInfo Info
#define SB_SIMPLE
Definition: commctrl.h:1954
smooth NULL
Definition: ftsmooth.c:416
#define SendMessage
Definition: winuser.h:5818

Referenced by MainWndProc().

◆ UpdateServiceCount()

VOID UpdateServiceCount ( PMAIN_WND_INFO  Info)

Definition at line 125 of file mainwnd.c.

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

Referenced by DeleteDialogProc(), and RefreshServiceList().

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:85
#define ID_REFRESH
Definition: resource.h:16
#define ID_EXPORT
Definition: resource.h:17
#define TBSTATE_INDETERMINATE
Definition: commctrl.h:972
#define ID_CREATE
Definition: resource.h:24
#define BTNS_BUTTON
Definition: commctrl.h:994
#define ID_DELETE
Definition: resource.h:25
#define ID_PAUSE
Definition: resource.h:20
#define TBICON_START
Definition: resource.h:86
#define TBICON_PROP
Definition: resource.h:81
#define TBICON_EXPORT
Definition: resource.h:83
#define BTNS_SEP
Definition: commctrl.h:995
#define TBICON_RESTART
Definition: resource.h:89
#define ID_START
Definition: resource.h:18
#define TBICON_REFRESH
Definition: resource.h:82
#define ID_RESTART
Definition: resource.h:22
#define TBICON_CREATE
Definition: resource.h:84
#define TBICON_PAUSE
Definition: resource.h:88
#define ID_PROP
Definition: resource.h:15
#define TBICON_STOP
Definition: resource.h:60
#define TBSTATE_ENABLED
Definition: commctrl.h:970
#define ID_STOP
Definition: resource.h:19

Definition at line 18 of file mainwnd.c.

Referenced by MainWndCreateToolbarClient(), and pCreateToolbar().

◆ MainMenuHintTable

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

Definition at line 40 of file mainwnd.c.

Referenced by MainWndProc().

◆ SystemMenuHintTable

const MENU_HINT SystemMenuHintTable[]
static
Initial value:
= {
}
#define SC_RESTORE
Definition: winuser.h:2573
#define IDS_HINT_SYS_MINIMIZE
Definition: resource.h:121
#define SC_MAXIMIZE
Definition: winuser.h:2563
#define IDS_HINT_SYS_MOVE
Definition: resource.h:119
#define IDS_HINT_SYS_RESTORE
Definition: resource.h:118
#define IDS_HINT_SYS_SIZE
Definition: resource.h:120
#define SC_MINIMIZE
Definition: winuser.h:2561
#define SC_SIZE
Definition: winuser.h:2559
#define IDS_HINT_SYS_MAXIMIZE
Definition: resource.h:122
#define SC_MOVE
Definition: winuser.h:2560
#define SC_CLOSE
Definition: winuser.h:2567
#define IDS_HINT_SYS_CLOSE
Definition: resource.h:123

Definition at line 70 of file mainwnd.c.

Referenced by MainWndProc().

◆ szMainWndClass

const WCHAR szMainWndClass[] = L"ServManWndClass"
static

Definition at line 15 of file mainwnd.c.

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