title image


Smiley Update für Windows 9x...
auf Nachfrage folgende Ergänzungen...procedure terminate(error: DWORD);begin if (evTerminate 0) then begin CloseHandle(evTerminate); evTerminate := 0; end; if (hStatus 0) then SendStatus(SERVICE_STOPPED, error, 0, 0, 0); if (hThread 0) then begin CloseHandle(hThread); hThread := 0; end; ExitProcess(error); // this line I added ;)end;{...}begin if GetVersionEx(VersInfos) then WindowsNT := VersInfos.dwPlatformId = VER_PLATFORM_WIN32_NT; for ParamLoop := 1 to ParamCount do begin Parameter := ParamStr(ParamLoop) + #0; CharLower(@Parameter[1]); if (Copy(Parameter, 2, Length(InstCmd)) = InstCmd) then ParamInst := True; if (Copy(Parameter, 2, Length(RemvCmd)) = RemvCmd) then ParamRemv := True; if (Copy(Parameter, 2, Length(NMsgCmd)) = NMsgCmd) then ParamNMsg := True; end; if ParamInst then InstallService else if ParamRemv then RemoveService else begin if WindowsNT then begin sTable.lpServiceProc := @ServiceMain; sTable.lpServiceName := SERVICE_NAME; if not StartServiceCtrlDispatcher(sTable) then begin ZeroMemory(@szBuffer, SizeOf(szBuffer)); FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM or FORMAT_MESSAGE_IGNORE_INSERTS, nil, GetLastError, LANG_USER_DEFAULT, szBuffer, MAX_PATH, nil); MessageBoxA(0, szBuffer, SERVICE_NAME, MB_OK or MB_ICONERROR); end; end else begin // Start your service here on system that are not Windows NT/2000 Init(); // Loop until the service should end // I dislplay a simple MessageBox - it's beeps until OK ;) MessageBox(0, 'This service demo is only for Windows NT ;)', SERVICE_NAME, 0); // Terminate the Thread(s) and the program terminate(0); end; end;end.cu

geschrieben von

Login

E-Mail:
  

Passwort:
  

Beitrag anfügen

Symbol:
 
 
 
 
 
 
 
 
 
 
 
 
 

Überschrift: