View Single Post
Old 1st June 2017, 13:27   #134
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,420
PHP Code:
!define SVCNAME "Fax"
!include LogicLib.nsh
!define /ifndef SERVICE_QUERY_STATUS 4
System
::Call 'ADVAPI32::OpenSCManager(p0, p0, i1)p.r1'
${If} $1 P<> 0
    System
::Call 'ADVAPI32::OpenService(pr1, t"${SVCNAME}", i${SERVICE_QUERY_STATUS})p.r2'
    
System::Call 'ADVAPI32::CloseServiceHandle(pr1)'
    
${If} $2 P<> 0
        System
::Call 'ADVAPI32::QueryServiceStatus(pr2, @r3)i.r0' NoteNSIS 3syntax to "allocate" a SERVICE_STATUS
        
${If} $<> 0
            System
::Call '*$3(i,i.r4,i,i.r5,i.r6)'
            
DetailPrint "CurrentState=$4 Win32ExitCode=$5 ServiceSpecificExitCode=$6"
        
${EndIf}
        
System::Call 'ADVAPI32::CloseServiceHandle(pr2)'
    
${EndIf}
${EndIf} 
There is a PayPal donation link on the SimpleSC wiki page so perhaps the author would be willing to add it for you...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote