Author |
Topic |
|
Guillaume
15 Posts |
Posted - 08/14/2017 : 05:58:42
|
I have just stumbled upon this issue: acNextApplication() doesn't do anything anymore. I have tried a new gesture with the command, but still no go.
It does seem to focus on something else, but almost every time, there is not a single window popping up. If I manually MINIMALIZE an application, only then acNextApplication() will restore and focus that window.
It seems like it's focusing a non-existing window or so? There were no other applications running.
acPreviousApplication() works fine, though.
I'm on W10 x64 CU. |
Edited by - Guillaume on 08/14/2017 06:05:39 |
|
Rob
USA
2615 Posts |
Posted - 08/15/2017 : 07:14:56
|
I'm honestly not surprised. That functionality is fantastically challenging to write and have work as expected every time. There are so many conditions and different types of programs written in different ways that make it challenging. However, I will state that it was a very early function as I was starting out writing S+, so it probably wasn't the most robust.
When I have the time, which may be later this year or early next, I'm hoping to get back to writing the new version of S+, which is a complete rewrite...and I'll be revisiting most if not all of the actions and their logic.
Here are the list of conditions it currently has to try to filter on to determine if a window is a visible, top-level window. I'm wondering if you have some hidden window from an app that sits on top and meets the criteria, so it's always trying to activate it. It does this based on the Z order of the windows returned via the EnumWindows API, it's really annoying and at many points I just decided it was "good enough" than spend any more time trying to make it perfect. But like I said, this was years ago and there may be better ways of approaching this which I will examine when I work on the rewrite of S+.if ( (( windowStyle & WS_VISIBLE ) //the window is visible
&& ( (windowStyle & WS_POPUP) == 0
|| (windowExtStyle & WS_EX_NOREDIRECTIONBITMAP) &&
(windowExtStyle & WS_EX_TOPMOST) != WS_EX_TOPMOST) //the window is not a popup or is a metro app
&& ( GetWindow(hWndEnum,GW_OWNER) == NULL ) //There is no owner for this window
//The rect for the window (its size) isn't empty (it actually occupies a visible area) and is not minimized
&& ( !(IsRectEmpty(&hwndRt) && !IsIconic(hWndEnum)))
&& ( IsWindowEnabled(hWndEnum)==TRUE //window is not disabled
#ifdef SP_WIN8_CHECKS
|| bIsImmersive //window is immersive (Win8 app)
#endif
) //The window is enabled OR it is a Metro window
&& ( hWndEnum != hWndServer ) //The window is NOT the S+ gesture draw window
&& ( (windowExtStyle & WS_EX_TOOLWINDOW) == 0 ) //The window is NOT a tool window
&& ( (windowStyle & WS_CHILDWINDOW) == 0) //The window is NOT a child window
&& ( GetWindowText((HWND)hWndEnum, szTitle, sizeof(szTitle)) > 0) //The window has some text/caption
)
||
(
(windowStyle & WS_VISIBLE) //the window is visible
&&
(windowExtStyle & WS_EX_APPWINDOW) //The window is an appwindow
)
){//do stuff here...} |
|
|
Guillaume
15 Posts |
Posted - 08/15/2017 : 15:44:24
|
Oof, I can relate: from my experience with AutoHotkey and Style/ExStyle, it's always a mess to work with.
As I closed all user apps, even the ones without any window or tray icon, save for two Notepads, and the problem still occurred, I guess it will remain a mystery.
But then again, acPreviousApplication() shouldn't be that different, and that one works perfectly. |
Edited by - Guillaume on 08/15/2017 15:46:48 |
|
|
Rob
USA
2615 Posts |
Posted - 08/15/2017 : 21:30:32
|
Previous application is easy, it's just the first one with a Z order less than whatever is active, Next is, for some damn reason, a lot more complicated. I don't know, man, I just remember the frustration!
Once a window is active, it's on top, the next one is not quite so clear, as the window below the active is the previous, so it's like you have to go to the bottom of the stack...but that's not so simple either, for some reason, maybe the bottom of the stack isn't really the "next" application, but the one that was below the previous one?! |
|
|
Rob
USA
2615 Posts |
Posted - 08/15/2017 : 21:37:14
|
Also, I don't use that function, in fact, I actually use very few, lol.
So it's quite possible that it's been around for a while, like since Windows 10. I just got back from a concert, and am in no condition to examine...but it's something I'll definitely revisit. |
|
|
Guillaume
15 Posts |
Posted - 08/17/2017 : 06:38:57
|
Sorry to let you relive the frustration man, not my intention ;-)
What concert was it? :-) |
|
|
Rob
USA
2615 Posts |
Posted - 08/17/2017 : 06:51:39
|
Counting Crows and Matchbox 20, was a good show! Counting Crows is my wife's favorite band since, forever, and it's her birthday today...so it was her present :-)
Got the Meet and Greet package, so pictures with the band and autographed lyric sheets; she was pretty ecstatic. |
|
|
Guillaume
15 Posts |
Posted - 08/18/2017 : 07:47:33
|
Congrats! I've listened quite a bit to Counting Crows way back in '03. Sounds like a great present! :) |
|
|
|
Topic |
|
|
|