├── .gitattributes ├── .github └── workflows │ └── glpi-agentmonitor-ci.yml ├── .gitignore ├── CHANGES ├── GLPI-AgentMonitor.cpp ├── GLPI-AgentMonitor.rc ├── GLPI-AgentMonitor.rc2 ├── GLPI-AgentMonitor.vcxproj ├── LICENSE ├── README.md ├── Resources ├── glpierr.ico ├── glpilogo.png └── glpiok.ico ├── THANKS ├── framework.h ├── resource.h ├── screenshot.png ├── targetver.h └── version.h /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.github/workflows/glpi-agentmonitor-ci.yml: -------------------------------------------------------------------------------- 1 | name: GLPI Agent Monitor CI 2 | 3 | on: 4 | push: 5 | pull_request: 6 | branches: 7 | - main 8 | 9 | jobs: 10 | windows-compile: 11 | runs-on: windows-latest 12 | 13 | strategy: 14 | matrix: 15 | arch: [ x64, x86 ] 16 | 17 | steps: 18 | - uses: actions/checkout@v4 19 | - uses: ilammy/msvc-dev-cmd@v1.13.0 20 | with: 21 | arch: ${{ matrix.arch }} 22 | - name: Set version 23 | run: | 24 | shopt -s extglob 25 | echo "#define VI_FILENAME \"GLPI-AgentMonitor-$ARCH.exe\"" > version.h 26 | if [ -z "${GITHUB_REF##refs/tags/*}" ]; then 27 | TAG=${GITHUB_REF#refs/tags/} 28 | VTAG=${TAG#*-} 29 | if [ -n "$TAG" -a -z "${TAG##+([[:digit:]]).+([[:digit:]]).+([[:digit:]])?(-*)}" ]; then 30 | FULLVERSION=${TAG%%-*} 31 | BUILD_VERSION=${FULLVERSION##*.} 32 | VERSION=${FULLVERSION%.*} 33 | MAJOR_VERSION=${VERSION%.*} 34 | MINOR_VERSION=${VERSION#*.} 35 | echo "#define VI_VERSIONDEF $MAJOR_VERSION,$MINOR_VERSION,$BUILD_VERSION,0" >> version.h 36 | echo "#define VI_VERSIONSTRING \"$MAJOR_VERSION.$MINOR_VERSION.$BUILD_VERSION.0\"" >> version.h 37 | fi 38 | if [ -n "$VTAG" ]; then 39 | echo "#define VI_PRODUCTNAME \"GLPI Agent Monitor ($VTAG)\"" >> version.h 40 | fi 41 | fi 42 | shell: bash 43 | env: 44 | ARCH: ${{ matrix.arch }} 45 | - name: Compile and link 46 | run: | 47 | msbuild GLPI-AgentMonitor.vcxproj -p:Configuration=Release -p:Platform=${{ matrix.arch }} -p:OutDir=Release\ -p:IntermediateOutputPath=Release\ -v:detailed -fl -flp:logfile=Release\msbuild.log 48 | - name: Rename built binary to include ${{ matrix.arch }} 49 | run: | 50 | mv -f "Release\\GLPI-AgentMonitor.exe" "Release\\GLPI-AgentMonitor-${{ matrix.arch }}.exe" 51 | shell: bash 52 | - name: Code Signing 53 | id: signing 54 | if: ${{ startsWith(github.ref, 'refs/tags/') && env.CODESIGN_COMMAND && vars.WIN32_SIGNING != 'no' }} 55 | run: | 56 | umask 0077 57 | mkdir ~/.ssh 58 | echo "$CODESIGN_KNOWNHOST" > ~/.ssh/known_hosts 59 | echo "$CODESIGN_PRIVATE" > private.key 60 | umask 0002 61 | EXE="GLPI-AgentMonitor-${{ matrix.arch }}.exe" 62 | cat "Release\\$EXE" | $CODESIGN_COMMAND codesign "$EXE" > "$EXE" 63 | rm -f private.key ~/.ssh/known_hosts "Release\\$EXE" 64 | mv -f "$EXE" "Release\\$EXE" 65 | read SHA256 XXX <<<$(sha256sum "Release\\$EXE") 66 | echo "$EXE SHA256: $SHA256" 67 | echo "sha256=$SHA256" >>$GITHUB_OUTPUT 68 | shell: bash 69 | env: 70 | CODESIGN_KNOWNHOST: ${{ secrets.CODESIGN_KNOWNHOST }} 71 | CODESIGN_COMMAND: ${{ secrets.CODESIGN_COMMAND }} 72 | CODESIGN_PRIVATE: ${{ secrets.CODESIGN_PRIVATE }} 73 | - name: Upload built artifact 74 | uses: actions/upload-artifact@v4 75 | if: success() || failure() 76 | with: 77 | name: GLPI-AgentMonitor-Build-${{ matrix.arch }} 78 | path: | 79 | Release\*.exe 80 | - name: Upload build logs artifact 81 | uses: actions/upload-artifact@v4 82 | if: success() || failure() 83 | with: 84 | name: GLPI-AgentMonitor-BuildLogs-${{ matrix.arch }} 85 | path: | 86 | Release\msbuild.log 87 | Release\*.tlog 88 | version.h 89 | - name: VirusTotal Scan submission 90 | if: startsWith(github.ref, 'refs/tags/') 91 | uses: crazy-max/ghaction-virustotal@v4 92 | with: 93 | vt_api_key: ${{ secrets.VT_API_KEY }} 94 | files: | 95 | Release\\GLPI-AgentMonitor-${{ matrix.arch }}.exe 96 | - name: VirusTotal Analysis report check 97 | if: startsWith(github.ref, 'refs/tags/') && env.VT_API_KEY 98 | run: | 99 | let TRY=20 100 | while curl -s --request GET --url https://www.virustotal.com/api/v3/files/$SHA256 --header "x-apikey: $VT_API_KEY" >vt.json 101 | do 102 | ERRCODE=$(jq .error.code vt.json 2>&1) 103 | if [ "$ERRCODE" == "null" ]; then 104 | if [ "$(jq .data.attributes.last_analysis_results.VBA32 vt.json)" != "null" ]; then 105 | echo "$(date): Current analysis stats:" 106 | jq .data.attributes.last_analysis_stats vt.json 107 | MALICIOUS="$(jq .data.attributes.last_analysis_stats.malicious vt.json)" 108 | SUSPICIOUS="$(jq .data.attributes.last_analysis_stats.suspicious vt.json)" 109 | if [ -n "$MALICIOUS" -a "$MALICIOUS" != "null" -a "$MALICIOUS" -gt 0 ]; then 110 | echo "::warning title=Malicious analysis reporting for GLPI-AgentMonitor-${{ matrix.arch }}.exe::See https://www.virustotal.com/gui/file/$SHA256" 111 | fi 112 | if [ -n "$SUSPICIOUS" -a "$SUSPICIOUS" != "null" -a "$SUSPICIOUS" -gt 0 ]; then 113 | echo "::warning title=Suspicious analysis reporting for GLPI-AgentMonitor-${{ matrix.arch }}.exe::See https://www.virustotal.com/gui/file/$SHA256" 114 | fi 115 | break 116 | else 117 | echo "$(date): Analysis is running" 118 | fi 119 | else 120 | echo "$(date): $ERRCODE" 121 | if [ "$TRY" -lt 15 -a "$ERRCODE" != '"NotFoundError"' ]; then 122 | echo "$(date): Failing to access VT reporting" 123 | break 124 | fi 125 | fi 126 | rm -f vt.json 127 | if (( --TRY < 0 )); then 128 | echo "$(date): Nothing to report" 129 | break 130 | fi 131 | sleep 15 132 | done 133 | exit 0 134 | shell: bash 135 | env: 136 | VT_API_KEY: ${{ secrets.VT_API_KEY }} 137 | SHA256: ${{ steps.signing.outputs.sha256 }} 138 | 139 | release: 140 | 141 | runs-on: ubuntu-latest 142 | 143 | if: ${{ startsWith(github.ref, 'refs/tags/') }} 144 | needs: [ windows-compile ] 145 | 146 | steps: 147 | - name: Download x64 Artifact 148 | uses: actions/download-artifact@v4 149 | with: 150 | pattern: GLPI-AgentMonitor-Build-* 151 | merge-multiple: true 152 | - name: Get sha256 sums 153 | id: sha256 154 | run: | 155 | read X64 XXX <<< $( sha256sum GLPI-AgentMonitor-x64.exe ) 156 | read X86 XXX <<< $( sha256sum GLPI-AgentMonitor-x86.exe ) 157 | echo "GLPI-AgentMonitor-x64.exe SHA256: $X64" 158 | echo "GLPI-AgentMonitor-x86.exe SHA256: $X86" 159 | echo "x64=$X64" >>$GITHUB_OUTPUT 160 | echo "x86=$X86" >>$GITHUB_OUTPUT 161 | shell: bash 162 | - name: Publish release 163 | uses: softprops/action-gh-release@v2 164 | with: 165 | draft: ${{ contains(github.ref_name, 'test') }} 166 | prerelease: ${{ contains(github.ref_name, 'beta') }} 167 | name: GLPI Agent Monitor v${{ github.ref_name }} 168 | body: | 169 | ## For 64 bits Windows OS, use: 170 | [GLPI-AgentMonitor-x64.exe](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/GLPI-AgentMonitor-x64.exe) 171 | 172 | ## For 32 bits Windows OS, use: 173 | [GLPI-AgentMonitor-x86.exe](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/GLPI-AgentMonitor-x86.exe) 174 | 175 | ## VirusTotal reports 176 | * [GLPI-AgentMonitor-x64.exe VirusTotal report](https://www.virustotal.com/gui/file/${{ steps.sha256.outputs.x64 }}) 177 | * [GLPI-AgentMonitor-x86.exe VirusTotal report](https://www.virustotal.com/gui/file/${{ steps.sha256.outputs.x86 }}) 178 | fail_on_unmatched_files: true 179 | files: | 180 | GLPI-AgentMonitor-*.exe 181 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | GLPI-AgentMonitor.aps 2 | Release 3 | *.vcxproj.user 4 | .vs 5 | Thumbs.db 6 | Debug 7 | enc_temp_folder 8 | -------------------------------------------------------------------------------- /CHANGES: -------------------------------------------------------------------------------- 1 | Revision history for GLPI Agent Monitor 2 | 3 | 1.4.1 4 | 5 | * Fixed a bug where pressing the Space or Enter/Return keys during a restart 6 | of the Agent service can cause the Start/Stop service button to be pressed 7 | even when the Monitor window is not visible, triggering a UAC prompt if the 8 | user is not an administrator. 9 | 10 | 11 | 1.4.0 12 | 13 | * Dutch translation added 14 | Thanks Jeffrey Jansma (@perplexityjeff) 15 | 16 | * Catalan translation added 17 | Thanks Bertu Garangou (@bertugarangou) 18 | 19 | * When trying to run GLPI Agent Monitor (from Start Menu or directly from the 20 | executable) and another instance is already running, the running Monitor's 21 | window will now be shown. (This won't work if the Monitor's running instance 22 | is elevated) 23 | 24 | * Disabled the check for "http://" or "https://" on the GLPI Agent server URL 25 | parameter, because the URL may be valid without them. 26 | 27 | * Fixed a bug where "New Ticket" showed an error if the server URL didn't start 28 | with "http://" or "https://". This error persisted even after setting a custom 29 | new ticket URL and the Monitor wasn't closed and reopened after this. 30 | 31 | * Added a setting to control whether a screenshot is taken when clicking the 32 | "New Ticket" button. 33 | 34 | 35 | 1.3.1 36 | 37 | * Handle empty value for the NewTicket-URL setting 38 | 39 | 40 | 1.3.0 41 | 42 | * Better error message handling 43 | The Monitor now displays the error message when displaying error codes. 44 | The messages are retrieved from Windows in the user's language. 45 | Also, "GLPI Agent Monitor" is displayed on the error message captions. 46 | 47 | * Settings dialog added 48 | Currently, the only setting available is "New ticket page URL", for 49 | changing the URL used to create new tickets (i.e. when using Form Creator) 50 | 51 | * Main window now handles Tab and Esc key pressing 52 | This is a helpful feature for keyboard-only navigation 53 | 54 | * Changed agent status querying to asynchronous 55 | The WinHttp calls made to query the agent status were changed to asynchronous. 56 | This fixes the lagging that can happen sometimes on the Monitor's main window, 57 | especially when opening it for the first time. 58 | 59 | * Bugfix: Don't keep service manager handle and Agent service handle open 60 | all the time 61 | This solves a problem that happens when the Monitor is running and GLPI Agent 62 | uninstaller is executed under the Local System account. 63 | 64 | 65 | 1.2.3 66 | 67 | * Russian translation added 68 | Thanks Fedorov Nikolay (@kofe88) 69 | 70 | * Spanish (Uruguay) translation added 71 | Thanks Luis Giordano (@Iruxos) 72 | 73 | * Bugfix: Strip quotes when getting server URL from registry 74 | This removes quotes from the server URL setting, even though the server URL 75 | should not have any quotes at all. 76 | 77 | 78 | 1.2.2 79 | 80 | * Build: Don't sign generated code with an expired code-signing certificate 81 | 82 | 83 | 1.2.1 84 | 85 | * Bugfix: Fixed a bug which causes the monitor to display the 86 | "Screenshot taken" notification every time the systray icon 87 | changes color if the "New ticket" button was clicked at 88 | least once in the process' lifetime. 89 | 90 | 91 | 1.2.0 92 | 93 | * Agent service control button added on main window 94 | This button controls the Agent service status. It is a single button 95 | that stops the service if it's running, starts if it's stopped 96 | and resumes the service if it's paused. Pause support wasn't 97 | added as it likely isn't necessary. 98 | Windows will ask for elevation to control the Agent service. 99 | 100 | * Italian translation added 101 | Thanks Kintaro Oe (@kintaro1981) 102 | 103 | * Bugfix (#6): Fixed a bug which causes the Monitor to ignore 104 | HTTP URLs when clicking the "New ticket" button 105 | 106 | * French translation added 107 | Thanks Guillaume Bougard (@g-bougard) 108 | 109 | 110 | 1.1.0 111 | 112 | * "New ticket" button added on main window and right-click menu 113 | This button opens the "New ticket" page using the URL obtained 114 | from the "server" parameter of GLPI Agent. It also takes a 115 | screenshot and notifies the user about it and how to attach 116 | it to the new ticket. 117 | 118 | * "View agent logs" button added on main window and right-click menu 119 | This button opens the GLPI Agent logfile, as configured in 120 | the "logfile" parameter. It opens the file directly, so it uses 121 | your system's preferred log file viewer. 122 | 123 | 124 | 1.0.0 125 | 126 | Initial release 127 | -------------------------------------------------------------------------------- /GLPI-AgentMonitor.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * --------------------------------------------------------------------------- 3 | * GLPI-AgentMonitor.cpp 4 | * Copyright (C) 2023, 2025 Leonardo Bernardes (redddcyclone) 5 | * --------------------------------------------------------------------------- 6 | * 7 | * LICENSE 8 | * 9 | * This file is free software; you can redistribute it and/or modify it 10 | * under the terms of the GNU General Public License as published by the 11 | * Free Software Foundation; either version 2 of the License, or (at your 12 | * option) any later version. 13 | * 14 | * 15 | * This file is distributed in the hope that it will be useful, but WITHOUT 16 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 17 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 18 | * more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program; if not, write to the Free Software Foundation, 22 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA, 23 | * or see . 24 | * 25 | * --------------------------------------------------------------------------- 26 | * 27 | * @author(s) Leonardo Bernardes (redddcyclone) 28 | * @license GNU GPL version 2 or (at your option) any later version 29 | * http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html 30 | * @since 2023 31 | * 32 | * --------------------------------------------------------------------------- 33 | */ 34 | 35 | 36 | //-[LIBRARIES]----------------------------------------------------------------- 37 | 38 | #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") 39 | #pragma comment(lib, "comctl32.lib") 40 | #pragma comment(lib, "gdiplus.lib") 41 | #pragma comment(lib, "version.lib") 42 | #pragma comment(lib, "Winhttp.lib") 43 | #pragma comment(lib, "Shlwapi.lib") 44 | 45 | 46 | //-[DEFINES]------------------------------------------------------------------- 47 | 48 | #define SERVICE_NAME L"GLPI-Agent" 49 | #define USERAGENT_NAME L"GLPI-AgentMonitor" 50 | 51 | 52 | //-[INCLUDES]------------------------------------------------------------------ 53 | 54 | #include 55 | #include 56 | #include 57 | #include 58 | #include 59 | #include 60 | #include 61 | #include 62 | #include 63 | #include 64 | #include 65 | #include "framework.h" 66 | #include "resource.h" 67 | 68 | 69 | //-[GLOBALS AND OTHERS]-------------------------------------------------------- 70 | 71 | using namespace std; 72 | 73 | // Main window message processing callback 74 | LRESULT CALLBACK DlgProc(HWND, UINT, WPARAM, LPARAM); 75 | // Settings dialog message processing callback 76 | LRESULT CALLBACK SettingsDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); 77 | 78 | // App instance 79 | HINSTANCE hInst; 80 | 81 | // App mutex (to prevent multiple instances) 82 | HANDLE hMutex; 83 | 84 | // EnumWindows callback data 85 | struct EnumWindowsData { 86 | DWORD dwSearchPID; 87 | HWND hWndFound; 88 | }; 89 | 90 | // WinHTTP connection and session handles 91 | HINTERNET hSession, hConn; 92 | 93 | // Runtime variables 94 | BOOL bAgentInstalled = true; 95 | BOOL glpiAgentOk = true; 96 | SERVICE_STATUS svcStatus; 97 | SERVICE_STATUS lastSvcStatus = {}; 98 | WCHAR szAgStatus[128]; 99 | 100 | // WinHTTP request handle 101 | HINTERNET hReq = NULL; 102 | 103 | // GDI+ related 104 | Gdiplus::GdiplusStartupInput gdiplusStartupInput; 105 | ULONG_PTR gdiplusToken; 106 | 107 | // Taskbar icon identifier 108 | NOTIFYICONDATA nid = { sizeof(nid) }; 109 | // Taskbar icon interaction message ID 110 | UINT const WMAPP_NOTIFYCALLBACK = WM_APP + 1; 111 | 112 | // Dynamic text colors 113 | COLORREF colorSvcStatus = RGB(0, 0, 0); 114 | 115 | // GLPI server URL 116 | WCHAR szServer[256]; 117 | 118 | // New ticket URL 119 | WCHAR szNewTicketURL[300]; 120 | 121 | // Agent logfile 122 | WCHAR szLogfile[MAX_PATH]; 123 | 124 | // Enable screenshot capture 125 | BOOL bNewTicketScreenshot = TRUE; 126 | 127 | // Global string buffer 128 | WCHAR szBuffer[256]; 129 | DWORD dwBufferLen = sizeof(szBuffer) / sizeof(WCHAR); 130 | 131 | 132 | //-[APP FUNCTIONS]------------------------------------------------------------- 133 | 134 | // Load resource embedded PNG file as a bitmap 135 | BOOL LoadPNGAsBitmap(HMODULE hInstance, LPCWSTR pName, LPCWSTR pType, HBITMAP *bitmap) 136 | { 137 | Gdiplus::Bitmap* m_pBitmap; 138 | 139 | HRSRC hResource = FindResource(hInstance, pName, pType); 140 | if (!hResource) 141 | return false; 142 | DWORD imageSize = SizeofResource(hInstance, hResource); 143 | if (!imageSize) 144 | return false; 145 | HGLOBAL tempRes = LoadResource(hInstance, hResource); 146 | if (!tempRes) 147 | return false; 148 | const void* pResourceData = LockResource(tempRes); 149 | if (!pResourceData) 150 | return false; 151 | 152 | HGLOBAL m_hBuffer = GlobalAlloc(GMEM_MOVEABLE, imageSize); 153 | if (m_hBuffer) { 154 | void* pBuffer = GlobalLock(m_hBuffer); 155 | if (pBuffer) { 156 | CopyMemory(pBuffer, pResourceData, imageSize); 157 | IStream* pStream = NULL; 158 | if (CreateStreamOnHGlobal(m_hBuffer, FALSE, &pStream) == S_OK) { 159 | m_pBitmap = Gdiplus::Bitmap::FromStream(pStream); 160 | pStream->Release(); 161 | if (m_pBitmap) { 162 | if (m_pBitmap->GetLastStatus() == Gdiplus::Ok) { 163 | m_pBitmap->GetHBITMAP(0, bitmap); 164 | return true; 165 | } 166 | delete m_pBitmap; 167 | m_pBitmap = NULL; 168 | } 169 | } 170 | m_pBitmap = NULL; 171 | GlobalUnlock(m_hBuffer); 172 | } 173 | GlobalFree(m_hBuffer); 174 | m_hBuffer = NULL; 175 | } 176 | return false; 177 | } 178 | 179 | // Shows a window and force it to appear over all others 180 | VOID ShowWindowFront(HWND hWnd, int nCmdShow) 181 | { 182 | ShowWindow(hWnd, nCmdShow); 183 | HWND hCurWnd = GetForegroundWindow(); 184 | DWORD dwMyID = GetCurrentThreadId(); 185 | DWORD dwCurID = GetWindowThreadProcessId(hCurWnd, NULL); 186 | AttachThreadInput(dwCurID, dwMyID, TRUE); 187 | SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE); 188 | SetWindowPos(hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOMOVE); 189 | SetForegroundWindow(hWnd); 190 | SetFocus(hWnd); 191 | SetActiveWindow(hWnd); 192 | AttachThreadInput(dwCurID, dwMyID, FALSE); 193 | } 194 | 195 | // Loads the specified strings from the resources and shows a message box 196 | VOID LoadStringAndMessageBox(HINSTANCE hIns, HWND hWn, UINT msgResId, UINT titleResId, UINT mbFlags, UINT errCode = NULL) 197 | { 198 | WCHAR szBuf[256], szTitleBuf[128]; 199 | LoadString(hIns, msgResId, szBuf, sizeof(szBuf) / sizeof(WCHAR)); 200 | LoadString(hIns, titleResId, szTitleBuf, sizeof(szTitleBuf) / sizeof(WCHAR)); 201 | if (errCode != NULL) 202 | { 203 | LPWSTR errMsgBuf = nullptr; 204 | FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, 205 | NULL, errCode, GetUserDefaultUILanguage(), (LPWSTR)&errMsgBuf, 0, NULL); 206 | wsprintf(szBuf, L"%s\n\n0x%08x - %s", szBuf, errCode, errMsgBuf); 207 | LocalFree(errMsgBuf); 208 | } 209 | MessageBox(hWn, szBuf, szTitleBuf, mbFlags); 210 | } 211 | 212 | // Unsets the asynchronous callback and close the WinHttp handle 213 | VOID CloseWinHttpRequest(HINTERNET hInternet) { 214 | WinHttpSetStatusCallback(hInternet, NULL, NULL, NULL); 215 | WinHttpCloseHandle(hInternet); 216 | hReq = NULL; 217 | } 218 | 219 | // Callback called by the asynchronous WinHTTP request 220 | VOID CALLBACK WinHttpCallback(HINTERNET hInternet, DWORD_PTR dwContext, DWORD dwInternetStatus, LPVOID lpvStatusInfo, DWORD dwStatusInfoLength) 221 | { 222 | switch (dwInternetStatus) 223 | { 224 | // Request is sent, receive response 225 | case WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE: 226 | if (!WinHttpReceiveResponse(hInternet, NULL)) { 227 | CloseWinHttpRequest(hInternet); 228 | } 229 | break; 230 | 231 | // Response headers are available, query for data 232 | case WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE: 233 | if (!WinHttpQueryDataAvailable(hInternet, NULL)) { 234 | CloseWinHttpRequest(hInternet); 235 | } 236 | break; 237 | 238 | // Data is available, read it 239 | case WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE: { 240 | DWORD dwSize = *(LPDWORD)lpvStatusInfo; 241 | DWORD dwDownloaded; 242 | CHAR szResponse[128] = ""; 243 | DWORD dwResponseLen = sizeof(szResponse); 244 | 245 | // If the response size is greater than expected, set "Agent not responding" string and close the WinHTTP handle 246 | if (dwSize >= dwResponseLen) { 247 | LoadString(hInst, IDS_ERR_NOTRESPONDING, szAgStatus, sizeof(szAgStatus) / sizeof(WCHAR)); 248 | SetDlgItemText((HWND)dwContext, IDC_AGENTSTATUS, szAgStatus); 249 | CloseWinHttpRequest(hInternet); 250 | break; 251 | } 252 | 253 | if (dwSize == 0 || !WinHttpReadData(hInternet, &szResponse, dwSize, &dwDownloaded)) { 254 | CloseWinHttpRequest(hInternet); 255 | break; 256 | } 257 | 258 | // If the number of downloaded bytes is equal or greater than expected, set "Agent not responding" string and close the WinHTTP handle 259 | if(dwDownloaded >= dwResponseLen) { 260 | LoadString(hInst, IDS_ERR_NOTRESPONDING, szAgStatus, sizeof(szAgStatus) / sizeof(WCHAR)); 261 | SetDlgItemText((HWND)dwContext, IDC_AGENTSTATUS, szAgStatus); 262 | CloseWinHttpRequest(hInternet); 263 | break; 264 | } 265 | 266 | // Set last character to null 267 | szResponse[dwDownloaded] = '\0'; 268 | 269 | size_t cnvChars = 0; 270 | 271 | // Must remove "status: " from the string (dwDownloaded - 7, szResponse[8]) 272 | mbstowcs_s(&cnvChars, szAgStatus, (size_t)dwDownloaded - 7, (LPCSTR)&szResponse[8], _TRUNCATE); 273 | SetDlgItemText((HWND)dwContext, IDC_AGENTSTATUS, szAgStatus); 274 | break; 275 | } 276 | 277 | // Set "Agent not responding" string on error and close the WinHTTP handle (on both error and read complete) 278 | case WINHTTP_CALLBACK_STATUS_REQUEST_ERROR: 279 | LoadString(hInst, IDS_ERR_NOTRESPONDING, szAgStatus, sizeof(szAgStatus) / sizeof(WCHAR)); 280 | SetDlgItemText((HWND)dwContext, IDC_AGENTSTATUS, szAgStatus); 281 | case WINHTTP_CALLBACK_STATUS_READ_COMPLETE: 282 | CloseWinHttpRequest(hInternet); 283 | break; 284 | } 285 | } 286 | 287 | // Requests GLPI Agent status via HTTP (asynchronous) 288 | VOID GetAgentStatus(HWND hWnd) 289 | { 290 | if (svcStatus.dwCurrentState == SERVICE_RUNNING) 291 | { 292 | // Only do another request if the previous one is closed 293 | if (hReq == NULL) 294 | { 295 | hReq = WinHttpOpenRequest(hConn, L"GET", L"/status", NULL, WINHTTP_NO_REFERER, WINHTTP_DEFAULT_ACCEPT_TYPES, 296 | WINHTTP_FLAG_BYPASS_PROXY_CACHE); 297 | 298 | // Callback is set for this request only, not for the entire WinHTTP session, 299 | // as "Force Inventory" is synchronous 300 | WinHttpSetStatusCallback(hReq, WinHttpCallback, WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS, NULL); 301 | 302 | WinHttpSendRequest(hReq, WINHTTP_NO_ADDITIONAL_HEADERS, NULL, WINHTTP_NO_REQUEST_DATA, NULL, NULL, (DWORD_PTR)hWnd); 303 | } 304 | } 305 | } 306 | 307 | // Requests an inventory via HTTP (synchronous) 308 | VOID ForceInventory(HWND hWnd) 309 | { 310 | if (svcStatus.dwCurrentState == SERVICE_RUNNING) 311 | { 312 | if (glpiAgentOk) 313 | { 314 | HINTERNET hReq = WinHttpOpenRequest(hConn, L"GET", L"/now", NULL, WINHTTP_NO_REFERER, WINHTTP_DEFAULT_ACCEPT_TYPES, 315 | WINHTTP_FLAG_BYPASS_PROXY_CACHE); 316 | 317 | if (WinHttpSendRequest(hReq, WINHTTP_NO_ADDITIONAL_HEADERS, NULL, WINHTTP_NO_REQUEST_DATA, NULL, NULL, NULL)) 318 | { 319 | if (WinHttpReceiveResponse(hReq, NULL)) { 320 | DWORD dwStatusCode = 0; 321 | DWORD dwSize = sizeof(dwStatusCode); 322 | 323 | if (!WinHttpQueryHeaders(hReq, WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, 324 | WINHTTP_HEADER_NAME_BY_INDEX, &dwStatusCode, &dwSize, WINHTTP_NO_HEADER_INDEX)) 325 | { 326 | LoadStringAndMessageBox(hInst, hWnd, IDS_ERR_FORCEINV_NORESPONSE, IDS_ERROR, MB_OK | MB_ICONERROR); 327 | } 328 | else { 329 | if (dwStatusCode != 200) 330 | LoadStringAndMessageBox(hInst, hWnd, IDS_ERR_FORCEINV_NOTALLOWED, IDS_ERROR, MB_OK | MB_ICONERROR); 331 | else 332 | LoadStringAndMessageBox(hInst, hWnd, IDS_MSG_FORCEINV_OK, IDS_APP_TITLE, MB_OK | MB_ICONINFORMATION); 333 | } 334 | } 335 | } 336 | WinHttpCloseHandle(hReq); 337 | } 338 | else 339 | LoadStringAndMessageBox(hInst, hWnd, IDS_ERR_AGENTERR, IDS_ERROR, MB_OK | MB_ICONERROR); 340 | } 341 | else 342 | LoadStringAndMessageBox(hInst, hWnd, IDS_ERR_NOTRUNNING, IDS_ERROR, MB_OK | MB_ICONERROR); 343 | } 344 | 345 | // Updates service related statuses 346 | VOID CALLBACK UpdateServiceStatus(HWND hWnd, UINT message, UINT idTimer, DWORD dwTime) { 347 | WCHAR szBtnString[32]; 348 | DWORD dwBtnStringLen = sizeof(szBtnString) / sizeof(WCHAR); 349 | BOOL bQuerySvcOk = FALSE; 350 | BOOL bSvcChangedState = FALSE; 351 | 352 | // Open Service Manager and Agent service handle and query Agent service status 353 | SC_HANDLE hSc = OpenSCManager(NULL, SERVICES_ACTIVE_DATABASE, SC_MANAGER_CONNECT | SC_MANAGER_ENUMERATE_SERVICE); 354 | if (hSc != NULL) { 355 | SC_HANDLE hAgentSvc = OpenService(hSc, SERVICE_NAME, SERVICE_QUERY_STATUS); 356 | 357 | if (hAgentSvc != NULL) { 358 | bQuerySvcOk = QueryServiceStatus(hAgentSvc, &svcStatus); 359 | CloseServiceHandle(hAgentSvc); 360 | } 361 | 362 | CloseServiceHandle(hSc); 363 | } 364 | 365 | if (!bQuerySvcOk || !bAgentInstalled) { 366 | if (IsWindowVisible(hWnd)) { 367 | LoadString(hInst, IDS_ERR_SERVICE, szBuffer, dwBufferLen); 368 | LoadString(hInst, IDS_STARTSVC, szBtnString, dwBtnStringLen); 369 | colorSvcStatus = RGB(255, 0, 0); 370 | SetDlgItemText(hWnd, IDC_SERVICESTATUS, szBuffer); 371 | SetDlgItemText(hWnd, IDC_BTN_STARTSTOPSVC, szBtnString); 372 | HWND hWndSvcButton = GetDlgItem(hWnd, IDC_BTN_STARTSTOPSVC); 373 | EnableWindow(hWndSvcButton, FALSE); 374 | SetFocus(hWndSvcButton); 375 | } 376 | 377 | LoadIconMetric(hInst, MAKEINTRESOURCE(IDI_GLPIERR), LIM_LARGE, &nid.hIcon); 378 | LoadString(hInst, IDS_GLPINOTIFYERROR, nid.szTip, ARRAYSIZE(nid.szTip)); 379 | nid.szInfo[0] = '\0'; 380 | Shell_NotifyIcon(NIM_MODIFY, &nid); 381 | glpiAgentOk = false; 382 | } 383 | else if (bQuerySvcOk) { 384 | bSvcChangedState = svcStatus.dwCurrentState != lastSvcStatus.dwCurrentState; 385 | } 386 | 387 | if (bSvcChangedState) 388 | { 389 | BOOL bEnableButton = FALSE; 390 | switch (svcStatus.dwCurrentState) 391 | { 392 | case SERVICE_STOPPED: 393 | LoadString(hInst, IDS_SVC_STOPPED, szBuffer, dwBufferLen); 394 | LoadString(hInst, IDS_STARTSVC, szBtnString, dwBtnStringLen); 395 | colorSvcStatus = RGB(255, 0, 0); 396 | bEnableButton = TRUE; 397 | break; 398 | case SERVICE_RUNNING: 399 | LoadString(hInst, IDS_SVC_RUNNING, szBuffer, dwBufferLen); 400 | LoadString(hInst, IDS_STOPSVC, szBtnString, dwBtnStringLen); 401 | colorSvcStatus = RGB(0, 127, 0); 402 | bEnableButton = TRUE; 403 | break; 404 | case SERVICE_PAUSED: 405 | LoadString(hInst, IDS_SVC_PAUSED, szBuffer, dwBufferLen); 406 | LoadString(hInst, IDS_RESUMESVC, szBtnString, dwBtnStringLen); 407 | colorSvcStatus = RGB(255, 165, 0); 408 | bEnableButton = TRUE; 409 | break; 410 | case SERVICE_CONTINUE_PENDING: 411 | LoadString(hInst, IDS_SVC_CONTINUEPENDING, szBuffer, dwBufferLen); 412 | LoadString(hInst, IDS_RESUMESVC, szBtnString, dwBtnStringLen); 413 | colorSvcStatus = RGB(255, 165, 0); 414 | break; 415 | case SERVICE_PAUSE_PENDING: 416 | LoadString(hInst, IDS_SVC_PAUSEPENDING, szBuffer, dwBufferLen); 417 | LoadString(hInst, IDS_STOPSVC, szBtnString, dwBtnStringLen); 418 | colorSvcStatus = RGB(255, 165, 0); 419 | break; 420 | case SERVICE_START_PENDING: 421 | LoadString(hInst, IDS_SVC_STARTPENDING, szBuffer, dwBufferLen); 422 | LoadString(hInst, IDS_STARTSVC, szBtnString, dwBtnStringLen); 423 | colorSvcStatus = RGB(255, 165, 0); 424 | break; 425 | case SERVICE_STOP_PENDING: 426 | LoadString(hInst, IDS_SVC_STOPPENDING, szBuffer, dwBufferLen); 427 | LoadString(hInst, IDS_STOPSVC, szBtnString, dwBtnStringLen); 428 | colorSvcStatus = RGB(255, 165, 0); 429 | break; 430 | default: 431 | LoadString(hInst, IDS_ERR_SERVICE, szBuffer, dwBufferLen); 432 | LoadString(hInst, IDS_STARTSVC, szBtnString, dwBtnStringLen); 433 | colorSvcStatus = RGB(255, 0, 0); 434 | break; 435 | } 436 | SetDlgItemText(hWnd, IDC_SERVICESTATUS, szBuffer); 437 | SetDlgItemText(hWnd, IDC_BTN_STARTSTOPSVC, szBtnString); 438 | 439 | LoadString(hInst, (svcStatus.dwCurrentState == SERVICE_STOPPED ? IDS_ERR_NOTRUNNING : IDS_WAIT), szBuffer, dwBufferLen); 440 | SetDlgItemText(hWnd, IDC_AGENTSTATUS, szBuffer); 441 | 442 | HWND hWndSvcButton = GetDlgItem(hWnd, IDC_BTN_STARTSTOPSVC); 443 | EnableWindow(hWndSvcButton, bEnableButton); 444 | if (IsWindowVisible(hWnd)) { 445 | SetFocus(hWndSvcButton); 446 | } 447 | 448 | // Taskbar icon routine 449 | if (svcStatus.dwCurrentState != SERVICE_RUNNING) 450 | { 451 | if (glpiAgentOk) 452 | { 453 | LoadIconMetric(hInst, MAKEINTRESOURCE(IDI_GLPIERR), LIM_LARGE, &nid.hIcon); 454 | LoadString(hInst, IDS_GLPINOTIFYERROR, nid.szTip, ARRAYSIZE(nid.szTip)); 455 | nid.szInfo[0] = '\0'; 456 | Shell_NotifyIcon(NIM_MODIFY, &nid); 457 | glpiAgentOk = false; 458 | } 459 | } 460 | else 461 | { 462 | if (!glpiAgentOk) 463 | { 464 | LoadIconMetric(hInst, MAKEINTRESOURCE(IDI_GLPIOK), LIM_LARGE, &nid.hIcon); 465 | LoadString(hInst, IDS_GLPINOTIFY, nid.szTip, ARRAYSIZE(nid.szTip)); 466 | nid.szInfo[0] = '\0'; 467 | Shell_NotifyIcon(NIM_MODIFY, &nid); 468 | glpiAgentOk = true; 469 | } 470 | } 471 | 472 | lastSvcStatus.dwCurrentState = svcStatus.dwCurrentState; 473 | } 474 | } 475 | 476 | // Updates the main window statuses 477 | VOID CALLBACK UpdateStatus(HWND hWnd, UINT message, UINT idTimer, DWORD dwTime) 478 | { 479 | if (IsWindowVisible(hWnd)) 480 | { 481 | // Agent version 482 | HKEY hk; 483 | LONG lRes; 484 | WCHAR szKey[MAX_PATH]; 485 | DWORD dwValue = -1; 486 | DWORD dwValueLen = sizeof(dwValue); 487 | 488 | // We can find the agent version under the Installer subkey, value "Version" 489 | lRes = RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"SOFTWARE\\GLPI-Agent\\Installer", 0, KEY_READ | KEY_WOW64_64KEY, &hk); 490 | if (lRes != ERROR_SUCCESS) 491 | { 492 | lRes = RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"SOFTWARE\\GLPI-Agent\\Installer", 0, KEY_READ | KEY_WOW64_64KEY, &hk); 493 | if (lRes != ERROR_SUCCESS) { 494 | LoadString(hInst, IDS_ERR_AGENTNOTFOUND, szBuffer, dwBufferLen); 495 | SetDlgItemText(hWnd, IDC_AGENTVER, szBuffer); 496 | bAgentInstalled = false; 497 | } 498 | } 499 | if (lRes == ERROR_SUCCESS) 500 | { 501 | WCHAR szValue[128] = {}; 502 | DWORD szValueLen = sizeof(szValue); 503 | lRes = RegQueryValueEx(hk, L"Version", 0, NULL, (LPBYTE)szValue, &szValueLen); 504 | if (lRes != ERROR_SUCCESS) 505 | LoadString(hInst, IDS_ERR_AGENTVERNOTFOUND, szBuffer, dwBufferLen); 506 | else 507 | wsprintf(szBuffer, L"GLPI Agent %s", szValue); 508 | SetDlgItemText(hWnd, IDC_AGENTVER, szBuffer); 509 | bAgentInstalled = true; 510 | } 511 | 512 | 513 | // Startup type 514 | wsprintf(szKey, L"SYSTEM\\CurrentControlSet\\Services\\%s", SERVICE_NAME); 515 | lRes = RegOpenKeyEx(HKEY_LOCAL_MACHINE, szKey, 0, KEY_READ | KEY_WOW64_64KEY, &hk); 516 | if (lRes == ERROR_SUCCESS) 517 | { 518 | lRes = RegQueryValueEx(hk, L"Start", 0, NULL, (LPBYTE)&dwValue, &dwValueLen); 519 | if (lRes == ERROR_SUCCESS) 520 | { 521 | switch (dwValue) 522 | { 523 | case SERVICE_BOOT_START: 524 | LoadString(hInst, IDS_SVCSTART_BOOT, szBuffer, dwBufferLen); 525 | break; 526 | case SERVICE_SYSTEM_START: 527 | LoadString(hInst, IDS_SVCSTART_SYSTEM, szBuffer, dwBufferLen); 528 | break; 529 | case SERVICE_AUTO_START: 530 | { 531 | lRes = RegQueryValueEx(hk, L"DelayedAutostart", 0, NULL, (LPBYTE)&dwValue, &dwValueLen); 532 | if (lRes == ERROR_SUCCESS) 533 | LoadString(hInst, IDS_SVCSTART_DELAYEDAUTO, szBuffer, dwBufferLen); 534 | else 535 | LoadString(hInst, IDS_SVCSTART_AUTO, szBuffer, dwBufferLen); 536 | break; 537 | } 538 | case SERVICE_DEMAND_START: 539 | LoadString(hInst, IDS_SVCSTART_MANUAL, szBuffer, dwBufferLen); 540 | break; 541 | case SERVICE_DISABLED: 542 | LoadString(hInst, IDS_SVCSTART_DISABLED, szBuffer, dwBufferLen); 543 | break; 544 | default: 545 | LoadString(hInst, IDS_ERR_UNKSVCSTART, szBuffer, dwBufferLen); 546 | } 547 | SetDlgItemText(hWnd, IDC_STARTTYPE, szBuffer); 548 | } 549 | else 550 | { 551 | LoadString(hInst, IDS_ERR_UNKSVCSTART, szBuffer, dwBufferLen); 552 | SetDlgItemText(hWnd, IDC_STARTTYPE, szBuffer); 553 | } 554 | } 555 | else 556 | { 557 | LoadString(hInst, IDS_ERR_REGFAIL, szBuffer, dwBufferLen); 558 | SetDlgItemText(hWnd, IDC_STARTTYPE, szBuffer); 559 | } 560 | 561 | RegCloseKey(hk); 562 | 563 | // Update agent status 564 | // If the service is not running, the status will 565 | // be replaced by UpdateServiceStatus 566 | if (svcStatus.dwCurrentState == SERVICE_RUNNING) { 567 | GetAgentStatus(hWnd); 568 | } 569 | } 570 | } 571 | 572 | // EnumWindows callback 573 | // (called by EnumWindows to find the hWnd for the running GLPI Agent Monitor instance) 574 | BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM lParam) 575 | { 576 | EnumWindowsData& ed = *(EnumWindowsData*)lParam; 577 | DWORD dwPID = 0x0; 578 | GetWindowThreadProcessId(hWnd, &dwPID); 579 | if (ed.dwSearchPID == dwPID) 580 | { 581 | ed.hWndFound = hWnd; 582 | SetLastError(ERROR_SUCCESS); 583 | return FALSE; 584 | } 585 | return TRUE; 586 | } 587 | 588 | // Get running Monitor process' hWnd 589 | HWND GetRunningMonitorHwnd() { 590 | 591 | // Get GLPI Agent Monitor executable name 592 | WCHAR szFilePath[MAX_PATH]; 593 | GetModuleFileName(NULL, szFilePath, MAX_PATH); 594 | LPWSTR szFileName = PathFindFileName(szFilePath); 595 | 596 | // Look through processes, try to get it's hWnd when the process is found 597 | // and then send a WM_CLOSE message to stop it gracefully 598 | HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPALL, NULL); 599 | PROCESSENTRY32 pEntry{}; 600 | pEntry.dwSize = sizeof(pEntry); 601 | BOOL hRes = Process32First(hSnapshot, &pEntry); 602 | while (hRes) 603 | { 604 | if (lstrcmp(pEntry.szExeFile, szFileName) == 0) 605 | { 606 | // Don't close itself 607 | if (pEntry.th32ProcessID != GetCurrentProcessId()) 608 | { 609 | EnumWindowsData ed = { 610 | pEntry.th32ProcessID, 611 | NULL 612 | }; 613 | 614 | if (!EnumWindows(EnumWindowsProc, (LPARAM)&ed) && (GetLastError() == ERROR_SUCCESS)) { 615 | CloseHandle(hSnapshot); 616 | return ed.hWndFound; 617 | } 618 | } 619 | } 620 | hRes = Process32Next(hSnapshot, &pEntry); 621 | } 622 | CloseHandle(hSnapshot); 623 | 624 | return NULL; 625 | } 626 | 627 | 628 | //-[MAIN FUNCTIONS]------------------------------------------------------------ 629 | 630 | // Entry point 631 | int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPWSTR lpCmdLine, _In_ int nCmdShow) 632 | { 633 | hInst = hInstance; 634 | DWORD dwErr = NULL; 635 | 636 | // Process service operations 637 | if (wcsstr(lpCmdLine, L"/startSvc") != nullptr || wcsstr(lpCmdLine, L"/stopSvc") != nullptr || 638 | wcsstr(lpCmdLine, L"/continueSvc") != nullptr) { 639 | SC_HANDLE hSc = OpenSCManager(NULL, SERVICES_ACTIVE_DATABASE, SC_MANAGER_CONNECT); 640 | if (!hSc) { 641 | dwErr = GetLastError(); 642 | LoadStringAndMessageBox(hInst, NULL, IDS_ERR_SCHANDLE, IDS_ERROR, MB_OK | MB_ICONERROR, dwErr); 643 | return dwErr; 644 | } 645 | SC_HANDLE hAgentSvc = OpenService(hSc, SERVICE_NAME, SERVICE_START | SERVICE_PAUSE_CONTINUE | SERVICE_STOP); 646 | if (!hAgentSvc) { 647 | dwErr = GetLastError(); 648 | LoadStringAndMessageBox(hInst, NULL, IDS_ERR_SVCHANDLE, IDS_ERROR, MB_OK | MB_ICONERROR, dwErr); 649 | return dwErr; 650 | } 651 | if (wcsstr(lpCmdLine, L"/startSvc") != nullptr) 652 | StartService(hAgentSvc, NULL, NULL); 653 | else if (wcsstr(lpCmdLine, L"/stopSvc") != nullptr) 654 | ControlService(hAgentSvc, SERVICE_CONTROL_STOP, &svcStatus); 655 | else if (wcsstr(lpCmdLine, L"/continueSvc") != nullptr) 656 | ControlService(hAgentSvc, SERVICE_CONTROL_CONTINUE, &svcStatus); 657 | dwErr = GetLastError(); 658 | if (dwErr != NULL) { 659 | LoadStringAndMessageBox(hInst, NULL, IDS_ERR_SVCOPERATION, IDS_ERROR, MB_OK | MB_ICONERROR, dwErr); 660 | return dwErr; 661 | } 662 | CloseServiceHandle(hAgentSvc); 663 | CloseServiceHandle(hSc); 664 | return 0; 665 | } 666 | 667 | // Process elevation request (kill previous process) 668 | if (wcsstr(lpCmdLine, L"/elevate") != nullptr) 669 | { 670 | HWND runningMonitorHwnd = GetRunningMonitorHwnd(); 671 | if (runningMonitorHwnd != NULL) { 672 | SendMessage(runningMonitorHwnd, WM_CLOSE, 0xBEBAF7F3, 0xC0CAF7F3); 673 | } 674 | } 675 | 676 | 677 | // Create app mutex to keep only one instance running 678 | hMutex = CreateMutex(NULL, TRUE, L"GLPI-AgentMonitor"); 679 | if (GetLastError() == ERROR_ALREADY_EXISTS) 680 | { 681 | // Wait for mutex to be available if trying to elevate 682 | // as the other Monitor instance may not close instantly 683 | if (wcsstr(lpCmdLine, L"/elevate") != nullptr) 684 | { 685 | do { 686 | hMutex = CreateMutex(NULL, TRUE, L"GLPI-AgentMonitor"); 687 | } while (WaitForSingleObject(hMutex, 500) != WAIT_OBJECT_0); 688 | } 689 | else { 690 | // Show running agent window 691 | HWND runningMonitorHwnd = GetRunningMonitorHwnd(); 692 | if (runningMonitorHwnd != NULL) { 693 | ShowWindowFront(runningMonitorHwnd, SW_SHOW); 694 | UpdateStatus(runningMonitorHwnd, NULL, NULL, NULL); 695 | } 696 | return 0; 697 | } 698 | } 699 | 700 | 701 | // Read app version 702 | WCHAR szFileName[MAX_PATH]; 703 | GetModuleFileName(NULL, szFileName, MAX_PATH); 704 | DWORD dwSize = GetFileVersionInfoSize(szFileName, 0); 705 | VS_FIXEDFILEINFO* lpFfi = NULL; 706 | UINT uFfiLen = 0; 707 | WCHAR* szVerBuffer = new WCHAR[dwSize]; 708 | GetFileVersionInfo(szFileName, 0, dwSize, szVerBuffer); 709 | VerQueryValue(szVerBuffer, L"\\", (LPVOID*)&lpFfi, &uFfiLen); 710 | DWORD dwVerMaj = HIWORD(lpFfi->dwFileVersionMS); 711 | DWORD dwVerMin = LOWORD(lpFfi->dwFileVersionMS); 712 | DWORD dwVerRev = HIWORD(lpFfi->dwFileVersionLS); 713 | 714 | GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL); 715 | 716 | // Load agent settings 717 | HKEY hk; 718 | WCHAR szKey[MAX_PATH]; 719 | WCHAR szValueBuf[MAX_PATH] = {}; 720 | DWORD szValueBufLen = sizeof(szValueBuf); 721 | DWORD szServerLen = sizeof(szServer); 722 | DWORD dwPort = 62354; 723 | 724 | wsprintf(szKey, L"SOFTWARE\\%s", SERVICE_NAME); 725 | LONG lRes = RegOpenKeyEx(HKEY_LOCAL_MACHINE, szKey, 0, KEY_READ | KEY_WOW64_64KEY, &hk); 726 | if (lRes != ERROR_SUCCESS) 727 | { 728 | wsprintf(szKey, L"SOFTWARE\\WOW6432Node\\%s", SERVICE_NAME); 729 | lRes = RegOpenKeyEx(HKEY_LOCAL_MACHINE, szKey, 0, KEY_READ | KEY_WOW64_64KEY, &hk); 730 | if (lRes != ERROR_SUCCESS) { 731 | LoadStringAndMessageBox(hInst, NULL, IDS_ERR_AGENTSETTINGS, IDS_ERROR, MB_OK | MB_ICONERROR, lRes); 732 | return lRes; 733 | } 734 | } 735 | else 736 | { 737 | // Get HTTPD port 738 | lRes = RegQueryValueEx(hk, L"httpd-port", 0, NULL, (LPBYTE)szValueBuf, &szValueBufLen); 739 | if (lRes != ERROR_SUCCESS) { 740 | LoadStringAndMessageBox(hInst, NULL, IDS_ERR_HTTPDPORT, IDS_ERROR, MB_OK | MB_ICONERROR, lRes); 741 | return lRes; 742 | } 743 | else 744 | dwPort = _wtoi(szValueBuf); 745 | 746 | // Get server URL 747 | lRes = RegQueryValueEx(hk, L"server", 0, NULL, (LPBYTE)szServer, &szServerLen); 748 | if (lRes == ERROR_SUCCESS) { 749 | // Strip any quotes from the "server" value 750 | wstring strServer = szServer; 751 | strServer.erase(remove(strServer.begin(), strServer.end(), '\''), strServer.end()); 752 | strServer.erase(remove(strServer.begin(), strServer.end(), '\"'), strServer.end()); 753 | wcscpy_s(szServer, strServer.c_str()); 754 | 755 | if (wcscmp(L"", szServer) != 0) { 756 | // Get only the first URL if more than one is configured 757 | LPWSTR szSubstr = wcsstr(szServer, L","); 758 | if (szSubstr != nullptr) 759 | szSubstr[0] = '\0'; 760 | // Get GLPI server base URL (as GLPI may be located in a subfolder, 761 | // we can't guess the exact location just by stripping the domain 762 | // from the "server" parameter). 763 | szSubstr = wcsstr(szServer, L"/plugins/"); 764 | if (szSubstr == nullptr) { 765 | szSubstr = wcsstr(szServer, L"/marketplace/"); 766 | if (szSubstr == nullptr) 767 | szSubstr = wcsstr(szServer, L"/front/inventory.php"); 768 | } 769 | if (szSubstr != nullptr) { 770 | // As szSubstr points to where the first character of the substring 771 | // was found in the string itself, replacing it with a null character 772 | // effectively cuts the string. 773 | szSubstr[0] = '\0'; 774 | } 775 | // Strip any trailing slash 776 | size_t lServerLen = wcslen(szServer); 777 | while (--lServerLen >= 0 && szServer[lServerLen] == '/') { 778 | szServer[lServerLen] = '\0'; 779 | } 780 | // In case we didn't find the substrings, assume the "server" value 781 | // in the registry is the base GLPI url itself. 782 | } 783 | } 784 | 785 | // Get agent logfile path 786 | DWORD szLogfileLen = sizeof(szLogfile); 787 | lRes = RegQueryValueEx(hk, L"logfile", 0, NULL, (LPBYTE)szLogfile, &szLogfileLen); 788 | if (lRes != ERROR_SUCCESS) 789 | szLogfile[0] = '\0'; 790 | 791 | 792 | // Load GLPI Agent Monitor settings from registry 793 | wsprintf(szKey, L"SOFTWARE\\%s\\Monitor", SERVICE_NAME); 794 | LONG lRes = RegOpenKeyEx(HKEY_LOCAL_MACHINE, szKey, 0, KEY_READ | KEY_WOW64_64KEY, &hk); 795 | if (lRes != ERROR_SUCCESS) 796 | { 797 | wsprintf(szKey, L"SOFTWARE\\WOW6432Node\\%s\\Monitor", SERVICE_NAME); 798 | lRes = RegOpenKeyEx(HKEY_LOCAL_MACHINE, szKey, 0, KEY_READ | KEY_WOW64_64KEY, &hk); 799 | } 800 | 801 | // Here I won't check if the key could be opened, as 802 | // this is already checked when RegQueryValueEx below 803 | // does not return ERROR_SUCCESS. 804 | 805 | // Get new ticket URL 806 | DWORD szNewTicketURLLen = sizeof(szNewTicketURL); 807 | lRes = RegQueryValueEx(hk, L"NewTicket-URL", 0, NULL, (LPBYTE)szNewTicketURL, &szNewTicketURLLen); 808 | if (lRes != ERROR_SUCCESS || !wcscmp(szNewTicketURL, L"")) { 809 | // Default value if not found or empty 810 | if (wcsncmp(L"https://", szServer, 8) != 0 && wcsncmp(L"http://", szServer, 7) != 0) { 811 | // Place an "http://" before the URL so that it is at least opened by the system's 812 | // default browser instead of doing nothing or unexpected behavior, even if 813 | // for some reason the Agent's "server" parameter is empty 814 | wsprintf(szNewTicketURL, L"http://%s/front/ticket.form.php", szServer); 815 | } 816 | else { 817 | wsprintf(szNewTicketURL, L"%s/front/ticket.form.php", szServer); 818 | } 819 | } 820 | 821 | // Get new ticket screenshot enable 822 | DWORD dwNewTicketScreenshotTmp = NULL; 823 | DWORD dwNewTicketScreenshotLen = sizeof(dwNewTicketScreenshotTmp); 824 | lRes = RegQueryValueExW(hk, L"NewTicket-Screenshot", 0, NULL, (LPBYTE)&dwNewTicketScreenshotTmp, &dwNewTicketScreenshotLen); 825 | if (lRes == ERROR_SUCCESS) { 826 | bNewTicketScreenshot = (dwNewTicketScreenshotTmp == 1); 827 | } 828 | } 829 | 830 | RegCloseKey(hk); 831 | 832 | // Create WinHTTP handles 833 | WCHAR szUserAgent[64]; 834 | wsprintf(szUserAgent, L"%s/%d.%d.%d", USERAGENT_NAME, dwVerMaj, dwVerMin, dwVerRev); 835 | 836 | hSession = WinHttpOpen(szUserAgent, WINHTTP_ACCESS_TYPE_NO_PROXY, WINHTTP_NO_PROXY_NAME, WINHTTP_NO_PROXY_BYPASS, WINHTTP_FLAG_ASYNC); 837 | WinHttpSetTimeouts(hSession, 100, 10000, 10000, 10000); 838 | hConn = WinHttpConnect(hSession, L"127.0.0.1", (INTERNET_PORT)dwPort, 0); 839 | 840 | //------------------------------------------------------------------------- 841 | 842 | HWND hWnd = CreateDialog(hInst, MAKEINTRESOURCE(IDD_MAIN), NULL, (DLGPROC)DlgProc); 843 | if (!hWnd) { 844 | dwErr = GetLastError(); 845 | LoadStringAndMessageBox(hInst, NULL, IDS_ERR_MAINWINDOW, IDS_ERROR, MB_OK | MB_ICONERROR, dwErr); 846 | return dwErr; 847 | } 848 | 849 | HICON icon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_GLPIOK), IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR | LR_DEFAULTSIZE); 850 | SendMessage(hWnd, WM_SETICON, ICON_SMALL, (LPARAM)icon); 851 | SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM)icon); 852 | 853 | // Taskbar icon 854 | nid.hWnd = hWnd; 855 | nid.uFlags = NIF_ICON | NIF_TIP | NIF_MESSAGE | NIF_SHOWTIP; 856 | nid.uCallbackMessage = WMAPP_NOTIFYCALLBACK; 857 | LoadIconMetric(hInst, MAKEINTRESOURCE(IDI_GLPIOK), LIM_LARGE, &nid.hIcon); 858 | LoadString(hInst, IDS_GLPINOTIFY, nid.szTip, ARRAYSIZE(nid.szTip)); 859 | Shell_NotifyIcon(NIM_ADD, &nid); 860 | nid.uVersion = NOTIFYICON_VERSION_4; 861 | Shell_NotifyIcon(NIM_SETVERSION, &nid); 862 | 863 | HBITMAP hLogo = nullptr; 864 | LoadPNGAsBitmap(hInst, MAKEINTRESOURCE(IDB_LOGO), L"PNG", &hLogo); 865 | SendMessage(GetDlgItem(hWnd, IDC_PCLOGO), STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hLogo); 866 | 867 | WCHAR szVer[20]; 868 | wsprintf(szVer, L"v%d.%d.%d", dwVerMaj, dwVerMin, dwVerRev); 869 | SetDlgItemText(hWnd, IDC_VERSION, szVer); 870 | 871 | LoadString(hInst, IDS_APP_TITLE, szBuffer, dwBufferLen); 872 | SetWindowText(hWnd, szBuffer); 873 | SetDlgItemText(hWnd, IDC_STATIC_TITLE, szBuffer); 874 | 875 | LoadString(hInst, IDS_STATIC_INFO, szBuffer, dwBufferLen); 876 | SetDlgItemText(hWnd, IDC_GBMAIN, szBuffer); 877 | 878 | LoadString(hInst, IDS_STATIC_AGENTVER, szBuffer, dwBufferLen); 879 | SetDlgItemText(hWnd, IDC_STATIC_AGENTVER, szBuffer); 880 | LoadString(hInst, IDS_STATIC_SERVICESTATUS, szBuffer, dwBufferLen); 881 | SetDlgItemText(hWnd, IDC_STATIC_SERVICESTATUS, szBuffer); 882 | LoadString(hInst, IDS_STATIC_STARTTYPE, szBuffer, dwBufferLen); 883 | SetDlgItemText(hWnd, IDC_STATIC_STARTTYPE, szBuffer); 884 | 885 | LoadString(hInst, IDS_LOADING, szBuffer, dwBufferLen); 886 | SetDlgItemText(hWnd, IDC_AGENTVER, szBuffer); 887 | SetDlgItemText(hWnd, IDC_SERVICESTATUS, szBuffer); 888 | SetDlgItemText(hWnd, IDC_STARTTYPE, szBuffer); 889 | SetDlgItemText(hWnd, IDC_AGENTSTATUS, szBuffer); 890 | 891 | LoadString(hInst, IDS_STATIC_AGENTSTATUS, szBuffer, dwBufferLen); 892 | SetDlgItemText(hWnd, IDC_GBSTATUS, szBuffer); 893 | 894 | LoadString(hInst, IDS_FORCEINV, szBuffer, dwBufferLen); 895 | SetDlgItemText(hWnd, IDC_BTN_FORCE, szBuffer); 896 | LoadString(hInst, IDS_VIEWLOGS, szBuffer, dwBufferLen); 897 | SetDlgItemText(hWnd, IDC_BTN_VIEWLOGS, szBuffer); 898 | LoadString(hInst, IDS_NEWTICKET, szBuffer, dwBufferLen); 899 | SetDlgItemText(hWnd, IDC_BTN_NEWTICKET, szBuffer); 900 | LoadString(hInst, IDS_BTN_SETTINGS, szBuffer, dwBufferLen); 901 | SetDlgItemText(hWnd, IDC_BTN_SETTINGS, szBuffer); 902 | LoadString(hInst, IDS_CLOSE, szBuffer, dwBufferLen); 903 | SetDlgItemText(hWnd, IDC_BTN_CLOSE, szBuffer); 904 | LoadString(hInst, IDS_STARTSVC, szBuffer, dwBufferLen); 905 | SetDlgItemText(hWnd, IDC_BTN_STARTSTOPSVC, szBuffer); 906 | 907 | // Set UAC shields 908 | SendMessage(GetDlgItem(hWnd, IDC_BTN_STARTSTOPSVC), BCM_SETSHIELD, 0, 1); 909 | SendMessage(GetDlgItem(hWnd, IDC_BTN_SETTINGS), BCM_SETSHIELD, 0, 1); 910 | 911 | //------------------------------------------------------------------------- 912 | 913 | UpdateStatus(hWnd, NULL, NULL, NULL); 914 | UpdateServiceStatus(hWnd, NULL, NULL, NULL); 915 | SetTimer(hWnd, IDT_UPDSTATUS, 2000, (TIMERPROC)UpdateStatus); 916 | SetTimer(hWnd, IDT_UPDSVCSTATUS, 500, (TIMERPROC)UpdateServiceStatus); 917 | 918 | //------------------------------------------------------------------------- 919 | 920 | // Show window if elevation request was made 921 | if (wcsstr(lpCmdLine, L"/elevate") != nullptr) 922 | { 923 | ShowWindowFront(hWnd, SW_SHOW); 924 | UpdateStatus(hWnd, NULL, NULL, NULL); 925 | 926 | // Show settings dialog immediately if requested 927 | if (wcsstr(lpCmdLine, L"/openSettings") != nullptr) { 928 | DialogBox(hInst, MAKEINTRESOURCE(IDD_DLG_SETTINGS), hWnd, (DLGPROC)SettingsDlgProc); 929 | } 930 | } 931 | 932 | // Main message loop 933 | MSG msg; 934 | while (GetMessage(&msg, nullptr, 0, 0)) 935 | { 936 | if (!IsDialogMessage(hWnd, &msg)) { 937 | TranslateMessage(&msg); 938 | DispatchMessage(&msg); 939 | } 940 | } 941 | 942 | return (int) msg.wParam; 943 | } 944 | 945 | LRESULT CALLBACK SettingsDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) 946 | { 947 | switch (message) 948 | { 949 | case WM_INITDIALOG: 950 | { 951 | // Initialize dialog strings 952 | LoadString(hInst, IDS_SETTINGS, szBuffer, dwBufferLen); 953 | SetWindowText(hWnd, szBuffer); 954 | LoadString(hInst, IDS_SETTINGS_NEWTICKET, szBuffer, dwBufferLen); 955 | SetDlgItemText(hWnd, IDC_SETTINGS_GROUPBOX_NEWTICKET, szBuffer); 956 | LoadString(hInst, IDS_SETTINGS_NEWTICKET_URL, szBuffer, dwBufferLen); 957 | SetDlgItemText(hWnd, IDC_SETTINGS_TEXT_NEWTICKET_URL, szBuffer); 958 | LoadString(hInst, IDS_SETTINGS_NEWTICKET_SCREENSHOT, szBuffer, dwBufferLen); 959 | SetDlgItemText(hWnd, IDC_SETTINGS_CHECKBOX_NEWTICKET_SCREENSHOT, szBuffer); 960 | LoadString(hInst, IDS_CANCEL, szBuffer, dwBufferLen); 961 | SetDlgItemText(hWnd, IDC_SETTINGS_BTN_CANCEL, szBuffer); 962 | LoadString(hInst, IDS_SAVE, szBuffer, dwBufferLen); 963 | SetDlgItemText(hWnd, IDC_SETTINGS_BTN_SAVE, szBuffer); 964 | 965 | // Fill values 966 | SendDlgItemMessage(hWnd, IDC_SETTINGS_EDIT_NEWTICKET_URL, WM_SETTEXT, 0, (LPARAM)szNewTicketURL); 967 | SendDlgItemMessage(hWnd, IDC_SETTINGS_CHECKBOX_NEWTICKET_SCREENSHOT, BM_SETCHECK, (bNewTicketScreenshot ? BST_CHECKED : BST_UNCHECKED), 0); 968 | 969 | return TRUE; 970 | } 971 | case WM_COMMAND: 972 | { 973 | switch (LOWORD(wParam)) 974 | { 975 | case IDC_SETTINGS_EDIT_NEWTICKET_URL: 976 | case IDC_SETTINGS_CHECKBOX_NEWTICKET_SCREENSHOT: 977 | // Prevent closing the dialog when clicking these components 978 | return TRUE; 979 | case IDC_SETTINGS_BTN_SAVE: 980 | { 981 | HKEY hk, hkMonitor; 982 | LONG lRes; 983 | WCHAR szKey[MAX_PATH]; 984 | 985 | // Get settings from dialog 986 | WCHAR szTempNewTicketURL[300]; 987 | LRESULT copiedChars = SendMessage(GetDlgItem(hWnd, IDC_SETTINGS_EDIT_NEWTICKET_URL), WM_GETTEXT, 988 | sizeof(szTempNewTicketURL), (LPARAM)szTempNewTicketURL); 989 | szTempNewTicketURL[copiedChars] = '\0'; 990 | BOOL bTempNewTicketScreenshot = IsDlgButtonChecked(hWnd, IDC_SETTINGS_CHECKBOX_NEWTICKET_SCREENSHOT); 991 | 992 | // Save settings in registry 993 | wsprintf(szKey, L"SOFTWARE\\%s", SERVICE_NAME); 994 | lRes = RegOpenKeyEx(HKEY_LOCAL_MACHINE, szKey, 0, KEY_WRITE | KEY_WOW64_64KEY, &hk); 995 | if (lRes != ERROR_SUCCESS) 996 | { 997 | if (lRes == ERROR_FILE_NOT_FOUND) 998 | { 999 | wsprintf(szKey, L"SOFTWARE\\WOW6432Node\\%s", SERVICE_NAME); 1000 | lRes = RegOpenKeyEx(HKEY_LOCAL_MACHINE, szKey, 0, KEY_WRITE | KEY_WOW64_64KEY, &hk); 1001 | if (lRes != ERROR_SUCCESS) 1002 | { 1003 | LoadStringAndMessageBox(hInst, hWnd, IDS_ERR_SAVE_SETTINGS, IDS_ERROR, MB_OK | MB_ICONERROR, lRes); 1004 | return FALSE; 1005 | } 1006 | } 1007 | else { 1008 | LoadStringAndMessageBox(hInst, hWnd, IDS_ERR_SAVE_SETTINGS, IDS_ERROR, MB_OK | MB_ICONERROR, lRes); 1009 | return FALSE; 1010 | } 1011 | } 1012 | wsprintf(szKey, L"%s\\Monitor", szKey); 1013 | lRes = RegOpenKeyEx(HKEY_LOCAL_MACHINE, szKey, 0, KEY_WRITE | KEY_WOW64_64KEY, &hkMonitor); 1014 | if (lRes != ERROR_SUCCESS) 1015 | { 1016 | lRes = RegCreateKeyEx(hk, L"Monitor", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hkMonitor, NULL); 1017 | if (lRes != ERROR_SUCCESS) 1018 | { 1019 | LoadStringAndMessageBox(hInst, hWnd, IDS_ERR_SAVE_SETTINGS, IDS_ERROR, MB_OK | MB_ICONERROR, lRes); 1020 | return FALSE; 1021 | } 1022 | } 1023 | 1024 | // Save new ticket URL if it was changed 1025 | if (wcscmp(szTempNewTicketURL, szNewTicketURL) != 0) 1026 | { 1027 | size_t szTempNewTicketURLLen = wcslen(szTempNewTicketURL) * sizeof(WCHAR); 1028 | lRes = RegSetValueEx(hkMonitor, L"NewTicket-URL", 0, REG_SZ, (LPBYTE)szTempNewTicketURL, (DWORD)szTempNewTicketURLLen); 1029 | if (lRes != ERROR_SUCCESS) 1030 | { 1031 | LoadStringAndMessageBox(hInst, hWnd, IDS_ERR_SAVE_SETTINGS, IDS_ERROR, MB_OK | MB_ICONERROR, lRes); 1032 | return FALSE; 1033 | } 1034 | } 1035 | 1036 | // Save new ticket screenshot setting if it was changed 1037 | // Save new ticket URL if it was changed 1038 | if (bTempNewTicketScreenshot != bNewTicketScreenshot) 1039 | { 1040 | lRes = RegSetValueEx(hkMonitor, L"NewTicket-Screenshot", 0, REG_DWORD, 1041 | (LPBYTE)&bTempNewTicketScreenshot, sizeof(bTempNewTicketScreenshot)); 1042 | if (lRes != ERROR_SUCCESS) 1043 | { 1044 | LoadStringAndMessageBox(hInst, hWnd, IDS_ERR_SAVE_SETTINGS, IDS_ERROR, MB_OK | MB_ICONERROR, lRes); 1045 | return FALSE; 1046 | } 1047 | } 1048 | 1049 | RegCloseKey(hkMonitor); 1050 | RegCloseKey(hk); 1051 | 1052 | // Use the default new ticket URL if the provided one is empty 1053 | if (!wcscmp(szTempNewTicketURL, L"")) { 1054 | wsprintf(szNewTicketURL, L"%s/front/ticket.form.php", szServer); 1055 | } 1056 | else { 1057 | // Store new ticket URL in memory 1058 | wcscpy_s(szNewTicketURL, szTempNewTicketURL); 1059 | } 1060 | bNewTicketScreenshot = bTempNewTicketScreenshot; 1061 | 1062 | PostMessage(hWnd, WM_CLOSE, 0, 0); 1063 | return TRUE; 1064 | } 1065 | case IDC_SETTINGS_BTN_CANCEL: 1066 | PostMessage(hWnd, WM_CLOSE, 0, 0); 1067 | return TRUE; 1068 | } 1069 | } 1070 | case WM_CLOSE: 1071 | { 1072 | EndDialog(hWnd, NULL); 1073 | return TRUE; 1074 | } 1075 | } 1076 | return FALSE; 1077 | } 1078 | 1079 | LRESULT CALLBACK DlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) 1080 | { 1081 | switch (message) 1082 | { 1083 | case WM_COMMAND: 1084 | { 1085 | switch (LOWORD(wParam)) 1086 | { 1087 | // Start/stop/resume service 1088 | case IDC_BTN_STARTSTOPSVC: 1089 | WCHAR szFilename[MAX_PATH]; 1090 | WCHAR szOperation[16]; 1091 | GetModuleFileName(NULL, szFilename, MAX_PATH); 1092 | switch(svcStatus.dwCurrentState) { 1093 | case SERVICE_RUNNING: 1094 | wsprintf(szOperation, L"/stopSvc"); 1095 | break; 1096 | case SERVICE_PAUSED: 1097 | wsprintf(szOperation, L"/continueSvc"); 1098 | break; 1099 | case SERVICE_STOPPED: 1100 | wsprintf(szOperation, L"/startSvc"); 1101 | break; 1102 | default: 1103 | return FALSE; 1104 | } 1105 | ShellExecute(hWnd, L"runas", szFilename, szOperation, NULL, SW_HIDE); 1106 | return TRUE; 1107 | // Force inventory 1108 | case IDC_BTN_FORCE: 1109 | case ID_RMENU_FORCE: 1110 | ForceInventory(hWnd); 1111 | return TRUE; 1112 | // Close 1113 | case IDCANCEL: // This handles ESC key pressing via IsDialogMessage 1114 | case IDC_BTN_CLOSE: 1115 | EndDialog(hWnd, NULL); 1116 | return TRUE; 1117 | // Open 1118 | case ID_RMENU_OPEN: 1119 | ShowWindowFront(hWnd, SW_SHOW); 1120 | UpdateStatus(hWnd, NULL, NULL, NULL); 1121 | return TRUE; 1122 | // View logs 1123 | case IDC_BTN_VIEWLOGS: 1124 | case ID_RMENU_VIEWLOGS: 1125 | ShellExecute(NULL, L"open", szLogfile, NULL, NULL, SW_SHOWNORMAL); 1126 | return TRUE; 1127 | // New ticket 1128 | case IDC_BTN_NEWTICKET: 1129 | EndDialog(hWnd, NULL); 1130 | case ID_RMENU_NEWTICKET: { 1131 | if (bNewTicketScreenshot) { 1132 | // Take screenshot to clipboard (simulating PrintScreen) 1133 | INPUT ipInput[2] = { 0 }; 1134 | Sleep(300); 1135 | ipInput[0].type = INPUT_KEYBOARD; 1136 | ipInput[0].ki.wVk = VK_SNAPSHOT; 1137 | ipInput[1] = ipInput[0]; 1138 | ipInput[1].ki.dwFlags |= KEYEVENTF_KEYUP; 1139 | SendInput(2, ipInput, sizeof(INPUT)); 1140 | } 1141 | // Open the new ticket URL 1142 | ShellExecute(NULL, L"open", szNewTicketURL, NULL, NULL, SW_SHOWNORMAL); 1143 | 1144 | if (bNewTicketScreenshot) { 1145 | // Notify user that a screenshot is in the clipboard 1146 | nid.uFlags |= NIF_INFO; 1147 | LoadString(hInst, IDS_NOTIF_NEWTICKET_TITLE, nid.szInfoTitle, sizeof(nid.szInfoTitle) / sizeof(WCHAR)); 1148 | LoadString(hInst, IDS_NOTIF_NEWTICKET, nid.szInfo, sizeof(nid.szInfo) / sizeof(WCHAR)); 1149 | Shell_NotifyIcon(NIM_MODIFY, &nid); 1150 | } 1151 | 1152 | return TRUE; 1153 | } 1154 | // Settings 1155 | case ID_RMENU_SETTINGS: 1156 | case IDC_BTN_SETTINGS: 1157 | { 1158 | if(IsUserAnAdmin()) 1159 | { 1160 | if (LOWORD(wParam) == ID_RMENU_SETTINGS) 1161 | { 1162 | ShowWindowFront(hWnd, SW_SHOW); 1163 | UpdateStatus(hWnd, NULL, NULL, NULL); 1164 | } 1165 | DialogBox(hInst, MAKEINTRESOURCE(IDD_DLG_SETTINGS), hWnd, (DLGPROC)SettingsDlgProc); 1166 | } 1167 | else 1168 | { 1169 | WCHAR szFilename[MAX_PATH]; 1170 | GetModuleFileName(NULL, szFilename, MAX_PATH); 1171 | ShellExecute(hWnd, L"runas", szFilename, L"/elevate /openSettings", NULL, SW_SHOWNORMAL); 1172 | } 1173 | return TRUE; 1174 | } 1175 | // Exit 1176 | case ID_RMENU_EXIT: 1177 | // wParam and lParam are randomly chosen values 1178 | PostMessage(hWnd, WM_CLOSE, 0xBEBAF7F3, 0xC0CAF7F3); 1179 | return TRUE; 1180 | } 1181 | break; 1182 | } 1183 | case WM_CTLCOLORSTATIC: 1184 | { 1185 | HDC hdc = (HDC)wParam; 1186 | SetBkMode(hdc, TRANSPARENT); 1187 | switch(GetDlgCtrlID((HWND)lParam)) 1188 | { 1189 | case IDC_SERVICESTATUS: 1190 | SetTextColor(hdc, colorSvcStatus); 1191 | return (LRESULT)GetSysColorBrush(COLOR_MENU); 1192 | } 1193 | break; 1194 | } 1195 | // Taskbar icon callback 1196 | case WMAPP_NOTIFYCALLBACK: 1197 | { 1198 | switch (LOWORD(lParam)) 1199 | { 1200 | // Left click 1201 | case NIN_SELECT: 1202 | ShowWindowFront(hWnd, SW_SHOW); 1203 | UpdateStatus(hWnd, NULL, NULL, NULL); 1204 | return TRUE; 1205 | // Right click 1206 | case WM_CONTEXTMENU: 1207 | { 1208 | POINT const pt = { LOWORD(wParam), HIWORD(wParam) }; 1209 | HMENU hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_RMENU)); 1210 | if (hMenu) 1211 | { 1212 | MENUITEMINFO mi = { sizeof(MENUITEMINFO) }; 1213 | GetMenuItemInfo(hMenu, ID_RMENU_OPEN, false, &mi); 1214 | mi.fMask = MIIM_TYPE | MIIM_DATA; 1215 | 1216 | LoadString(hInst, IDS_RMENU_OPEN, szBuffer, dwBufferLen); 1217 | mi.dwTypeData = szBuffer; 1218 | SetMenuItemInfo(hMenu, ID_RMENU_OPEN, false, &mi); 1219 | LoadString(hInst, IDS_RMENU_FORCE, szBuffer, dwBufferLen); 1220 | mi.dwTypeData = szBuffer; 1221 | SetMenuItemInfo(hMenu, ID_RMENU_FORCE, false, &mi); 1222 | LoadString(hInst, IDS_RMENU_VIEWLOGS, szBuffer, dwBufferLen); 1223 | mi.dwTypeData = szBuffer; 1224 | SetMenuItemInfo(hMenu, ID_RMENU_VIEWLOGS, false, &mi); 1225 | LoadString(hInst, IDS_RMENU_NEWTICKET, szBuffer, dwBufferLen); 1226 | mi.dwTypeData = szBuffer; 1227 | SetMenuItemInfo(hMenu, ID_RMENU_NEWTICKET, false, &mi); 1228 | LoadString(hInst, IDS_RMENU_SETTINGS, szBuffer, dwBufferLen); 1229 | mi.dwTypeData = szBuffer; 1230 | SetMenuItemInfo(hMenu, ID_RMENU_SETTINGS, false, &mi); 1231 | LoadString(hInst, IDS_RMENU_EXIT, szBuffer, dwBufferLen); 1232 | mi.dwTypeData = szBuffer; 1233 | SetMenuItemInfo(hMenu, ID_RMENU_EXIT, false, &mi); 1234 | 1235 | // Set UAC shield (a bit ugly, especially in Windows 11) 1236 | int cx = GetSystemMetrics(SM_CXSMICON); 1237 | int cy = GetSystemMetrics(SM_CYSMICON); 1238 | HICON hShield = NULL; 1239 | HRESULT hr = LoadIconWithScaleDown(NULL, IDI_SHIELD, cx, cy, &hShield); 1240 | if (SUCCEEDED(hr)) 1241 | { 1242 | ICONINFO iconInfo; 1243 | GetIconInfo(hShield, &iconInfo); 1244 | HBITMAP bitmap = (HBITMAP)CopyImage(iconInfo.hbmColor, IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION); 1245 | SetMenuItemBitmaps(hMenu, ID_RMENU_SETTINGS, MF_BYCOMMAND, bitmap, bitmap); 1246 | DestroyIcon(hShield); 1247 | } 1248 | 1249 | HMENU hSubMenu = GetSubMenu(hMenu, 0); 1250 | if (hSubMenu) 1251 | { 1252 | SetForegroundWindow(hWnd); 1253 | UINT uFlags = TPM_RIGHTBUTTON; 1254 | if (GetSystemMetrics(SM_MENUDROPALIGNMENT) != 0) 1255 | uFlags |= TPM_RIGHTALIGN; 1256 | else 1257 | uFlags |= TPM_LEFTALIGN; 1258 | TrackPopupMenuEx(hSubMenu, uFlags, pt.x, pt.y, hWnd, NULL); 1259 | } 1260 | 1261 | DestroyMenu(hMenu); 1262 | } 1263 | return TRUE; 1264 | } 1265 | } 1266 | break; 1267 | } 1268 | // Restart Manager 1269 | case WM_QUERYENDSESSION: 1270 | { 1271 | if (lParam == ENDSESSION_CLOSEAPP) { 1272 | SetWindowLongPtr(hWnd, DWLP_MSGRESULT, TRUE); 1273 | return TRUE; 1274 | } 1275 | break; 1276 | } 1277 | case WM_ENDSESSION: 1278 | { 1279 | if (lParam == ENDSESSION_CLOSEAPP && wParam == TRUE) { 1280 | PostMessage(hWnd, WM_CLOSE, 0xBEBAF7F3, 0xC0CAF7F3); 1281 | return TRUE; 1282 | } 1283 | break; 1284 | } 1285 | case WM_CLOSE: 1286 | { 1287 | // Right-click Exit button 1288 | if (wParam == 0xBEBAF7F3 && lParam == 0xC0CAF7F3) 1289 | DestroyWindow(hWnd); 1290 | else 1291 | EndDialog(hWnd, NULL); 1292 | return TRUE; 1293 | } 1294 | case WM_DESTROY: 1295 | { 1296 | WinHttpCloseHandle(hConn); 1297 | WinHttpCloseHandle(hSession); 1298 | 1299 | Gdiplus::GdiplusShutdown(gdiplusToken); 1300 | 1301 | // Remove taskbar icon 1302 | Shell_NotifyIcon(NIM_DELETE, &nid); 1303 | 1304 | // Release mutex 1305 | ReleaseMutex(hMutex); 1306 | CloseHandle(hMutex); 1307 | 1308 | PostQuitMessage(0); 1309 | return TRUE; 1310 | } 1311 | } 1312 | return FALSE; 1313 | } 1314 | 1315 | -------------------------------------------------------------------------------- /GLPI-AgentMonitor.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #pragma code_page(65001) 4 | 5 | #include "resource.h" 6 | 7 | #define APSTUDIO_READONLY_SYMBOLS 8 | ///////////////////////////////////////////////////////////////////////////// 9 | // 10 | // Generated from the TEXTINCLUDE 2 resource. 11 | // 12 | #ifndef APSTUDIO_INVOKED 13 | #include "targetver.h" 14 | #endif 15 | #define APSTUDIO_HIDDEN_SYMBOLS 16 | #include "windows.h" 17 | #undef APSTUDIO_HIDDEN_SYMBOLS 18 | 19 | ///////////////////////////////////////////////////////////////////////////// 20 | #undef APSTUDIO_READONLY_SYMBOLS 21 | 22 | ///////////////////////////////////////////////////////////////////////////// 23 | // Russo (Rússia) resources 24 | 25 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS) 26 | LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT 27 | 28 | ///////////////////////////////////////////////////////////////////////////// 29 | // 30 | // String Table 31 | // 32 | 33 | STRINGTABLE 34 | BEGIN 35 | IDS_APP_TITLE "GLPI Agent Monitor" 36 | IDS_GLPINOTIFYERROR "Agent GLPI - Ошибка" 37 | IDS_GLPINOTIFY "Agent GLPI" 38 | IDS_STATIC_INFO "Информация" 39 | IDS_STATIC_AGENTVER "Версия агента :" 40 | IDS_STATIC_SERVICESTATUS "Статус службы :" 41 | IDS_STATIC_STARTTYPE "Тип запуска :" 42 | IDS_ERR_AGENTSETTINGS "Ошибка загрузки настроек GLPI Agent!\nПереустановите GLPI Agent." 43 | END 44 | 45 | STRINGTABLE 46 | BEGIN 47 | IDS_LOADING "Загрузка..." 48 | IDS_STATIC_AGENTSTATUS "Статус агента" 49 | IDS_FORCEINV "Инвентаризация" 50 | IDS_CLOSE "Закрыть" 51 | IDS_ERR_NOTRESPONDING "Агент не отвечает!" 52 | IDS_ERR_NOTRUNNING "Агент не запущен!" 53 | IDS_SVCSTART_BOOT "При загрузке" 54 | IDS_SVCSTART_SYSTEM "С системой" 55 | IDS_SVCSTART_AUTO "Автоматически" 56 | IDS_SVCSTART_DELAYEDAUTO "Автоматически (отложенный запуск)" 57 | IDS_SVCSTART_MANUAL "Вручную" 58 | IDS_SVCSTART_DISABLED "Отключен" 59 | IDS_ERR_UNKSVCSTART "Неизвестный тип запуска!" 60 | IDS_ERR_REGFAIL "Сбой запроса к реестру!" 61 | IDS_ERR_AGENTVERNOTFOUND "Версия агента не найдена!" 62 | IDS_ERR_AGENTNOTFOUND "Агент не установлен!" 63 | END 64 | 65 | STRINGTABLE 66 | BEGIN 67 | IDS_ERR_HTTPDPORT "Ошибка получения HTTP порта GLPI Agent!\nПереустановите GLPI Agent." 68 | IDS_SVC_STOPPED "Остановлена" 69 | IDS_SVC_RUNNING "Запущена" 70 | IDS_SVC_PAUSED "Приостановлен" 71 | IDS_SVC_CONTINUEPENDING "Возобновляется..." 72 | IDS_SVC_PAUSEPENDING "Приостанавливается..." 73 | IDS_SVC_STARTPENDING "Запускается..." 74 | IDS_SVC_STOPPENDING "Останавливается..." 75 | IDS_ERR_SERVICE "Ошибка запроса к службе!" 76 | IDS_OK "OK" 77 | IDS_ERROR "GLPI Agent Monitor - Ошибка" 78 | IDS_ERR_FORCEINV_NORESPONSE "Ошибка инвентаризации:\nАгент не отвечает." 79 | IDS_ERR_FORCEINV_NOTALLOWED 80 | "Ошибка инвентаризации:\nОперация не разрешена." 81 | IDS_MSG_FORCEINV_OK "Запрос инвентаризации успешно отправлен в GLPI Agent." 82 | IDS_ERR_AGENTERR "У агента одна или несколько ошибок !\nПожалуйста проверьте окно GLPI Agent Monitor." 83 | IDS_RMENU_OPEN "Открыть" 84 | END 85 | 86 | STRINGTABLE 87 | BEGIN 88 | IDS_RMENU_FORCE "Инвентаризация" 89 | IDS_RMENU_EXIT "Выход" 90 | IDS_FILE "Файл" 91 | IDS_DIR "Директория" 92 | IDS_ERR_MAINWINDOW "Ошибка создания главного окна GLPI Agent Monitor!" 93 | IDS_RMENU_NEWTICKET "Новая заявка..." 94 | IDS_ERR_SERVER "Ошибка получения URL адреса GLPI сервера!\nПереустановите GLPI Agent." 95 | IDS_NOTIF_NEWTICKET_TITLE "Сделан снимок экрана" 96 | IDS_NOTIF_NEWTICKET "Нажмите CTRL+V в окне описания новой заявки, чтобы прикрепить его к заявке." 97 | IDS_NEWTICKET "Новая заявка..." 98 | IDS_VIEWLOGS "Открыть логи" 99 | IDS_RMENU_VIEWLOGS "Открыть логи" 100 | IDS_STARTSVC " Запустить службу" 101 | IDS_STOPSVC " Остановить службу" 102 | IDS_RESUMESVC " Возобновить службу" 103 | IDS_WAIT "Пожалуйста подождите..." 104 | END 105 | 106 | STRINGTABLE 107 | BEGIN 108 | IDS_ERR_SCHANDLE "Ошибка подключения к Диспетчеру управления службами Windows(WSCM)!" 109 | IDS_ERR_SVCHANDLE "Ошибка открытия службы GLPI agent!" 110 | IDS_ERR_SVCOPERATION "Ошибка управления службой GLPI agent!" 111 | IDS_SETTINGS "GLPI Agent Monitor settings" 112 | IDS_SETTINGS_NEWTICKET_URL "New ticket page URL" 113 | IDS_ERR_SAVE_SETTINGS "Error saving GLPI Agent Monitor settings!" 114 | IDS_CANCEL "Cancel" 115 | IDS_SAVE "Save" 116 | IDS_BTN_SETTINGS " Settings" 117 | IDS_RMENU_SETTINGS "Settings" 118 | END 119 | 120 | #endif // Russo (Rússia) resources 121 | ///////////////////////////////////////////////////////////////////////////// 122 | 123 | 124 | ///////////////////////////////////////////////////////////////////////////// 125 | // Espanhol (Neutro) resources 126 | 127 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ESN) 128 | LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL 129 | 130 | ///////////////////////////////////////////////////////////////////////////// 131 | // 132 | // String Table 133 | // 134 | 135 | STRINGTABLE 136 | BEGIN 137 | IDS_APP_TITLE "GLPI Agent Monitor" 138 | IDS_GLPINOTIFYERROR "GLPI Agent - Error" 139 | IDS_GLPINOTIFY "GLPI Agent" 140 | IDS_STATIC_INFO "Información" 141 | IDS_STATIC_AGENTVER "Versión del agente:" 142 | IDS_STATIC_SERVICESTATUS "Estado del servicio:" 143 | IDS_STATIC_STARTTYPE "Tipo de inicio:" 144 | IDS_ERR_AGENTSETTINGS "Error al cargar la configuración del agente de GLPI\nDeberá reinstalar el agente." 145 | END 146 | 147 | STRINGTABLE 148 | BEGIN 149 | IDS_LOADING "Cargando..." 150 | IDS_STATIC_AGENTSTATUS "Estado del agente" 151 | IDS_FORCEINV "Forzar inventario" 152 | IDS_CLOSE "Cerrar" 153 | IDS_ERR_NOTRESPONDING "El agente no responde" 154 | IDS_ERR_NOTRUNNING "El agente no se está ejecutando" 155 | IDS_SVCSTART_BOOT "Iniciar" 156 | IDS_SVCSTART_SYSTEM "Sistema" 157 | IDS_SVCSTART_AUTO "Automático" 158 | IDS_SVCSTART_DELAYEDAUTO "Automático (Inicio retrasado)" 159 | IDS_SVCSTART_MANUAL "Manual" 160 | IDS_SVCSTART_DISABLED "Deshabilitado" 161 | IDS_ERR_UNKSVCSTART "Tipo de inicio desconocido" 162 | IDS_ERR_REGFAIL "Error de consulta de registro" 163 | IDS_ERR_AGENTVERNOTFOUND "No se encuentra la versión del agente" 164 | IDS_ERR_AGENTNOTFOUND "El agente no está instalado" 165 | END 166 | 167 | STRINGTABLE 168 | BEGIN 169 | IDS_ERR_HTTPDPORT "Error al obtener el puerto HTTP del Agente\nDeberá reinstalar el agente." 170 | IDS_SVC_STOPPED "Detenido" 171 | IDS_SVC_RUNNING "En ejecución" 172 | IDS_SVC_PAUSED "En pausa" 173 | IDS_SVC_CONTINUEPENDING "Resumiendo..." 174 | IDS_SVC_PAUSEPENDING "Pausando..." 175 | IDS_SVC_STARTPENDING "Iniciando..." 176 | IDS_SVC_STOPPENDING "Deteniendo..." 177 | IDS_ERR_SERVICE "Error en consulta del servicio" 178 | IDS_OK "OK" 179 | IDS_ERROR "GLPI Agent Monitor - Error" 180 | IDS_ERR_FORCEINV_NORESPONSE 181 | "Error al forzar inventario:\nEl agente no respondió a la solicitud." 182 | IDS_ERR_FORCEINV_NOTALLOWED 183 | "Error al forzar inventario:\nOperación no permitida." 184 | IDS_MSG_FORCEINV_OK "Solicitud de registro forzado enviada correctamente." 185 | IDS_ERR_AGENTERR "El agente presentó uno o más errores\nPor favor verifique la ventana de GLPI Agent Monitor." 186 | IDS_RMENU_OPEN "Abrir" 187 | END 188 | 189 | STRINGTABLE 190 | BEGIN 191 | IDS_RMENU_FORCE "Forzar inventario" 192 | IDS_RMENU_EXIT "Salir" 193 | IDS_FILE "Archivo" 194 | IDS_DIR "Directorio" 195 | IDS_ERR_MAINWINDOW "Error al crear la ventana principal de GLPI Agent Monitor" 196 | IDS_RMENU_NEWTICKET "Crear Ticket..." 197 | IDS_ERR_SERVER "Error al obtener la URL del servidor de GLPI\nDeberá reinstalar el agente." 198 | IDS_NOTIF_NEWTICKET_TITLE "Se tomó captura de pantalla" 199 | IDS_NOTIF_NEWTICKET "Presionar CTRL+V en la ventana de nuevo ticket, o adjuntar la captura como archivo en el formulario." 200 | IDS_NEWTICKET "Crear ticket..." 201 | IDS_VIEWLOGS "Ver registros" 202 | IDS_RMENU_VIEWLOGS "Ver registros" 203 | IDS_STARTSVC " Iniciar servicio" 204 | IDS_STOPSVC " Detener servicio" 205 | IDS_RESUMESVC " Resumir servicio" 206 | IDS_WAIT "Por favor, espere..." 207 | END 208 | 209 | STRINGTABLE 210 | BEGIN 211 | IDS_ERR_SCHANDLE "Error al conectar al Administrador de Servicios de Windows!" 212 | IDS_ERR_SVCHANDLE "Error al abrir el servicio de GLPI Agent" 213 | IDS_ERR_SVCOPERATION "Error al tomar el control del servicio de GLPI Agent" 214 | IDS_SETTINGS "Configuración de GLPI Agent Monitor" 215 | IDS_SETTINGS_NEWTICKET_URL "URL de la página de Crear ticket" 216 | IDS_ERR_SAVE_SETTINGS "Error guardando la configuración de GLPI Agent Monitor!" 217 | IDS_CANCEL "Cancelar" 218 | IDS_SAVE "Guardar" 219 | IDS_BTN_SETTINGS " Configuración" 220 | IDS_RMENU_SETTINGS "Configuración" 221 | IDS_SETTINGS_NEWTICKET "Crear ticket" 222 | IDS_SETTINGS_NEWTICKET_SCREENSHOT 223 | "Habilitar la captura pantalla cuando se pulse el botón de ""Crear ticket""" 224 | END 225 | 226 | #endif // Espanhol (Neutro) resources 227 | ///////////////////////////////////////////////////////////////////////////// 228 | 229 | 230 | ///////////////////////////////////////////////////////////////////////////// 231 | // Catalão (Catalão) resources 232 | 233 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CAT) 234 | LANGUAGE LANG_CATALAN, SUBLANG_DEFAULT 235 | 236 | ///////////////////////////////////////////////////////////////////////////// 237 | // 238 | // String Table 239 | // 240 | 241 | STRINGTABLE 242 | BEGIN 243 | IDS_APP_TITLE "GLPI Agent Monitor" 244 | IDS_GLPINOTIFYERROR "GLPI Agent - Error" 245 | IDS_GLPINOTIFY "GLPI Agent" 246 | IDS_STATIC_INFO "Info" 247 | IDS_STATIC_AGENTVER "Versió de l'Agent:" 248 | IDS_STATIC_SERVICESTATUS "Estat del servei:" 249 | IDS_STATIC_STARTTYPE "Mode d'inici:" 250 | IDS_ERR_AGENTSETTINGS "Error carregant la configuració!\nS'ha de reinstal·lar l'Agent." 251 | END 252 | 253 | STRINGTABLE 254 | BEGIN 255 | IDS_LOADING "Carregant..." 256 | IDS_STATIC_AGENTSTATUS "Estat del servei" 257 | IDS_FORCEINV "Forçar Inventari" 258 | IDS_CLOSE "Tancar" 259 | IDS_ERR_NOTRESPONDING "L'Agent no respon!" 260 | IDS_ERR_NOTRUNNING "L'Agent no s'està executant!" 261 | IDS_SVCSTART_BOOT "Boot" 262 | IDS_SVCSTART_SYSTEM "Sistema" 263 | IDS_SVCSTART_AUTO "Automàtic" 264 | IDS_SVCSTART_DELAYEDAUTO "Automàtic (Inici desencadenat)" 265 | IDS_SVCSTART_MANUAL "Manual" 266 | IDS_SVCSTART_DISABLED "Deshabilitat" 267 | IDS_ERR_UNKSVCSTART "Mode d'inici desconnegut!" 268 | IDS_ERR_REGFAIL "Obtenció de registre fallat!" 269 | IDS_ERR_AGENTVERNOTFOUND "Versió de l'Agent desconneguda!" 270 | IDS_ERR_AGENTNOTFOUND "L'Agent no està instal·lat!" 271 | END 272 | 273 | STRINGTABLE 274 | BEGIN 275 | IDS_ERR_HTTPDPORT "Hi ha hagut un error en obtenir el port HTTP de l'Agent!\nS'ha de reinstal·lar l'Agent." 276 | IDS_SVC_STOPPED "Aturat" 277 | IDS_SVC_RUNNING "Executant-se" 278 | IDS_SVC_PAUSED "Pausat" 279 | IDS_SVC_CONTINUEPENDING "Reprenent..." 280 | IDS_SVC_PAUSEPENDING "Pausant..." 281 | IDS_SVC_STARTPENDING "Iniciant-se..." 282 | IDS_SVC_STOPPENDING "Aturant-se..." 283 | IDS_ERR_SERVICE "Obtenció del servei fallada!" 284 | IDS_OK "OK" 285 | IDS_ERROR "GLPI Agent Monitor - Error" 286 | IDS_ERR_FORCEINV_NORESPONSE 287 | "Hi ha hagut un error forçant l'Inventari:\nL'Agent no ha respost a l'ordre." 288 | IDS_ERR_FORCEINV_NOTALLOWED 289 | "Hi ha hagut un error forçant l'Inventari:\nOperació no permesa." 290 | IDS_MSG_FORCEINV_OK "Inventari forçat enviat correctament a l'Agent." 291 | IDS_ERR_AGENTERR "Hi ha hagut un o més errors a l'Agent!\nSi us plau, comprova l'estat a la finestra de l'Agent." 292 | IDS_RMENU_OPEN "Obre" 293 | END 294 | 295 | STRINGTABLE 296 | BEGIN 297 | IDS_RMENU_FORCE "Forçar Inventari" 298 | IDS_RMENU_EXIT "Sortir" 299 | IDS_FILE "Fitxer" 300 | IDS_DIR "Directori" 301 | IDS_ERR_MAINWINDOW "Error creant la finestra principal del GLPI Agent Monitor." 302 | IDS_RMENU_NEWTICKET "Obrir tiquet" 303 | IDS_ERR_SERVER "Hi ha hagut un error obtenint l'URL!\nS'ha de reinstal·lar l'Agent." 304 | IDS_NOTIF_NEWTICKET_TITLE "S'ha fet una captura de pantalla" 305 | IDS_NOTIF_NEWTICKET "Prem CTRL+V a la nova finestra de la incidència per adjuntar-ho al nou tiquet." 306 | IDS_NEWTICKET "Obrir tiquet..." 307 | IDS_VIEWLOGS "Veure logs" 308 | IDS_RMENU_VIEWLOGS "Veure logs" 309 | IDS_STARTSVC " Iniciar service" 310 | IDS_STOPSVC " Aturar servei" 311 | IDS_RESUMESVC " Rependre el servei" 312 | IDS_WAIT "Si us plau, espera..." 313 | END 314 | 315 | STRINGTABLE 316 | BEGIN 317 | IDS_ERR_SCHANDLE "Hi ha hagut un error connectant amb el Windows Service Control Manager!" 318 | IDS_ERR_SVCHANDLE "Hi ha hagut un error obrint el servei del GLPI Agent!" 319 | IDS_ERR_SVCOPERATION "Hi ha hagut un error intentnat controlar el servei del GLPI Agent!" 320 | IDS_SETTINGS "Configuració del GLPI Agent Monitor" 321 | IDS_SETTINGS_NEWTICKET_URL "URL de la pàgina de Nou Tiquet" 322 | IDS_ERR_SAVE_SETTINGS "Hi ha hagut un error guardant la configuració del GLPI Agent Monitor!" 323 | IDS_CANCEL "Cancelar" 324 | IDS_SAVE "Guardar" 325 | IDS_BTN_SETTINGS " Configuració" 326 | IDS_RMENU_SETTINGS "Configuració" 327 | IDS_SETTINGS_NEWTICKET "Nou tiquet" 328 | IDS_SETTINGS_NEWTICKET_SCREENSHOT 329 | "Fer una captura de pantalla quan es premi el botó de ""Nou tiquet""" 330 | END 331 | 332 | #endif // Catalão (Catalão) resources 333 | ///////////////////////////////////////////////////////////////////////////// 334 | 335 | 336 | ///////////////////////////////////////////////////////////////////////////// 337 | // Inglês (Estados Unidos) resources 338 | 339 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 340 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 341 | 342 | ///////////////////////////////////////////////////////////////////////////// 343 | // 344 | // String Table 345 | // 346 | 347 | STRINGTABLE 348 | BEGIN 349 | IDS_APP_TITLE "GLPI Agent Monitor" 350 | IDS_GLPINOTIFYERROR "GLPI Agent - Error" 351 | IDS_GLPINOTIFY "GLPI Agent" 352 | IDS_STATIC_INFO "Info" 353 | IDS_STATIC_AGENTVER "Agent version:" 354 | IDS_STATIC_SERVICESTATUS "Service status:" 355 | IDS_STATIC_STARTTYPE "Startup type:" 356 | IDS_ERR_AGENTSETTINGS "Error loading GLPI Agent settings!\nThe agent must be reinstalled." 357 | END 358 | 359 | STRINGTABLE 360 | BEGIN 361 | IDS_LOADING "Loading..." 362 | IDS_STATIC_AGENTSTATUS "Agent status" 363 | IDS_FORCEINV "Force Inventory" 364 | IDS_CLOSE "Close" 365 | IDS_ERR_NOTRESPONDING "The agent is not responding!" 366 | IDS_ERR_NOTRUNNING "The agent is not running!" 367 | IDS_SVCSTART_BOOT "Boot" 368 | IDS_SVCSTART_SYSTEM "System" 369 | IDS_SVCSTART_AUTO "Automatic" 370 | IDS_SVCSTART_DELAYEDAUTO "Automatic (Delayed start)" 371 | IDS_SVCSTART_MANUAL "Manual" 372 | IDS_SVCSTART_DISABLED "Disabled" 373 | IDS_ERR_UNKSVCSTART "Unknown startup type!" 374 | IDS_ERR_REGFAIL "Registry query failure!" 375 | IDS_ERR_AGENTVERNOTFOUND "Agent version not found!" 376 | IDS_ERR_AGENTNOTFOUND "The agent is not installed!" 377 | END 378 | 379 | STRINGTABLE 380 | BEGIN 381 | IDS_ERR_HTTPDPORT "Error getting GLPI Agent HTTP port!\nThe agent must be reinstalled." 382 | IDS_SVC_STOPPED "Stopped" 383 | IDS_SVC_RUNNING "Running" 384 | IDS_SVC_PAUSED "Paused" 385 | IDS_SVC_CONTINUEPENDING "Resuming..." 386 | IDS_SVC_PAUSEPENDING "Pausing..." 387 | IDS_SVC_STARTPENDING "Starting..." 388 | IDS_SVC_STOPPENDING "Stopping..." 389 | IDS_ERR_SERVICE "Service query failure!" 390 | IDS_OK "OK" 391 | IDS_ERROR "GLPI Agent Monitor - Error" 392 | IDS_ERR_FORCEINV_NORESPONSE 393 | "Force inventory error:\nThe agent did not respond to the request." 394 | IDS_ERR_FORCEINV_NOTALLOWED 395 | "Force inventory error:\nOperation not allowed." 396 | IDS_MSG_FORCEINV_OK "Force inventory request successfully sent to GLPI Agent." 397 | IDS_ERR_AGENTERR "The agent has one or more errors!\nPlease check the GLPI Agent Monitor window." 398 | IDS_RMENU_OPEN "Open" 399 | END 400 | 401 | STRINGTABLE 402 | BEGIN 403 | IDS_RMENU_FORCE "Force Inventory" 404 | IDS_RMENU_EXIT "Exit" 405 | IDS_FILE "File" 406 | IDS_DIR "Directory" 407 | IDS_ERR_MAINWINDOW "Error creating GLPI Agent Monitor main window!" 408 | IDS_RMENU_NEWTICKET "New ticket..." 409 | IDS_ERR_SERVER "Error getting GLPI server URL!\nThe agent must be reinstalled." 410 | IDS_NOTIF_NEWTICKET_TITLE "A screen capture was taken" 411 | IDS_NOTIF_NEWTICKET "Press CTRL+V in the new ticket description panel to attach it to the ticket." 412 | IDS_NEWTICKET "New ticket..." 413 | IDS_VIEWLOGS "View agent logs" 414 | IDS_RMENU_VIEWLOGS "View agent logs" 415 | IDS_STARTSVC " Start service" 416 | IDS_STOPSVC " Stop service" 417 | IDS_RESUMESVC " Resume service" 418 | IDS_WAIT "Please wait..." 419 | END 420 | 421 | STRINGTABLE 422 | BEGIN 423 | IDS_ERR_SCHANDLE "Error connecting to the Windows Service Control Manager!" 424 | IDS_ERR_SVCHANDLE "Error opening the GLPI Agent service!" 425 | IDS_ERR_SVCOPERATION "Error trying to control the GLPI Agent service!" 426 | IDS_SETTINGS "GLPI Agent Monitor settings" 427 | IDS_SETTINGS_NEWTICKET_URL "New ticket page URL" 428 | IDS_ERR_SAVE_SETTINGS "Error saving GLPI Agent Monitor settings!" 429 | IDS_CANCEL "Cancel" 430 | IDS_SAVE "Save" 431 | IDS_BTN_SETTINGS " Settings" 432 | IDS_RMENU_SETTINGS "Settings" 433 | IDS_SETTINGS_NEWTICKET "New ticket" 434 | IDS_SETTINGS_NEWTICKET_SCREENSHOT 435 | "Enable screen capture when clicking the ""New ticket"" button" 436 | END 437 | 438 | #endif // Inglês (Estados Unidos) resources 439 | ///////////////////////////////////////////////////////////////////////////// 440 | 441 | 442 | ///////////////////////////////////////////////////////////////////////////// 443 | // Francês (França) resources 444 | 445 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA) 446 | LANGUAGE LANG_FRENCH, SUBLANG_FRENCH 447 | 448 | ///////////////////////////////////////////////////////////////////////////// 449 | // 450 | // String Table 451 | // 452 | 453 | STRINGTABLE 454 | BEGIN 455 | IDS_APP_TITLE "GLPI Agent Monitor" 456 | IDS_GLPINOTIFYERROR "Agent GLPI - Erreur" 457 | IDS_GLPINOTIFY "Agent GLPI" 458 | IDS_STATIC_INFO "Information" 459 | IDS_STATIC_AGENTVER "Version de l'agent :" 460 | IDS_STATIC_SERVICESTATUS "Statut du service :" 461 | IDS_STATIC_STARTTYPE "Type de démarrage :" 462 | IDS_ERR_AGENTSETTINGS "Erreur de chargement des paramètres de l'agent GLPI!\nL'agent doit être ré-installé." 463 | END 464 | 465 | STRINGTABLE 466 | BEGIN 467 | IDS_LOADING "Chargement..." 468 | IDS_STATIC_AGENTSTATUS "Statut de l'agent" 469 | IDS_FORCEINV "Forcer l'inventaire" 470 | IDS_CLOSE "Fermer" 471 | IDS_ERR_NOTRESPONDING "L'agent ne répond pas !" 472 | IDS_ERR_NOTRUNNING "L'agent n'est pas démarré !" 473 | IDS_SVCSTART_BOOT "Au démarrage" 474 | IDS_SVCSTART_SYSTEM "Système" 475 | IDS_SVCSTART_AUTO "Automatique" 476 | IDS_SVCSTART_DELAYEDAUTO "Automatique (Début differré)" 477 | IDS_SVCSTART_MANUAL "Manuel" 478 | IDS_SVCSTART_DISABLED "Désactivé" 479 | IDS_ERR_UNKSVCSTART "Type de démarrage inconnu !" 480 | IDS_ERR_REGFAIL "Échec d'accès à la base de registre !" 481 | IDS_ERR_AGENTVERNOTFOUND "Version de l'agent non trouvée !" 482 | IDS_ERR_AGENTNOTFOUND "L'agent n'est pas installé !" 483 | END 484 | 485 | STRINGTABLE 486 | BEGIN 487 | IDS_ERR_HTTPDPORT "Erreur de récupération du port HTTP de l'agent GLPI !\nL'agent doit être ré-installé." 488 | IDS_SVC_STOPPED "Arrêté" 489 | IDS_SVC_RUNNING "Démarré" 490 | IDS_SVC_PAUSED "En pause" 491 | IDS_SVC_CONTINUEPENDING "Reprise..." 492 | IDS_SVC_PAUSEPENDING "Mise en pause..." 493 | IDS_SVC_STARTPENDING "Démarrage..." 494 | IDS_SVC_STOPPENDING "Arrêt en cours..." 495 | IDS_ERR_SERVICE "Échec d'accès au service !" 496 | IDS_OK "OK" 497 | IDS_ERROR "GLPI Agent Monitor - Erreur" 498 | IDS_ERR_FORCEINV_NORESPONSE 499 | "Erreur de forçage de l'inventaire :\nL'agent n'a pas donné de réponse." 500 | IDS_ERR_FORCEINV_NOTALLOWED 501 | "Erreur de forçage de l'inventaire :\nAction non autorisée." 502 | IDS_MSG_FORCEINV_OK "La requête de forçage de l'inventaire a été envoyée avec succès à l'agent GLPI." 503 | IDS_ERR_AGENTERR "L'agent a une ou plusieurs erreurs !\nVous devriez vérifier la fenêtre de GLPI Agent Monitor." 504 | IDS_RMENU_OPEN "Ouvrir" 505 | END 506 | 507 | STRINGTABLE 508 | BEGIN 509 | IDS_RMENU_FORCE "Forcer l'inventaire" 510 | IDS_RMENU_EXIT "Quitter" 511 | IDS_FILE "Fichier" 512 | IDS_DIR "Dossier" 513 | IDS_ERR_MAINWINDOW "Erreur de création de la fenêtre principale de GLPI Agent Monitor !" 514 | IDS_RMENU_NEWTICKET "Nouveau ticket..." 515 | IDS_ERR_SERVER "Erreur de récupération de l'URL du serveur GLPI !\nL'agent doit être ré-installé." 516 | IDS_NOTIF_NEWTICKET_TITLE "Une capture d'écran a été prise" 517 | IDS_NOTIF_NEWTICKET "Appuyez sur CTRL+V dans le cadre de la description du nouveau ticket pour l'inclure au ticket." 518 | IDS_NEWTICKET "Nouveau ticket..." 519 | IDS_VIEWLOGS "Journal de l'agent" 520 | IDS_RMENU_VIEWLOGS "Journal de l'agent" 521 | IDS_STARTSVC " Démarrer le service" 522 | IDS_STOPSVC " Arrêter le service" 523 | IDS_RESUMESVC " Sortir le service de pause" 524 | IDS_WAIT "Veuillez attendre..." 525 | END 526 | 527 | STRINGTABLE 528 | BEGIN 529 | IDS_ERR_SCHANDLE "Erreur de connexion au gestionnaire de contrôle Windows Service !" 530 | IDS_ERR_SVCHANDLE "Erreur d'ouverture du service de l'agent GLPI !" 531 | IDS_ERR_SVCOPERATION "Erreur en tentant de gérer le service de l'agent GLPI !" 532 | IDS_SETTINGS "Paramètres de GLPI Agent Monitor" 533 | IDS_SETTINGS_NEWTICKET_URL "URL de nouveau ticket" 534 | IDS_ERR_SAVE_SETTINGS "Erreur durant l'enregistrement des paramètres de GLPI Agent Monitor !" 535 | IDS_CANCEL "Annuler" 536 | IDS_SAVE "Enregistrer" 537 | IDS_BTN_SETTINGS " Paramètres" 538 | IDS_RMENU_SETTINGS "Paramètres" 539 | END 540 | 541 | #endif // Francês (França) resources 542 | ///////////////////////////////////////////////////////////////////////////// 543 | 544 | 545 | ///////////////////////////////////////////////////////////////////////////// 546 | // Italiano (Itália) resources 547 | 548 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ITA) 549 | LANGUAGE LANG_ITALIAN, SUBLANG_ITALIAN 550 | 551 | ///////////////////////////////////////////////////////////////////////////// 552 | // 553 | // String Table 554 | // 555 | 556 | STRINGTABLE 557 | BEGIN 558 | IDS_APP_TITLE "GLPI Agent Monitor" 559 | IDS_GLPINOTIFYERROR "GLPI Agent - Error" 560 | IDS_GLPINOTIFY "Agente GLPI" 561 | IDS_STATIC_INFO "Informazioni" 562 | IDS_STATIC_AGENTVER "Versione Agent:" 563 | IDS_STATIC_SERVICESTATUS "Stato del servizio:" 564 | IDS_STATIC_STARTTYPE "Tipo di avvio:" 565 | IDS_ERR_AGENTSETTINGS "Errore nel caricamento dei settaggi dell'Agente GLPI!\nL'agente deve essere reinstallato." 566 | END 567 | 568 | STRINGTABLE 569 | BEGIN 570 | IDS_LOADING "Caricamento..." 571 | IDS_STATIC_AGENTSTATUS "Stato Agente" 572 | IDS_FORCEINV "Forza Inventario" 573 | IDS_CLOSE "Chiudi" 574 | IDS_ERR_NOTRESPONDING "L'agente non risponde!" 575 | IDS_ERR_NOTRUNNING "L'agente non è attivo!" 576 | IDS_SVCSTART_BOOT "Avvio" 577 | IDS_SVCSTART_SYSTEM "Sistema" 578 | IDS_SVCSTART_AUTO "Automatico" 579 | IDS_SVCSTART_DELAYEDAUTO "Automatic (Avvio ritardato)" 580 | IDS_SVCSTART_MANUAL "Manuale" 581 | IDS_SVCSTART_DISABLED "Disabilitato" 582 | IDS_ERR_UNKSVCSTART "Tipo di avvio Sconosciuto!" 583 | IDS_ERR_REGFAIL "Query al registro fallita!" 584 | IDS_ERR_AGENTVERNOTFOUND "Versione Agente non trovata!" 585 | IDS_ERR_AGENTNOTFOUND "L'agente non è installato!" 586 | END 587 | 588 | STRINGTABLE 589 | BEGIN 590 | IDS_ERR_HTTPDPORT "Errore nel verificare la porta HTTP dell'Agente GLPI!\nL'agente deve essere reinstallato." 591 | IDS_SVC_STOPPED "Fermato" 592 | IDS_SVC_RUNNING "Avviato" 593 | IDS_SVC_PAUSED "In Pausa" 594 | IDS_SVC_CONTINUEPENDING "Avviando..." 595 | IDS_SVC_PAUSEPENDING "Andando in pausa..." 596 | IDS_SVC_STARTPENDING "Avviando..." 597 | IDS_SVC_STOPPENDING "Fermando..." 598 | IDS_ERR_SERVICE "Query al servizio fallita!" 599 | IDS_OK "OK" 600 | IDS_ERROR "GLPI Agent Monitor - Errore" 601 | IDS_ERR_FORCEINV_NORESPONSE 602 | "Errore inventario forzato:\nL'agente non risponde alla richiesta." 603 | IDS_ERR_FORCEINV_NOTALLOWED 604 | "Errore inventario forzato:\nOperazione non permessa." 605 | IDS_MSG_FORCEINV_OK "La richiesta d'inventario forzato è stata inviata correttamente all'agente GLPI." 606 | IDS_ERR_AGENTERR "L'agente ha uno o più errori!\nPer favore controlla la finestra del GLPI Agent Monitor." 607 | IDS_RMENU_OPEN "Apri" 608 | END 609 | 610 | STRINGTABLE 611 | BEGIN 612 | IDS_RMENU_FORCE "Forza Inventario" 613 | IDS_RMENU_EXIT "Esci" 614 | IDS_FILE "File" 615 | IDS_DIR "Cartella" 616 | IDS_ERR_MAINWINDOW "Errore nella creazione della finestra principale del GLPI Agent Monitor!" 617 | IDS_RMENU_NEWTICKET "Nuovo ticket..." 618 | IDS_ERR_SERVER "Errore nel recuperare l'URL del GLPI server!\nL'agente deve essere reinstallato." 619 | IDS_NOTIF_NEWTICKET_TITLE "E' stato salvato uno screenshot" 620 | IDS_NOTIF_NEWTICKET "Premi CTRL+V nel campo descrizione del nuovo ticket per allegarlo." 621 | IDS_NEWTICKET "Nuovo ticket..." 622 | IDS_VIEWLOGS "Visualizza log agente" 623 | IDS_RMENU_VIEWLOGS "Visualizza log agente" 624 | IDS_STARTSVC " Avvia il servizio" 625 | IDS_STOPSVC " Ferma il servizio" 626 | IDS_RESUMESVC " Riattiva il servizio" 627 | IDS_WAIT "Attendere prego..." 628 | END 629 | 630 | STRINGTABLE 631 | BEGIN 632 | IDS_ERR_SCHANDLE "Errore nella connessione al Windows Service Control Manager!" 633 | IDS_ERR_SVCHANDLE "Errore nell'apertura del servizio GLPI Agent!" 634 | IDS_ERR_SVCOPERATION "Errore provando a controllare il servizio GLPI Agent!" 635 | IDS_SETTINGS "Impostazioni GLPI Agent Monitor" 636 | IDS_SETTINGS_NEWTICKET_URL "URL pagina Nuovo ticket" 637 | IDS_ERR_SAVE_SETTINGS "Errore salvando le impostazioni di GLPI Agent Monitor!" 638 | IDS_CANCEL "Annulla" 639 | IDS_SAVE "Salva" 640 | IDS_BTN_SETTINGS " Impostazioni" 641 | IDS_RMENU_SETTINGS "Impostazioni" 642 | END 643 | 644 | #endif // Italiano (Itália) resources 645 | ///////////////////////////////////////////////////////////////////////////// 646 | 647 | 648 | ///////////////////////////////////////////////////////////////////////////// 649 | // Holandês (Países Baixos) resources 650 | 651 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NLD) 652 | LANGUAGE LANG_DUTCH, SUBLANG_DUTCH 653 | 654 | ///////////////////////////////////////////////////////////////////////////// 655 | // 656 | // String Table 657 | // 658 | 659 | STRINGTABLE 660 | BEGIN 661 | IDS_APP_TITLE "GLPI Agent Monitor" 662 | IDS_GLPINOTIFYERROR "GLPI Agent - Fout" 663 | IDS_GLPINOTIFY "GLPI Agent" 664 | IDS_STATIC_INFO "Info" 665 | IDS_STATIC_AGENTVER "Agent versie:" 666 | IDS_STATIC_SERVICESTATUS "Service status:" 667 | IDS_STATIC_STARTTYPE "Opstart type:" 668 | IDS_ERR_AGENTSETTINGS "GLPI Agent instellingen kon niet worden geladen!\nHerinstalleer de GLPI Agent." 669 | END 670 | 671 | STRINGTABLE 672 | BEGIN 673 | IDS_LOADING "Laden..." 674 | IDS_STATIC_AGENTSTATUS "Agent status" 675 | IDS_FORCEINV "Forceer Inventory" 676 | IDS_CLOSE "Sluiten" 677 | IDS_ERR_NOTRESPONDING "Agent reageert niet!" 678 | IDS_ERR_NOTRUNNING "Agent is niet actief!" 679 | IDS_SVCSTART_BOOT "Boot" 680 | IDS_SVCSTART_SYSTEM "Systeem" 681 | IDS_SVCSTART_AUTO "Automatisch" 682 | IDS_SVCSTART_DELAYEDAUTO "Automatisch (Uitgesteld opstarten)" 683 | IDS_SVCSTART_MANUAL "Handmatig" 684 | IDS_SVCSTART_DISABLED "Uitgeschakeld" 685 | IDS_ERR_UNKSVCSTART "Opstart type onbekend!" 686 | IDS_ERR_REGFAIL "Registry query fout!" 687 | IDS_ERR_AGENTVERNOTFOUND "Agent versie niet gevonden!" 688 | IDS_ERR_AGENTNOTFOUND "Agent is niet geinstalleerd!" 689 | END 690 | 691 | STRINGTABLE 692 | BEGIN 693 | IDS_ERR_HTTPDPORT "Fout bij het ophalen van de GLPI Agent HTTP-poort!\nHerinstalleer de GLPI Agent." 694 | IDS_SVC_STOPPED "Gestopt" 695 | IDS_SVC_RUNNING "Actief" 696 | IDS_SVC_PAUSED "Gepauzeerd" 697 | IDS_SVC_CONTINUEPENDING "Hervatten..." 698 | IDS_SVC_PAUSEPENDING "Pauzeren..." 699 | IDS_SVC_STARTPENDING "Word gestart..." 700 | IDS_SVC_STOPPENDING "Word gestopt..." 701 | IDS_ERR_SERVICE "Service query fout!" 702 | IDS_OK "OK" 703 | IDS_ERROR "GLPI Agent Monitor - Fout" 704 | IDS_ERR_FORCEINV_NORESPONSE 705 | "Forceer Inventory error:\nDe agent reageerde niet op het verzoek." 706 | IDS_ERR_FORCEINV_NOTALLOWED 707 | "Forceer Inventory error:\nBewerking niet toegestaan." 708 | IDS_MSG_FORCEINV_OK "Force Inventory verzoek succesvol verzonden naar GLPI Agent." 709 | IDS_ERR_AGENTERR "De Agent heeft een of meer fouten!\nControleer het GLPI Agent Monitor-venster." 710 | IDS_RMENU_OPEN "Openen" 711 | END 712 | 713 | STRINGTABLE 714 | BEGIN 715 | IDS_RMENU_FORCE "Forceer Inventory" 716 | IDS_RMENU_EXIT "Sluiten" 717 | IDS_FILE "Bestand" 718 | IDS_DIR "Folder" 719 | IDS_ERR_MAINWINDOW "Fout bij het maken van het hoofdvenster van GLPI Agent Monitor!" 720 | IDS_RMENU_NEWTICKET "Nieuwe ticket..." 721 | IDS_ERR_SERVER "Fout bij ophalen van GLPI-server-URL!\nHerinstalleer de GLPI Agent." 722 | IDS_NOTIF_NEWTICKET_TITLE "Er is een schermopname gemaakt" 723 | IDS_NOTIF_NEWTICKET "Druk op CTRL+V in het nieuwe beschrijvings veld om het aan het ticket te koppelen." 724 | IDS_NEWTICKET "Nieuwe ticket..." 725 | IDS_VIEWLOGS "Bekijk agent logs" 726 | IDS_RMENU_VIEWLOGS "Bekijk agent logs" 727 | IDS_STARTSVC " Start service" 728 | IDS_STOPSVC " Stop service" 729 | IDS_RESUMESVC " Hervat service" 730 | IDS_WAIT "Een ogenblik geduld..." 731 | END 732 | 733 | STRINGTABLE 734 | BEGIN 735 | IDS_ERR_SCHANDLE "Fout bij het verbinden met Windows Service Control Manager!" 736 | IDS_ERR_SVCHANDLE "Fout bij het openen van de GLPI Agent-service!" 737 | IDS_ERR_SVCOPERATION "Fout bij het controleren van de GLPI Agent-service!" 738 | IDS_SETTINGS "GLPI Agent Monitor instellingen" 739 | IDS_SETTINGS_NEWTICKET_URL "Nieuwe ticketpagina-URL" 740 | IDS_ERR_SAVE_SETTINGS "Fout bij opslaan van GLPI Agent Monitor-instellingen!" 741 | IDS_CANCEL "Annuleren" 742 | IDS_SAVE "Opslaan" 743 | IDS_BTN_SETTINGS " Instellingen" 744 | IDS_RMENU_SETTINGS "Instellingen" 745 | IDS_SETTINGS_NEWTICKET "Nieuwe ticket" 746 | IDS_SETTINGS_NEWTICKET_SCREENSHOT 747 | "Schermopname inschakelen wanneer u op de ""Nieuwe ticket"" knop drukt" 748 | END 749 | 750 | #endif // Holandês (Países Baixos) resources 751 | ///////////////////////////////////////////////////////////////////////////// 752 | 753 | 754 | ///////////////////////////////////////////////////////////////////////////// 755 | // Português (Brasil) resources 756 | 757 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_PTB) 758 | LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN 759 | 760 | ///////////////////////////////////////////////////////////////////////////// 761 | // 762 | // DESIGNINFO 763 | // 764 | 765 | #ifdef APSTUDIO_INVOKED 766 | GUIDELINES DESIGNINFO 767 | BEGIN 768 | IDD_MAIN, DIALOG 769 | BEGIN 770 | LEFTMARGIN, 7 771 | RIGHTMARGIN, 242 772 | TOPMARGIN, 7 773 | BOTTOMMARGIN, 317 774 | END 775 | 776 | IDD_DLG_SETTINGS, DIALOG 777 | BEGIN 778 | LEFTMARGIN, 7 779 | RIGHTMARGIN, 350 780 | TOPMARGIN, 7 781 | BOTTOMMARGIN, 90 782 | END 783 | END 784 | #endif // APSTUDIO_INVOKED 785 | 786 | 787 | #ifdef APSTUDIO_INVOKED 788 | ///////////////////////////////////////////////////////////////////////////// 789 | // 790 | // TEXTINCLUDE 791 | // 792 | 793 | 1 TEXTINCLUDE 794 | BEGIN 795 | "resource.h\0" 796 | END 797 | 798 | 2 TEXTINCLUDE 799 | BEGIN 800 | "#ifndef APSTUDIO_INVOKED\r\n" 801 | "#include ""targetver.h""\r\n" 802 | "#endif\r\n" 803 | "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" 804 | "#include ""windows.h""\r\n" 805 | "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" 806 | "\0" 807 | END 808 | 809 | 3 TEXTINCLUDE 810 | BEGIN 811 | "#include ""GLPI-AgentMonitor.rc2""\r\n" 812 | "\0" 813 | END 814 | 815 | #endif // APSTUDIO_INVOKED 816 | 817 | 818 | ///////////////////////////////////////////////////////////////////////////// 819 | // 820 | // Dialog 821 | // 822 | 823 | IDD_MAIN DIALOGEX 0, 0, 249, 324 824 | STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU 825 | CAPTION "IDS_APP_TITLE" 826 | FONT 8, "MS Shell Dlg", 400, 0, 0x1 827 | BEGIN 828 | CTEXT "IDS_APP_TITLE",IDC_STATIC_TITLE,17,76,215,8 829 | CTEXT "vX.XX",IDC_VERSION,17,87,215,8 830 | GROUPBOX "IDS_STATIC_INFO",IDC_GBMAIN,7,100,235,103 831 | GROUPBOX "IDS_STATIC_AGENTSTATUS",IDC_GBSTATUS,7,209,235,30 832 | CTEXT "IDS_LOADING",IDC_AGENTSTATUS,27,222,195,8 833 | LTEXT "IDS_STATIC_AGENTVER",IDC_STATIC_AGENTVER,22,121,79,8 834 | LTEXT "IDS_STATIC_SERVICESTATUS",IDC_STATIC_SERVICESTATUS,22,139,98,8 835 | LTEXT "IDS_STATIC_STARTTYPE",IDC_STATIC_STARTTYPE,22,157,82,8 836 | RTEXT "IDS_LOADING",IDC_AGENTVER,92,121,136,8 837 | RTEXT "IDS_LOADING",IDC_SERVICESTATUS,104,139,124,8 838 | RTEXT "IDS_LOADING",IDC_STARTTYPE,100,157,128,8 839 | CONTROL "",IDC_PCLOGO,"Static",SS_BITMAP,94,9,15,13 840 | DEFPUSHBUTTON "IDS_STARTSVC",IDC_BTN_STARTSTOPSVC,82,177,86,16 841 | PUSHBUTTON "IDS_FORCEINV",IDC_BTN_FORCE,44,248,72,16 842 | PUSHBUTTON "IDS_NEWTICKET",IDC_BTN_NEWTICKET,132,248,72,16 843 | PUSHBUTTON "IDS_VIEWLOGS",IDC_BTN_VIEWLOGS,44,272,72,16 844 | PUSHBUTTON "IDS_BTN_SETTINGS",IDC_BTN_SETTINGS,132,272,72,16 845 | PUSHBUTTON "IDS_CLOSE",IDC_BTN_CLOSE,88,296,72,16 846 | END 847 | 848 | IDD_DLG_SETTINGS DIALOGEX 0, 0, 357, 97 849 | STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU 850 | CAPTION "IDS_SETTINGS" 851 | FONT 8, "MS Shell Dlg", 400, 0, 0x1 852 | BEGIN 853 | GROUPBOX "IDS_SETTINGS_NEWTICKET",IDC_SETTINGS_GROUPBOX_NEWTICKET,7,7,343,63 854 | EDITTEXT IDC_SETTINGS_EDIT_NEWTICKET_URL,14,32,329,14,ES_AUTOHSCROLL 855 | PUSHBUTTON "IDS_CANCEL",IDC_SETTINGS_BTN_CANCEL,241,76,50,14 856 | DEFPUSHBUTTON "IDS_SAVE",IDC_SETTINGS_BTN_SAVE,300,76,50,14 857 | CONTROL "IDS_SETTINGS_NEWTICKET_SCREENSHOT",IDC_SETTINGS_CHECKBOX_NEWTICKET_SCREENSHOT, 858 | "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,52,326,10 859 | LTEXT "IDS_SETTINGS_NEWTICKET_URL",IDC_SETTINGS_TEXT_NEWTICKET_URL,16,20,325,8 860 | END 861 | 862 | 863 | ///////////////////////////////////////////////////////////////////////////// 864 | // 865 | // Menu 866 | // 867 | 868 | IDR_RMENU MENU 869 | BEGIN 870 | POPUP "GLPI Agent" 871 | BEGIN 872 | MENUITEM "IDS_RMENU_OPEN", ID_RMENU_OPEN 873 | MENUITEM "IDS_RMENU_FORCE", ID_RMENU_FORCE 874 | MENUITEM "IDS_RMENU_VIEWLOGS", ID_RMENU_VIEWLOGS 875 | MENUITEM "IDS_RMENU_SETTINGS", ID_RMENU_SETTINGS 876 | MENUITEM SEPARATOR 877 | MENUITEM "IDS_RMENU_NEWTICKET", ID_RMENU_NEWTICKET 878 | MENUITEM SEPARATOR 879 | MENUITEM "IDS_RMENU_EXIT", ID_RMENU_EXIT 880 | END 881 | END 882 | 883 | 884 | ///////////////////////////////////////////////////////////////////////////// 885 | // 886 | // Icon 887 | // 888 | 889 | // Icon with lowest ID value placed first to ensure application icon 890 | // remains consistent on all systems. 891 | IDI_GLPIOK ICON "Resources\\glpiok.ico" 892 | 893 | IDI_GLPIERR ICON "Resources\\glpierr.ico" 894 | 895 | 896 | ///////////////////////////////////////////////////////////////////////////// 897 | // 898 | // PNG 899 | // 900 | 901 | IDB_LOGO PNG "Resources\\glpilogo.png" 902 | 903 | 904 | ///////////////////////////////////////////////////////////////////////////// 905 | // 906 | // String Table 907 | // 908 | 909 | STRINGTABLE 910 | BEGIN 911 | IDS_APP_TITLE "GLPI Agent Monitor" 912 | IDS_GLPINOTIFYERROR "GLPI Agent - Erro" 913 | IDS_GLPINOTIFY "GLPI Agent" 914 | IDS_STATIC_INFO "Informações" 915 | IDS_STATIC_AGENTVER "Versão do agente:" 916 | IDS_STATIC_SERVICESTATUS "Status do serviço:" 917 | IDS_STATIC_STARTTYPE "Tipo de inicialização:" 918 | IDS_ERR_AGENTSETTINGS "Erro ao carregar as configurações do GLPI Agent!\nO agente deverá ser reinstalado." 919 | END 920 | 921 | STRINGTABLE 922 | BEGIN 923 | IDS_LOADING "Carregando..." 924 | IDS_STATIC_AGENTSTATUS "Status do agente" 925 | IDS_FORCEINV "Forçar inventário" 926 | IDS_CLOSE "Fechar" 927 | IDS_ERR_NOTRESPONDING "O agente não está respondendo!" 928 | IDS_ERR_NOTRUNNING "O agente não está em execução!" 929 | IDS_SVCSTART_BOOT "Boot" 930 | IDS_SVCSTART_SYSTEM "Sistema" 931 | IDS_SVCSTART_AUTO "Automático" 932 | IDS_SVCSTART_DELAYEDAUTO "Automático (atraso na inicialização)" 933 | IDS_SVCSTART_MANUAL "Manual" 934 | IDS_SVCSTART_DISABLED "Desativado" 935 | IDS_ERR_UNKSVCSTART "Tipo de inicialização desconhecido!" 936 | IDS_ERR_REGFAIL "Falha ao consultar o registro!" 937 | IDS_ERR_AGENTVERNOTFOUND "Versão do agente não encontrada!" 938 | IDS_ERR_AGENTNOTFOUND "O agente não está instalado!" 939 | END 940 | 941 | STRINGTABLE 942 | BEGIN 943 | IDS_ERR_HTTPDPORT "Erro ao obter a porta HTTP do GLPI Agent!\nO agente deverá ser reinstalado." 944 | IDS_SVC_STOPPED "Parado" 945 | IDS_SVC_RUNNING "Em execução" 946 | IDS_SVC_PAUSED "Em pausa" 947 | IDS_SVC_CONTINUEPENDING "Continuando..." 948 | IDS_SVC_PAUSEPENDING "Pausando..." 949 | IDS_SVC_STARTPENDING "Iniciando..." 950 | IDS_SVC_STOPPENDING "Parando..." 951 | IDS_ERR_SERVICE "Falha ao consultar o serviço!" 952 | IDS_OK "OK" 953 | IDS_ERROR "GLPI Agent Monitor - Erro" 954 | IDS_ERR_FORCEINV_NORESPONSE 955 | "Erro ao forçar o inventário:\nO agente não respondeu à requisição." 956 | IDS_ERR_FORCEINV_NOTALLOWED 957 | "Erro ao forçar o inventário:\nOperação não permitida." 958 | IDS_MSG_FORCEINV_OK "Pedido de inventário enviado com sucesso ao GLPI Agent." 959 | IDS_ERR_AGENTERR "O agente está com um ou mais erros!\nVerifique na janela do GLPI Agent Monitor." 960 | IDS_RMENU_OPEN "Abrir" 961 | END 962 | 963 | STRINGTABLE 964 | BEGIN 965 | IDS_RMENU_FORCE "Forçar inventário" 966 | IDS_RMENU_EXIT "Sair" 967 | IDS_FILE "Arquivo" 968 | IDS_DIR "Diretório" 969 | IDS_ERR_MAINWINDOW "Erro ao criar a janela do GLPI Agent Monitor!" 970 | IDS_RMENU_NEWTICKET "Abrir chamado..." 971 | IDS_ERR_SERVER "Erro ao obter a URL do servidor GLPI!\nO agente deverá ser reinstalado." 972 | IDS_NOTIF_NEWTICKET_TITLE "Uma imagem de sua tela foi capturada" 973 | IDS_NOTIF_NEWTICKET "Pressione CTRL+V no campo ""Descrição"" para anexá-la ao novo chamado." 974 | IDS_NEWTICKET "Abrir chamado..." 975 | IDS_VIEWLOGS "Visualizar logs" 976 | IDS_RMENU_VIEWLOGS "Visualizar logs" 977 | IDS_STARTSVC " Iniciar serviço" 978 | IDS_STOPSVC " Parar serviço" 979 | IDS_RESUMESVC " Continuar serviço" 980 | IDS_WAIT "Aguarde..." 981 | END 982 | 983 | STRINGTABLE 984 | BEGIN 985 | IDS_ERR_SCHANDLE "Erro ao se conectar ao Controlador de Serviços do Windows!" 986 | IDS_ERR_SVCHANDLE "Erro ao abrir o serviço do GLPI Agent!" 987 | IDS_ERR_SVCOPERATION "Erro ao tentar controlar o serviço do GLPI Agent!" 988 | IDS_SETTINGS "Configurações do GLPI Agent Monitor" 989 | IDS_SETTINGS_NEWTICKET_URL "URL da página de abertura de chamados" 990 | IDS_ERR_SAVE_SETTINGS "Erro ao tentar salvar as configurações do GLPI Agent Monitor!" 991 | IDS_CANCEL "Cancelar" 992 | IDS_SAVE "Salvar" 993 | IDS_BTN_SETTINGS " Configurações" 994 | IDS_RMENU_SETTINGS "Configurações" 995 | IDS_SETTINGS_NEWTICKET "Abrir chamado" 996 | IDS_SETTINGS_NEWTICKET_SCREENSHOT 997 | "Habilitar captura de tela ao clicar no botão ""Abrir chamado""" 998 | END 999 | 1000 | #endif // Português (Brasil) resources 1001 | ///////////////////////////////////////////////////////////////////////////// 1002 | 1003 | 1004 | 1005 | #ifndef APSTUDIO_INVOKED 1006 | ///////////////////////////////////////////////////////////////////////////// 1007 | // 1008 | // Generated from the TEXTINCLUDE 3 resource. 1009 | // 1010 | #include "GLPI-AgentMonitor.rc2" 1011 | 1012 | ///////////////////////////////////////////////////////////////////////////// 1013 | #endif // not APSTUDIO_INVOKED 1014 | 1015 | -------------------------------------------------------------------------------- /GLPI-AgentMonitor.rc2: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////// 2 | // Neutro (Padrão do Sistema) resources 3 | 4 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEUSD) 5 | LANGUAGE LANG_NEUTRAL, SUBLANG_SYS_DEFAULT 6 | 7 | ///////////////////////////////////////////////////////////////////////////// 8 | // 9 | // Version 10 | // 11 | 12 | #include "version.h" 13 | 14 | VS_VERSION_INFO VERSIONINFO 15 | #ifdef VI_VERSIONDEF 16 | FILEVERSION VI_VERSIONDEF 17 | PRODUCTVERSION VI_VERSIONDEF 18 | #else 19 | FILEVERSION 1,4,1,0 20 | PRODUCTVERSION 1,4,1,0 21 | #endif 22 | FILEFLAGSMASK 0x3fL 23 | #ifdef _DEBUG 24 | FILEFLAGS 0x1L 25 | #else 26 | FILEFLAGS 0x0L 27 | #endif 28 | FILEOS 0x40004L 29 | FILETYPE 0x1L 30 | FILESUBTYPE 0x0L 31 | BEGIN 32 | BLOCK "StringFileInfo" 33 | BEGIN 34 | BLOCK "000004b0" 35 | BEGIN 36 | VALUE "FileDescription", "GLPI Agent Monitor" 37 | #ifdef VI_VERSIONSTRING 38 | VALUE "FileVersion", VI_VERSIONSTRING 39 | #else 40 | VALUE "FileVersion", "1.4.1.0" 41 | #endif 42 | #ifdef VI_FILENAME 43 | VALUE "InternalName", VI_FILENAME 44 | VALUE "OriginalFilename", VI_FILENAME 45 | #else 46 | VALUE "InternalName", "GLPI-AgentMonitor.exe" 47 | VALUE "OriginalFilename", "GLPI-AgentMonitor.exe" 48 | #endif 49 | #ifdef VI_PRODUCTNAME 50 | VALUE "ProductName", VI_PRODUCTNAME 51 | #else 52 | VALUE "ProductName", "GLPI Agent Monitor" 53 | #endif 54 | #ifdef VI_VERSIONSTRING 55 | VALUE "ProductVersion", VI_VERSIONSTRING 56 | #else 57 | VALUE "ProductVersion", "1.4.1.0" 58 | #endif 59 | END 60 | END 61 | BLOCK "VarFileInfo" 62 | BEGIN 63 | VALUE "Translation", 0x0, 1200 64 | END 65 | END 66 | 67 | #endif // Neutro (Padrão do Sistema) resources 68 | ///////////////////////////////////////////////////////////////////////////// 69 | -------------------------------------------------------------------------------- /GLPI-AgentMonitor.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 16.0 23 | Win32Proj 24 | {669cb802-8cd7-44ac-a4c7-2e5c4bad3152} 25 | FusionMonitorCPP 26 | 10.0 27 | GLPI-AgentMonitor 28 | 29 | 30 | 31 | Application 32 | true 33 | v143 34 | Unicode 35 | 36 | 37 | Application 38 | false 39 | v143 40 | true 41 | Unicode 42 | 43 | 44 | Application 45 | true 46 | v143 47 | Unicode 48 | 49 | 50 | Application 51 | false 52 | true 53 | Unicode 54 | v143 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | true 76 | 77 | 78 | false 79 | 80 | 81 | true 82 | 83 | 84 | false 85 | 86 | 87 | 88 | Level3 89 | true 90 | WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) 91 | true 92 | /utf-8 %(AdditionalOptions) 93 | MultiThreadedDebug 94 | 95 | 96 | Windows 97 | true 98 | 99 | 100 | 0x0416 101 | 102 | 103 | 104 | 105 | Level3 106 | true 107 | true 108 | true 109 | WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) 110 | true 111 | /utf-8 %(AdditionalOptions) 112 | MultiThreaded 113 | 114 | 115 | Windows 116 | true 117 | true 118 | true 119 | true 120 | 121 | 122 | 123 | 124 | Level3 125 | true 126 | _DEBUG;_WINDOWS;%(PreprocessorDefinitions) 127 | true 128 | MultiThreadedDebug 129 | 130 | 131 | Windows 132 | true 133 | 134 | 135 | 136 | 137 | Level3 138 | true 139 | true 140 | true 141 | NDEBUG;_WINDOWS;%(PreprocessorDefinitions) 142 | true 143 | MultiThreaded 144 | 145 | 146 | Windows 147 | true 148 | true 149 | true 150 | true 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GLPI Agent Monitor 2 | 3 | [![GLPI Agent Monitor CI](https://github.com/glpi-project/glpi-agentmonitor/actions/workflows/glpi-agentmonitor-ci.yml/badge.svg)](https://github.com/glpi-project/glpi-agentmonitor/actions/workflows/glpi-agentmonitor-ci.yml) 4 | 5 | ## Description 6 | 7 | GLPI Agent Monitor is a simple monitoring tool for GLPI Agent on Windows. 8 | 9 | It sits on the system tray as the GLPI Agent logo. The logo changes color 10 | from blue to red depending on the Agent status. 11 | - As of now, it will only go red if the Agent service is not running. 12 | 13 | By default, the tool will start minimized to the system tray, but a 14 | window will be opened if you left-click the icon. 15 | 16 | ## Features 17 | 18 | Quickly see details such as: 19 | - Installed GLPI Agent version 20 | - Agent service status 21 | - Service startup type 22 | - Agent current status (from the /status page, updates every 2 sec.) 23 | 24 | You can also: 25 | - Send a "Force inventory" request to the Agent 26 | - Go directly to the "New ticket" page on the configured GLPI server (with a screenshot automatically captured to the clipboard) 27 | - View the Agent logs (with the system default .log viewer) 28 | - Start, stop or resume the service 29 | 30 | For future release features, read the [Changelog](CHANGES). 31 | 32 | ## Releases 33 | 34 | Official releases are provided by the [glpi-project/glpi-agentmonitor](https://github.com/glpi-project/glpi-agentmonitor) fork. 35 | 36 | ## Available languages 37 | 38 | - English (US) 39 | - Portuguese (Brazil) 40 | - Italian (by [Kintaro Oe](https://github.com/kintaro1981)) 41 | - French (by [Guillaume Bougard](https://github.com/g-bougard)) 42 | - Russian (by [Fedorov Nikolay](https://github.com/kofe88)) 43 | - Spanish (by [Luis Giordano](https://github.com/Iruxos) and [Bertu Garangou](https://github.com/bertugarangou)) 44 | - Dutch (by [Jeffrey Jansma](https://github.com/perplexityjeff)) 45 | - Catalan (by [Bertu Garangou](https://github.com/bertugarangou)) 46 | 47 | If you want to translate the project to your language, feel free to fork the [development repository](https://github.com/redddcyclone/glpi-agentmonitor), insert a string table for your language in the `GLPI-AgentMonitor.rc` file (use Visual Studio) and open a pull request with your changes. 48 | 49 | ## Screenshots 50 | 51 | ![Screenshot](screenshot.png) 52 | 53 | ## License 54 | 55 | [![License: GPL v2](https://img.shields.io/badge/License-GPL%20v2-blue.svg)](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html) 56 | 57 | This software is licensed under the terms of GPLv2+, see LICENSE file for 58 | details. 59 | -------------------------------------------------------------------------------- /Resources/glpierr.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glpi-project/glpi-agentmonitor/9399ba836c28226d7e5c58d025883c4a5d4ba986/Resources/glpierr.ico -------------------------------------------------------------------------------- /Resources/glpilogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glpi-project/glpi-agentmonitor/9399ba836c28226d7e5c58d025883c4a5d4ba986/Resources/glpilogo.png -------------------------------------------------------------------------------- /Resources/glpiok.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glpi-project/glpi-agentmonitor/9399ba836c28226d7e5c58d025883c4a5d4ba986/Resources/glpiok.ico -------------------------------------------------------------------------------- /THANKS: -------------------------------------------------------------------------------- 1 | 2 | Feel free to update this file while proposing a pull request on GitHub 3 | 4 | Guillaume Bougard (@g-bougard): main fork maintainer, testing, GH workflows, Agent installer integration, French translation and much more 5 | Leonardo Bernardes (@redddcyclone): Monitor developer 6 | Kintaro Oe (@kintaro1981): Italian translation 7 | Fedorov Nikolay (@kofe88): Russian translation 8 | Luis Giordano (@Iruxos): Spanish translation 9 | Jeffrey Jansma (@perplexityjeff): Dutch translation 10 | Bertu Garangou (@bertugarangou): Catalan and Spanish translation 11 | -------------------------------------------------------------------------------- /framework.h: -------------------------------------------------------------------------------- 1 | // framework.h: system default include files, 2 | // or project-specific include files 3 | // 4 | 5 | #pragma once 6 | 7 | #include "targetver.h" 8 | #define WIN32_LEAN_AND_MEAN // Exclude rarely used Windows header items 9 | // Windows headers 10 | #include 11 | // C runtime headers 12 | #include 13 | #include 14 | #include 15 | #include 16 | -------------------------------------------------------------------------------- /resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Arquivo de inclusão gerado pelo Microsoft Visual C++. 3 | // Usado por GLPI-AgentMonitor.rc 4 | // 5 | #define IDC_BTN_FORCE 101 6 | #define IDC_BTN_NEWTICKET 102 7 | #define IDC_BTN_CLOSE 103 8 | #define IDC_BTN_SETTINGS 104 9 | #define IDI_GLPIOK 105 10 | #define IDR_RMENU 141 11 | #define IDI_GLPIERR 148 12 | #define IDB_LOGO 152 13 | #define IDD_DIALOG2 154 14 | #define IDD_DLG_SETTINGS 154 15 | #define IDS_APP_TITLE 200 16 | #define IDS_GLPINOTIFYERROR 201 17 | #define IDS_GLPINOTIFY 202 18 | #define IDS_STATIC_INFO 203 19 | #define IDS_STATIC_AGENTVER 204 20 | #define IDS_STATIC_SERVICESTATUS 205 21 | #define IDS_STATIC_STARTTYPE 206 22 | #define IDS_ERR_AGENTSETTINGS 207 23 | #define IDS_LOADING 208 24 | #define IDS_STATIC_AGENTSTATUS 209 25 | #define IDS_FORCEINV 210 26 | #define IDS_CLOSE 211 27 | #define IDS_ERR_NOTRESPONDING 212 28 | #define IDS_ERR_NOTRUNNING 213 29 | #define IDS_SVCSTART_BOOT 214 30 | #define IDS_SVCSTART_SYSTEM 215 31 | #define IDS_SVCSTART_AUTO 216 32 | #define IDS_SVCSTART_DELAYEDAUTO 217 33 | #define IDS_SVCSTART_MANUAL 218 34 | #define IDS_SVCSTART_DISABLED 219 35 | #define IDS_ERR_UNKSVCSTART 220 36 | #define IDS_ERR_REGFAIL 221 37 | #define IDS_ERR_AGENTVERNOTFOUND 222 38 | #define IDS_ERR_AGENTNOTFOUND 223 39 | #define IDS_ERR_HTTPDPORT 224 40 | #define IDS_SVC_STOPPED 225 41 | #define IDS_SVC_RUNNING 226 42 | #define IDS_SVC_PAUSED 227 43 | #define IDS_SVC_CONTINUEPENDING 228 44 | #define IDS_SVC_PAUSEPENDING 229 45 | #define IDS_SVC_STARTPENDING 230 46 | #define IDS_SVC_STOPPENDING 231 47 | #define IDS_ERR_SERVICE 232 48 | #define IDS_OK 233 49 | #define IDS_ERROR 234 50 | #define IDS_ERR_FORCEINV_NORESPONSE 235 51 | #define IDS_ERR_FORCEINV_NOTALLOWED 236 52 | #define IDS_MSG_FORCEINV_OK 237 53 | #define IDS_ERR_AGENTERR 238 54 | #define IDS_RMENU_OPEN 239 55 | #define IDS_RMENU_FORCE 240 56 | #define IDS_RMENU_EXIT 241 57 | #define IDS_FILE 242 58 | #define IDS_DIR 243 59 | #define IDS_ERR_MAINWINDOW 244 60 | #define IDS_RMENU_NEWTICKET 245 61 | #define IDS_ERR_SERVER 246 62 | #define IDS_NOTIF_NEWTICKET_TITLE 247 63 | #define IDS_NOTIF_NEWTICKET 248 64 | #define IDS_NEWTICKET 249 65 | #define IDS_VIEWLOGS 250 66 | #define IDS_RMENU_VIEWLOGS 251 67 | #define IDS_STARTSVC 252 68 | #define IDS_STOPSVC 253 69 | #define IDS_RESUMESVC 254 70 | #define IDS_WAIT 255 71 | #define IDS_ERR_SCHANDLE 256 72 | #define IDS_ERR_SVCHANDLE 257 73 | #define IDS_ERR_SVCOPERATION 258 74 | #define IDS_SETTINGS 259 75 | #define IDS_SETTINGS_NEWTICKETURL 260 76 | #define IDS_SETTINGS_NEWTICKET_URL 260 77 | #define IDS_CHECKBOX_NEWTICKET_DEFAULTURL 261 78 | #define IDS_ERR_SAVE_SETTINGS 261 79 | #define IDS_CANCEL 262 80 | #define IDS_SAVE 263 81 | #define IDS_BTN_SETTINGS 264 82 | #define IDS_RMENU_SETTINGS 265 83 | #define IDS_SETTINGS_NEWTICKET 266 84 | #define IDS_SETTINGS_NEWTICKET_SCREENSHOT 267 85 | #define IDC_BTN_VIEWLOGS 400 86 | #define IDD_DIALOG1 401 87 | #define IDD_MAIN 402 88 | #define IDC_VERSION 601 89 | #define IDC_GBMAIN 602 90 | #define IDC_GBSTATUS 603 91 | #define IDC_AGENTSTATUS 604 92 | #define IDC_AGENTVER 605 93 | #define IDC_SERVICESTATUS 606 94 | #define IDC_STARTTYPE 607 95 | #define IDC_PCLOGO 609 96 | #define IDT_UPDSTATUS 610 97 | #define IDT_UPDSVCSTATUS 611 98 | #define IDC_STATIC_AGENTVER 1004 99 | #define IDC_STATIC_SERVICESTATUS 1005 100 | #define IDC_STATIC_STARTTYPE 1006 101 | #define IDC_BTN_STARTSTOPSVC 1009 102 | #define IDC_SETTINGS_EDIT_NEWTICKETURL 1010 103 | #define IDC_SETTINGS_EDIT_NEWTICKET_URL 1010 104 | #define IDC_CHECK1 1011 105 | #define IDC_CHECKBOX_NEWTICKET_DEFAULTURL 1011 106 | #define IDC_SETTINGS_CHECKBOX_NEWTICKET_SCREENSHOT 1011 107 | #define IDC_BTN_CANCEL 1013 108 | #define IDC_SETTINGS_BTN_CANCEL 1013 109 | #define IDC_BTN_SAVE 1014 110 | #define IDC_SETTINGS_BTN_SAVE 1014 111 | #define IDC_SETTINGS_GROUPBOX_NEWTICKET 1015 112 | #define ID_RMENU_OPEN 32760 113 | #define ID_RMENU_FORCE 32761 114 | #define ID_RMENU_EXIT 32762 115 | #define ID_RMENU_NEWTICKET 32781 116 | #define ID_RMENU_VIEWLOGS 32782 117 | #define ID_GLPIAGENT_IDS 32783 118 | #define ID_RMENU_SETTINGS 32784 119 | #define IDC_STATIC -1 120 | #define IDC_STATIC_TITLE -1 121 | #define IDC_GROUPBOX_NEWTICKETURL -1 122 | #define IDC_SETTINGS_TEXT_NEWTICKET_URL -1 123 | 124 | // Next default values for new objects 125 | // 126 | #ifdef APSTUDIO_INVOKED 127 | #ifndef APSTUDIO_READONLY_SYMBOLS 128 | #define _APS_NO_MFC 1 129 | #define _APS_NEXT_RESOURCE_VALUE 155 130 | #define _APS_NEXT_COMMAND_VALUE 32785 131 | #define _APS_NEXT_CONTROL_VALUE 1016 132 | #define _APS_NEXT_SYMED_VALUE 110 133 | #endif 134 | #endif 135 | -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glpi-project/glpi-agentmonitor/9399ba836c28226d7e5c58d025883c4a5d4ba986/screenshot.png -------------------------------------------------------------------------------- /targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // // Including SDKDDKVer.h will define Windows platform to the most recently available. 4 | // If you wish to compile your app for a previous Windows platform, include WinSDKVer.h and 5 | // define the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h 6 | #include 7 | -------------------------------------------------------------------------------- /version.h: -------------------------------------------------------------------------------- 1 | // File overridden during GH Actions workflow run 2 | #define VI_FILENAME "GLPI-AgentMonitor.exe" 3 | #define VI_VERSIONDEF 1,4,1,0 4 | #define VI_VERSIONSTRING "1.4.1.0" 5 | #define VI_PRODUCTNAME "GLPI Agent Monitor" 6 | --------------------------------------------------------------------------------