@@ -32,6 +32,13 @@ SingleInstanceApplication g_singleInstanceApplication;
3232wchar_t * g_singleInstanceApplicationGuid = 0 ;
3333wchar_t g_windowClassName[256 ] = L" " ;
3434HINSTANCE g_hInstance = 0 ;
35+
36+ extern std::map<HWND, bool > g_isBrowserLoading; // client_handler.cpp
37+ // Default cursor
38+ HCURSOR g_arrowCursor = 0 ;
39+ // Standard arrow and small hourglass
40+ HCURSOR g_appStartingCursor = 0 ;
41+
3542extern std::map<HWND, BrowserWindow*> g_browserWindows; // browser_window.cpp
3643std::string g_cgiEnvironmentFromArgv = " " ;
3744
@@ -160,9 +167,42 @@ LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam,
160167 }
161168 return DefWindowProc (hwnd, uMsg, wParam, lParam);
162169}
170+
171+ void CALLBACK CheckMousePointerTimer (HWND hwnd, UINT uMsg, UINT timerId, DWORD dwTime)
172+ {
173+ HWND activeHwnd = GetActiveWindow ();
174+ if (!activeHwnd) {
175+ return ;
176+ }
177+ BrowserWindow* browserWindow = GetBrowserWindow (activeHwnd);
178+ if (!browserWindow) {
179+ return ;
180+ }
181+ std::map<HWND, bool >::iterator it;
182+ it = g_isBrowserLoading.find (browserWindow->GetWindowHandle ());
183+ if (it != g_isBrowserLoading.end ()) {
184+ bool isLoading = it->second ;
185+ if (isLoading && GetCursor () == g_arrowCursor) {
186+ SetCursor (g_appStartingCursor);
187+ } else if (!isLoading && GetCursor () == g_appStartingCursor) {
188+ SetCursor (g_arrowCursor);
189+ }
190+ }
191+ }
192+
163193int WINAPI wWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
164194 LPTSTR lpstrCmdLine, int nCmdShow) {
165195 g_hInstance = hInstance;
196+
197+ // Mouse cursor indicator during loading of a web page
198+ g_arrowCursor = (HCURSOR) LoadImage (
199+ 0 , MAKEINTRESOURCE (IDC_ARROW), IMAGE_CURSOR, 0 , 0 ,
200+ LR_DEFAULTCOLOR | LR_DEFAULTSIZE | LR_SHARED);
201+ g_appStartingCursor = (HCURSOR) LoadImage (
202+ 0 , MAKEINTRESOURCE (IDC_APPSTARTING), IMAGE_CURSOR, 0 , 0 ,
203+ LR_DEFAULTCOLOR | LR_DEFAULTSIZE | LR_SHARED);
204+ SetTimer (NULL , 0 , 100 , (TIMERPROC)&CheckMousePointerTimer);
205+
166206 json_value* appSettings = GetApplicationSettings ();
167207 if (GetApplicationSettingsError ().length ()) {
168208 std::string error = GetApplicationSettingsError ();
0 commit comments