commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1814157 - in /commons/proper/daemon/trunk/src/native/windows: apps/prunmgr/prunmgr.c include/gui.h src/gui.c
Date Fri, 03 Nov 2017 10:19:36 GMT
Author: markt
Date: Fri Nov  3 10:19:35 2017
New Revision: 1814157

URL: http://svn.apache.org/viewvc?rev=1814157&view=rev
Log:
Unicode clean-up. apxLoadResource

Modified:
    commons/proper/daemon/trunk/src/native/windows/apps/prunmgr/prunmgr.c
    commons/proper/daemon/trunk/src/native/windows/include/gui.h
    commons/proper/daemon/trunk/src/native/windows/src/gui.c

Modified: commons/proper/daemon/trunk/src/native/windows/apps/prunmgr/prunmgr.c
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/native/windows/apps/prunmgr/prunmgr.c?rev=1814157&r1=1814156&r2=1814157&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/native/windows/apps/prunmgr/prunmgr.c (original)
+++ commons/proper/daemon/trunk/src/native/windows/apps/prunmgr/prunmgr.c Fri Nov  3 10:19:35
2017
@@ -638,25 +638,25 @@ LRESULT CALLBACK __generalProperty(HWND
                     }
                 break;
                 case IDC_PPSGSTART:
-                    apxProgressBox(hDlg, apxLoadResource(IDS_HSSTART, 0),
+                    apxProgressBox(hDlg, apxLoadResourceW(IDS_HSSTART, 0),
                                    _currentEntry->lpConfig->lpDisplayName,
                                    __startServiceCallback, NULL);
                     __generalPropertyRefresh(hDlg);
                 break;
                 case IDC_PPSGSTOP:
-                    apxProgressBox(hDlg, apxLoadResource(IDS_HSSTOP, 0),
+                    apxProgressBox(hDlg, apxLoadResourceW(IDS_HSSTOP, 0),
                                    _currentEntry->lpConfig->lpDisplayName,
                                    __stopServiceCallback, NULL);
                     __generalPropertyRefresh(hDlg);
                 break;
                 case IDC_PPSGPAUSE:
-                    apxProgressBox(hDlg, apxLoadResource(IDS_HSPAUSE, 0),
+                    apxProgressBox(hDlg, apxLoadResourceW(IDS_HSPAUSE, 0),
                                    _currentEntry->lpConfig->lpDisplayName,
                                    __pauseServiceCallback, NULL);
                     __generalPropertyRefresh(hDlg);
                 break;
                 case IDC_PPSGRESTART:
-                    apxProgressBox(hDlg, apxLoadResource(IDS_HSRESTART, 0),
+                    apxProgressBox(hDlg, apxLoadResourceW(IDS_HSRESTART, 0),
                                    _currentEntry->lpConfig->lpDisplayName,
                                    __restartServiceCallback, NULL);
                     __generalPropertyRefresh(hDlg);
@@ -1520,7 +1520,7 @@ LRESULT CALLBACK MainWndProc(HWND hWnd,
                 }
                 else {
                     apxManageTryIconA(hWnd, NIM_ADD, NULL,
-                                      apxLoadResourceA(IDS_APPLICATION, 0),
+                                      apxLoadResourceW(IDS_APPLICATION, 0),
                                       NULL);
                 }
             }
@@ -1541,25 +1541,25 @@ LRESULT CALLBACK MainWndProc(HWND hWnd,
                 break;
                 case IDM_TM_START:
                     if (!_propertyOpened)
-                        apxProgressBox(hWnd, apxLoadResource(IDS_HSSTART, 0),
+                        apxProgressBox(hWnd, apxLoadResourceW(IDS_HSSTART, 0),
                                        _currentEntry->lpConfig->lpDisplayName,
                                        __startServiceCallback, NULL);
                 break;
                 case IDM_TM_STOP:
                     if (!_propertyOpened)
-                        apxProgressBox(hWnd, apxLoadResource(IDS_HSSTOP, 0),
+                        apxProgressBox(hWnd, apxLoadResourceW(IDS_HSSTOP, 0),
                                        _currentEntry->lpConfig->lpDisplayName,
                                        __stopServiceCallback, NULL);
                 break;
                 case IDM_TM_PAUSE:
                     if (!_propertyOpened)
-                        apxProgressBox(hWnd, apxLoadResource(IDS_HSPAUSE, 0),
+                        apxProgressBox(hWnd, apxLoadResourceW(IDS_HSPAUSE, 0),
                                        _currentEntry->lpConfig->lpDisplayName,
                                        __pauseServiceCallback, NULL);
                 break;
                 case IDM_TM_RESTART:
                     if (!_propertyOpened)
-                        apxProgressBox(hWnd, apxLoadResource(IDS_HSRESTART, 0),
+                        apxProgressBox(hWnd, apxLoadResourceW(IDS_HSRESTART, 0),
                                        _currentEntry->lpConfig->lpDisplayName,
                                        __restartServiceCallback, NULL);
                 break;
@@ -1673,7 +1673,7 @@ int WINAPI WinMain(HINSTANCE hInstance,
         /* Skip sytem error message */
         SetLastError(ERROR_SUCCESS);
         apxDisplayError(TRUE, NULL, 0,
-                        apxLoadResourceA(IDS_ERRORCMD, 0),
+                        apxLoadResourceW(IDS_ERRORCMD, 0),
                         lpCmdLine);
         goto cleanup;
     }
@@ -1742,14 +1742,14 @@ int WINAPI WinMain(HINSTANCE hInstance,
                 /* Skip sytem error message */
                 SetLastError(ERROR_SUCCESS);
                 if (!quiet)
-                    apxDisplayError(TRUE, NULL, 0, apxLoadResourceA(IDS_ALREAY_RUNING, 0),
+                    apxDisplayError(TRUE, NULL, 0, apxLoadResourceW(IDS_ALREAY_RUNING, 0),
                                     lpCmdline->szApplication);
             }
             goto cleanup;
         }
     }
     hRegistry = apxCreateRegistryW(hPool, KEY_ALL_ACCESS, NULL,
-                                  apxLoadResource(IDS_APPLICATION, 0),
+                                  apxLoadResourceW(IDS_APPLICATION, 0),
                                   APXREG_USER);
     loadConfiguration();
     hRegserv = apxCreateRegistryW(hPool, KEY_READ | KEY_WRITE | KREG_WOW6432,
@@ -1759,14 +1759,14 @@ int WINAPI WinMain(HINSTANCE hInstance,
 
     if (IS_INVALID_HANDLE(hRegserv)) {
         if (!quiet)
-            apxDisplayError(TRUE, NULL, 0, apxLoadResourceA(IDS_ERRSREG, 0));
+            apxDisplayError(TRUE, NULL, 0, apxLoadResourceW(IDS_ERRSREG, 0));
         return FALSE;
     }
     isManagerRunning = TRUE;
     CreateThread(NULL, 0, refreshThread, NULL, 0, NULL);
     /* Create main invisible window */
     _gui_store->hMainWnd = CreateWindow(_gui_store->szWndClass,
-                                        apxLoadResource(IDS_APPLICATION, 0),
+                                        apxLoadResourceW(IDS_APPLICATION, 0),
                                         0, 0, 0, 0, 0,
                                         NULL, NULL,
                                         _gui_store->hInstance,

Modified: commons/proper/daemon/trunk/src/native/windows/include/gui.h
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/native/windows/include/gui.h?rev=1814157&r1=1814156&r2=1814157&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/native/windows/include/gui.h (original)
+++ commons/proper/daemon/trunk/src/native/windows/include/gui.h Fri Nov  3 10:19:35 2017
@@ -120,7 +120,6 @@ LPAPXGUISTORE apxGuiInitialize(WNDPROC l
 
 BOOL        apxCenterWindow(HWND hwndChild, HWND hwndParent);
 
-LPSTR       apxLoadResourceA(UINT wID, UINT nBuf);
 LPWSTR      apxLoadResourceW(UINT wID, UINT nBuf);
 
 
@@ -132,11 +131,6 @@ void        apxManageTryIconA(HWND hWnd,
                               LPCSTR szInfo, HICON hIcon);
 void        apxManageTryIconW(HWND hWnd, DWORD dwMessage, LPCWSTR szInfoTitle,
                               LPCWSTR szInfo, HICON hIcon);
-#ifdef _UNICODE
-#define apxLoadResource apxLoadResourceW
-#else
-#define apxLoadResource apxLoadResourceA
-#endif
 
 void        apxAboutBox(HWND hWnd);
 int         apxProgressBox(HWND hWnd, LPCTSTR szHeader,

Modified: commons/proper/daemon/trunk/src/native/windows/src/gui.c
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/native/windows/src/gui.c?rev=1814157&r1=1814156&r2=1814157&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/native/windows/src/gui.c (original)
+++ commons/proper/daemon/trunk/src/native/windows/src/gui.c Fri Nov  3 10:19:35 2017
@@ -200,18 +200,6 @@ BOOL apxCenterWindow(HWND hwndChild, HWN
  * the string must be used before this call is made a second time.
  */
 
-LPSTR apxLoadResourceA(UINT wID, UINT nBuf)
-
-{
-    static CHAR szBuf[4][SIZ_BUFLEN];
-    if (nBuf > 4)
-        return "";
-    if (LoadStringA(_st_sys_gui.hInstance,wID ,szBuf[nBuf], SIZ_BUFMAX) > 0)
-        return szBuf[nBuf];
-    else
-        return "";
-}
-
 LPWSTR apxLoadResourceW(UINT wID, UINT nBuf)
 
 {
@@ -347,10 +335,10 @@ static void __apxShellAbout(HWND hWnd)
     TCHAR szApplication[512];
 
     wsprintf(szApplication , TEXT("About - %s#Windows"), 
-             apxLoadResource(IDS_APPLICATION, 0));
+             apxLoadResourceW(IDS_APPLICATION, 0));
 
     ShellAbout(hWnd, szApplication,
-               apxLoadResource(IDS_APPDESCRIPTION, 1),
+               apxLoadResourceW(IDS_APPDESCRIPTION, 1),
                _st_sys_gui.hIconHg);
 }
 
@@ -374,7 +362,7 @@ static LRESULT CALLBACK __apxAboutDlgPro
             szTxt = (LPSTR)LockResource(hGlob);
             
             SendMessageA(hRich, WM_SETTEXT, 0, (LPARAM)szTxt);
-            SetDlgItemText(hDlg, IDC_ABOUTAPP, apxLoadResource(IDS_APPFULLNAME, 0));
+            SetDlgItemText(hDlg, IDC_ABOUTAPP, apxLoadResourceW(IDS_APPFULLNAME, 0));
             ptScroll.x = 0;
             ptScroll.y = 0;
             return TRUE;



Mime
View raw message