@@ -366,15 +366,18 @@ void ExecuteQuery(void) {
366366 int i , inStr = 0 , inCmt = 0 ;
367367
368368 if (fullLen == 0 ) {
369+ SendMessageW (g_hwndStatus , SB_SETTEXTW , 1 , (LPARAM )L"Nothing to execute" );
369370 EnableMenuItem (g_hMenu , IDM_EXECUTE , MF_ENABLED );
370371 SendMessage (g_hwndCB , TB_ENABLEBUTTON , IDM_EXECUTE , TRUE);
372+ SendMessage (g_hwndCB , TB_ENABLEBUTTON , IDM_STOP , FALSE);
371373 return ;
372374 }
373375
374376 full = (wchar_t * )LocalAlloc (LMEM_FIXED , (fullLen + 1 ) * sizeof (wchar_t ));
375377 if (!full ) {
376378 EnableMenuItem (g_hMenu , IDM_EXECUTE , MF_ENABLED );
377379 SendMessage (g_hwndCB , TB_ENABLEBUTTON , IDM_EXECUTE , TRUE);
380+ SendMessage (g_hwndCB , TB_ENABLEBUTTON , IDM_STOP , FALSE);
378381 return ;
379382 }
380383 GetWindowTextW (g_hwndQuery , full , fullLen + 1 );
@@ -410,6 +413,9 @@ void ExecuteQuery(void) {
410413 LocalFree (full );
411414 if (wsql ) LocalFree (wsql );
412415 if (sql ) LocalFree (sql );
416+ EnableMenuItem (g_hMenu , IDM_EXECUTE , MF_ENABLED );
417+ SendMessage (g_hwndCB , TB_ENABLEBUTTON , IDM_EXECUTE , TRUE);
418+ SendMessage (g_hwndCB , TB_ENABLEBUTTON , IDM_STOP , FALSE);
413419 return ;
414420 }
415421 for (i = 0 ; i < len ; i ++ ) wsql [i ] = full [stmtStart + i ];
@@ -421,6 +427,9 @@ void ExecuteQuery(void) {
421427 len = GetWindowTextLengthW (g_hwndQuery );
422428 if (len == 0 || g_showingHint ) {
423429 SendMessageW (g_hwndStatus , SB_SETTEXTW , 1 , (LPARAM )L"Nothing to execute" );
430+ EnableMenuItem (g_hMenu , IDM_EXECUTE , MF_ENABLED );
431+ SendMessage (g_hwndCB , TB_ENABLEBUTTON , IDM_EXECUTE , TRUE);
432+ SendMessage (g_hwndCB , TB_ENABLEBUTTON , IDM_STOP , FALSE);
424433 return ;
425434 }
426435
0 commit comments