Windows NT ( 2)



         

SRVCTRL - 5


MB_OK | MB_ICONINFORMATION);

//

free(lpBuf);

}

//

//

CloseServiceHandle(schSCManager);

break;

}

case ID_HELP_ABOUT:

{

MessageBox(hWnd,

"Simple Service Control\n"

"(C) Alexandr Frolov, 1996\n"

"Email: frolov@glas.apc.org",

szAppTitle, MB_OK | MB_ICONINFORMATION);

return 0L;

break;

}

default:

break;

}

return FORWARD_WM_COMMAND(hWnd, id, hwndCtl, codeNotify,

DefWindowProc);

}

srvctrl.h ( 5.4) .

5.4. service/srvctrl.h

//

#define MYServiceName "Sample of simple service"

// -----------------------------------------------------

//

// -----------------------------------------------------

LRESULT WINAPI

WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);

void WndProc_OnCommand(HWND hWnd, int id,

HWND hwndCtl, UINT codeNotify);

void WndProc_OnDestroy(HWND hWnd);

LRESULT WINAPI

DlgProc(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam);

BOOL DlgProc_OnInitDialog(HWND hdlg, HWND hwndFocus,

LPARAM lParam);

void DlgProc_OnCommand(HWND hdlg, int id,

HWND hwndCtl, UINT codeNotify);

resource.h ( 5.5) , .

5.5. service/resource.h

//{{NO_DEPENDENCIES}}

// Microsoft Developer Studio generated include file.

// Used by srvctrl.rc

//

#define IDR_MENU1 101

#define IDR_APPMENU 101

#define IDI_APPICON 102

#define IDI_APPICONSM 103

#define ID_FILE_EXIT 40001

#define ID_HELP_ABOUT 40002