35 _In_ HWND ParentWindowHandle
72 SendMessage(GetDlgItem(hwndDlg, IDOK), BCM_SETSHIELD, 0,
TRUE);
75 SendMessage(hwndDlg, WM_NEXTDLGCTL, (WPARAM)GetDlgItem(hwndDlg,
IDC_NAME),
TRUE);
80 switch (LOWORD(wParam))
84 EndDialog(hwndDlg, IDCANCEL);
90 BOOLEAN success =
FALSE;
91 SC_HANDLE scManagerHandle;
92 SC_HANDLE serviceHandle;
93 ULONG win32Result = 0;
100 ULONG serviceStartType;
101 ULONG serviceErrorControl;
118 if (scManagerHandle = OpenSCManager(NULL, NULL, SC_MANAGER_CREATE_SERVICE))
120 if (serviceHandle = CreateService(
123 serviceDisplayName->
Buffer,
124 SERVICE_CHANGE_CONFIG,
128 serviceBinaryPath->
Buffer,
136 EndDialog(hwndDlg, IDOK);
137 CloseServiceHandle(serviceHandle);
142 win32Result = GetLastError();
145 CloseServiceHandle(scManagerHandle);
149 win32Result = GetLastError();
158 serviceDisplayName->
Buffer,
162 serviceBinaryPath->
Buffer,
173 EndDialog(hwndDlg, IDOK);
185 PhShowStatus(hwndDlg, L
"Unable to create the service", status, win32Result);
192 { L
"Executable files (*.exe;*.sys)", L
"*.exe;*.sys" },
193 { L
"All files (*.*)", L
"*.*" }