Closed sirAndros closed 3 years ago
You can query all windows with:
Find-WindowHandle *
With this you can pick the window you need.
Greetings
Markus
Indeed, if window already has been created. I describe situation when application already started, but does not have any window until some event (click by tray icon, e.g.)
Hello,
I have to admit It took some time for me to understand your request. I guess this could work, I will make some attempts. But it seems to be some coding work since we need a process handle to call.
Greetings
Markus
Thank you!
Hello,
I made some tests and saw this does not work like hoped. The WinAPI function GetApplicationUserModelId returns an error _APPMODEL_ERROR_NOAPPLICATION for every non modern app.
A fast way to see this is compiling the C++ example on the MSDN web page.
Greetings
Markus
Hello, Thank you very much for investigation! It's sad, but as we have workaround it's not terminal. Thanks again for your time!
Closed since no response for over 2 weeks
Hello! Unfortunately, some applications create windows on demand and to pin them you should write watcher to query their windows. I found, that it's possible to get
AppIds
for process: MSDN. I concern that for some (may be most) apps it may not work, because not all apps are modern and not all Win32 app developers explicitly set app id, but its the same for application windows, used in current implementation ofPin-Application
cmdlet, I think. I will create pull request if I found enough time to test it by myself, but I think its not a near future. But if you have some free time - it will be great if you could implement that idea. Thank you!