Replies: 6 comments 7 replies
-
|
Alrighty, there's two bits here:
|
Beta Was this translation helpful? Give feedback.
-
|
I don't want to mess with it; I only want to use it to position GUI thingies nicely with respect to the user interface. IIRC, others wanted to do the same thing. You can get that HWND anyway. It's just the window of a user interface, hardly the sort of thing Windows keeps a secret. I don't see the big deal in making getting it easy. |
Beta Was this translation helpful? Give feedback.
-
|
@zadjii-msft one reason we might want to get the window handle is to hand it over to the WAM broker. In my neck of the woods this is the only approved way to authenticate console apps. Their official documentation linked above recommends the "not recommended" solution of using |
Beta Was this translation helpful? Give feedback.
-
|
Hmmm! I may have spoke too soon. Why does this function return nullptr when I'm in the debug tap? |
Beta Was this translation helpful? Give feedback.
-
|
What good would it be for production? I'm using it for debugging. |
Beta Was this translation helpful? Give feedback.
-
|
Can you say why my function returns nullptr when TCC is in the debug tap? |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
I replied to "DISCUSSION: Is my app running in Terminal? #7434" but that reply isn't showing up anywhere (excuse me if I'm impatient).
With specific regard to a shell wanting to know where the Windows Terminal user interface is ...
I revisit this every now and then. I'm using the process ID of GetConsoleWindow() and a Toolhelp32Snapshot to find the parent process of OpenConsole.exe. Then I use EnumWindows() to find a CASCADIA_HOSTING_WINDOW_CLASS window belonging to that parent. It works, at least to my satisfaction, but it's a bit cumbersome.
Could you make the handle of the CASCADIA_HOSTING_WINDOW_CLASS window more readily available? One thought is to put it in the value of the WT_SESSION environment variable (along with the GUID which is (AFAICT) useless to the shell.
WT_SESSION=69f813f0-06ef-49d5-a64a-95359e0305c8, 0x303C0A shell might be looking for the existence of that variable anyway. If it's value had more useful information in it, that would be great.
Am I wrong about the GUID? Is it of any value to the shell (or to anyone)?
Beta Was this translation helpful? Give feedback.
All reactions