You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm revisiting an old problem and since I can't figure it out, I'm asking the experts.
My shell (TCC) misbehaves in that it makes GetConsoleWindow() the foreground window after displaying a GUI dialog (I would rather WindowsTerminal become the foreground window). I work around that (in a plugin DLL) with a WinEventHook targeting EVENT_SYSTEM_FOREGROUND. The SetForegroundWindow() is successful and WT has keyboard input focus, but I get the "busy" mouse cursor (spinning blue wheel) which persists until I use the mouse (which includes using the snipping tool). I can get rid of it with a mouse-click kludge. My hook process looks like this (including a bit of debugging output).
// EVENT_SYSTEM_FOREGROUND
VOID CALLBACK hookproc2(HWINEVENTHOOK hWinEventHook, DWORD event, HWND hwnd, LONG idObject, LONG idChild, DWORD dwEventThread, DWORD dwmsEventTime)
{
if ( hwnd == g.hWndConsole ) // PseudoConsoleWindow
{
BOOL b = SetForegroundWindow(g.hWndCascadia); // succeeds but still get busy pointer, why?
if ( b ) Printf(L"SetForegroundWindow was successful\r\n");
if ( MouseInWT() )
{
ClickMouse(); // left down/up; this gets rid of the "busy" mouse pointer
}
}
}
When I open /close TCC's options dialog (class #32770) while monitoring the foreground window, I see this (and the busy cursor). Note that if the mouse pointer is not in WT when I dismiss the dialog, I do not get the busy cursor and all's well.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm revisiting an old problem and since I can't figure it out, I'm asking the experts.
My shell (TCC) misbehaves in that it makes GetConsoleWindow() the foreground window after displaying a GUI dialog (I would rather WindowsTerminal become the foreground window). I work around that (in a plugin DLL) with a WinEventHook targeting EVENT_SYSTEM_FOREGROUND. The SetForegroundWindow() is successful and WT has keyboard input focus, but I get the "busy" mouse cursor (spinning blue wheel) which persists until I use the mouse (which includes using the snipping tool). I can get rid of it with a mouse-click kludge. My hook process looks like this (including a bit of debugging output).
When I open /close TCC's options dialog (class #32770) while monitoring the foreground window, I see this (and the busy cursor). Note that if the mouse pointer is not in WT when I dismiss the dialog, I do not get the busy cursor and all's well.
Any ideas on why I get the busy cursor and how to avoid it? Thanks!
Beta Was this translation helpful? Give feedback.
All reactions