@@ -275,10 +275,17 @@ void ExecuteSQL(const char *sql) {
275275 sqlite_progress_handler (g_db , 0 , NULL , NULL );
276276
277277 /* Switch to results */
278+ if (g_gridView && g_hwndGrid )
279+ SendMessage (g_hwndGrid , WM_SETREDRAW , FALSE, 0 );
278280 SwitchView (1 );
279281 SendMessage (g_hwndCB , TB_CHECKBUTTON , IDM_VIEWQUERY , FALSE);
280282 SendMessage (g_hwndCB , TB_CHECKBUTTON , IDM_VIEWRESULT , TRUE);
281283 SendMessage (g_hwndCB , TB_CHECKBUTTON , IDM_VIEWSCHEMA , FALSE);
284+ if (g_gridView ) PopulateGrid ();
285+ if (g_gridView && g_hwndGrid ) {
286+ SendMessage (g_hwndGrid , WM_SETREDRAW , TRUE, 0 );
287+ InvalidateRect (g_hwndGrid , NULL , TRUE);
288+ }
282289}
283290
284291void ExecuteQuery (void ) {
@@ -613,10 +620,18 @@ void ExecuteQuery(void) {
613620
614621 /* Switch to results view (unless error - stay in query to show cursor) */
615622 if (!hadError ) {
623+ /* Suppress redraw during view switch to avoid flicker */
624+ if (g_gridView && g_hwndGrid )
625+ SendMessage (g_hwndGrid , WM_SETREDRAW , FALSE, 0 );
616626 SwitchView (1 );
617627 SendMessage (g_hwndCB , TB_CHECKBUTTON , IDM_VIEWQUERY , FALSE);
618628 SendMessage (g_hwndCB , TB_CHECKBUTTON , IDM_VIEWRESULT , TRUE);
619629 SendMessage (g_hwndCB , TB_CHECKBUTTON , IDM_VIEWSCHEMA , FALSE);
630+ if (g_gridView ) PopulateGrid ();
631+ if (g_gridView && g_hwndGrid ) {
632+ SendMessage (g_hwndGrid , WM_SETREDRAW , TRUE, 0 );
633+ InvalidateRect (g_hwndGrid , NULL , TRUE);
634+ }
620635 RefreshSchema (); /* Update schema in case CREATE/DROP was executed */
621636 }
622637}
0 commit comments