When I start my app, I have one CXTPToolBar that I create. I am having display issues with it. If another app is activated while my app is coming up, CXTPToolBar::OnFloatStatus will not call ShowWindow. I have to click to activate my app, activate another app and activate my app again ...
Doing so will eventually get the code in OnFloatStatus to get to and then past the IsTopParentActive call and make the ShowWindow call in that method.
IsTopParentActive calls the OS GetForegroundWindow. Of course when I'm debugging, that's Visual Studio. If I am not debugging but for any reason I have, or am switched, to another app, the OS call returns that window (Teams, Outlook, Outlook notification window ...).
The only way I can reliably get the toolbar to show up is to do nothing while my app is loading and hope nothing else causes another app to activate (like Outlook notification window telling me there is a meeting or task to perform).
Also, I have three monitors and the last position when I am floating is only "viable" when I move the toolbar to the main monitor before closing the app or to position it on the monitor to the left of my main monitor. If I put it to the right of my main monitor, when it displays, it is partially on the main monitor - the origin has shifted. Doesn't matter how far I push it to the right on the right side monitor. It always shows back up incorrectly. The y location seems reliable, but not the x of the origin.
I used the snipping tool in Windows to grab the below image. The left edge of the toolbar when I started the app is on the center/main monitor displayed over the VS sidebar ("Pred" and file open) while the rest is on the right monitor. I previously did an exit with the toolbar way over on the right side of the right monitor but as the image shows, it has moved so its origin is on the main monitor. I'm still looking at why that happens.
|