@@ -29,3 +29,35 @@ void FlushOutput(void) {
2929 LocalFree (wz );
3030 }
3131}
32+
33+ void ShowResultMessage (LPCWSTR msg , int clear ) {
34+ if (clear ) {
35+ g_lastResultRows = 0 ;
36+ SetWindowTextW (g_hwndResult , msg );
37+ } else {
38+ /* Append to existing text */
39+ int existingLen = GetWindowTextLengthW (g_hwndResult );
40+ int msgLen = lstrlenW (msg );
41+ wchar_t * buf = (wchar_t * )LocalAlloc (LMEM_FIXED , (existingLen + msgLen + 3 ) * sizeof (wchar_t ));
42+ if (buf ) {
43+ GetWindowTextW (g_hwndResult , buf , existingLen + 1 );
44+ if (existingLen > 0 ) {
45+ buf [existingLen ++ ] = '\r' ;
46+ buf [existingLen ++ ] = '\n' ;
47+ }
48+ lstrcpyW (buf + existingLen , msg );
49+ SetWindowTextW (g_hwndResult , buf );
50+ LocalFree (buf );
51+ }
52+ }
53+ /* Switch to text results view */
54+ SwitchView (VIEW_RESULT );
55+ SendMessage (g_hwndCB , TB_CHECKBUTTON , IDM_VIEWQUERY , FALSE);
56+ SendMessage (g_hwndCB , TB_CHECKBUTTON , IDM_VIEWRESULT , TRUE);
57+ SendMessage (g_hwndCB , TB_CHECKBUTTON , IDM_VIEWSCHEMA , FALSE);
58+ if (g_gridView && g_hwndGrid ) {
59+ ShowWindow (g_hwndGrid , SW_HIDE );
60+ ShowWindow (g_hwndResult , SW_SHOW );
61+ }
62+ SendMessage (g_hwndCB , TB_ENABLEBUTTON , IDM_EXECATCURSOR , FALSE);
63+ }
0 commit comments