Changeset 6817602 in nscp for modules/SysTray
- Timestamp:
- 02/22/06 21:47:57 (7 years ago)
- Branches:
- master, 0.4.0, 0.4.1, 0.4.2, stable
- Children:
- 1b7ae3d
- Parents:
- 89f1a84
- Location:
- modules/SysTray
- Files:
-
- 4 edited
-
SysTray.cpp (modified) (4 diffs)
-
SysTray.def (modified) (1 diff)
-
SysTray.h (modified) (3 diffs)
-
SysTray.vcproj (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
modules/SysTray/SysTray.cpp
re26cfe0 r6817602 5 5 #include "SysTray.h" 6 6 #include "TrayIcon.h" 7 #include <ServiceCmd.h> 8 #include <config.h> 7 9 8 10 SysTray gSysTray; … … 17 19 SysTray::~SysTray() {} 18 20 bool SysTray::loadModule() { 21 std::cout << "Systray: " << serviceControll::GetServiceType(SZSERVICENAME) << std::endl; 22 if ((serviceControll::GetServiceType(SZSERVICENAME)&SERVICE_INTERACTIVE_PROCESS)!=SERVICE_INTERACTIVE_PROCESS) { 23 NSC_LOG_ERROR("SysTray is not installed (or it cannot interact with the desktop) SysTray wont be loaded. Run " SZAPPNAME " SysTray install ti change this."); 24 return true; 25 } 19 26 icon.createThread(); 20 27 return true; … … 29 36 } 30 37 38 int SysTray::commandLineExec(const char* command,const unsigned int argLen,char** args) { 39 if (stricmp(command, "install") == 0) { 40 try { 41 serviceControll::ModifyServiceType(SZSERVICENAME, SERVICE_WIN32_OWN_PROCESS | SERVICE_INTERACTIVE_PROCESS); 42 NSC_LOG_MESSAGE(MODULE_NAME " is now able to run as the SERVICE_INTERACTIVE_PROCESS flag has been set."); 43 } catch (const serviceControll::SCException& e) { 44 NSC_LOG_ERROR("Could not modify service: " + e.error_); 45 return -1; 46 } 47 } else if (stricmp(command, "uninstall") == 0) { 48 try { 49 serviceControll::ModifyServiceType(SZSERVICENAME, SERVICE_WIN32_OWN_PROCESS); 50 NSC_LOG_MESSAGE(MODULE_NAME " is now not able to run as the SERVICE_INTERACTIVE_PROCESS flag has been reset."); 51 } catch (const serviceControll::SCException& e) { 52 NSC_LOG_ERROR("Could not modify service: " + e.error_); 53 return -1; 54 } 55 } 56 return 0; 57 } 31 58 32 59 bool SysTray::hasCommandHandler() { … … 40 67 NSC_WRAPPERS_IGNORE_MSG_DEF(); 41 68 NSC_WRAPPERS_IGNORE_CMD_DEF(); 69 NSC_WRAPPERS_CLI_DEF(gSysTray); 42 70 -
modules/SysTray/SysTray.def
re26cfe0 r6817602 12 12 NSUnloadModule 13 13 NSGetModuleDescription 14 NSCommandLineExec -
modules/SysTray/SysTray.h
re26cfe0 r6817602 4 4 5 5 NSC_WRAPPERS_MAIN(); 6 NSC_WRAPPERS_CLI(); 6 7 8 9 #define MODULE_NAME "SystemTray" 7 10 class SysTray { 8 11 private: … … 17 20 18 21 std::string getModuleName() { 19 return "System Tray icon";22 return MODULE_NAME; 20 23 } 21 24 NSCModuleWrapper::module_version getModuleVersion() { … … 30 33 bool hasCommandHandler(); 31 34 bool hasMessageHandler(); 35 int commandLineExec(const char* command,const unsigned int argLen,char** args); 36 32 37 }; -
modules/SysTray/SysTray.vcproj
rcea178b r6817602 170 170 <File 171 171 RelativePath="..\..\include\NSCHelper.cpp"> 172 </File> 173 <File 174 RelativePath="..\..\include\ServiceCmd.cpp"> 172 175 </File> 173 176 <File … … 216 219 </File> 217 220 <File 221 RelativePath="..\..\include\ServiceCmd.h"> 222 </File> 223 <File 218 224 RelativePath=".\stdafx.h"> 219 225 </File>
Note: See TracChangeset
for help on using the changeset viewer.








