The alternative window enumeration method has already made it into the latest release candidate of Shutter v4.
You can download it here:
https://www.den4b.com/download/shutter/alpha
Please give it a try, but note that it has just undergone a migration to a completely new development environment, so it might have few kinks.
]]>Then I have used your command line enum tool:
enum1: shows all windows but didn't finished (no command prompt after all windows are listed!).
enum2-4: list the same windows and then the command prompt.
enum 5: list the same windows, but without its title names (only the numbers).
enum 6: list more windows, but also without any window titles.
I have tested it also with my autoit script and this has worked at the same time (while reader_sl.exe process was running and Shutter was freezed). It seems to be, that autoit uses one of the enums 2-4.
Edit: If I kill the reader_sl.exe process while shutter is running and freezed by the dropdown menu of the "close window" action, it works immediately and shows all open windows.
]]>It is a command line tool which tests several different window enumeration sequences.
Usage: TestEnumWindows.exe [action]
Actions:
enum1 = IsWindowVisible & GetWindowLong & SendMessageA(WM_GETTEXT)
enum2 = IsWindowVisible -> GetWindowLong -> SendMessageW(WM_GETTEXT)
enum3 = IsWindowVisible -> GetWindowLong -> GetWindowTextW
enum4 = IsWindowVisible -> GetWindowLong -> SendMessageTimeoutW(WM_GETTEXT)
enum5 = IsWindowVisible -> GetWindowLong
enum6 = IsWindowVisible
You need to get to a moment when Shutter begins to freeze, and then run this tool to test how each enumeration sequence performs.
You will need to run it from the command line, i.e. "TestEnumWindows.exe enum1", "TestEnumWindows.exe enum2", and so on.
Method "enum1" is what Shutter 3.8 is performing, which we expect to freeze. Other methods may work without freezing. The goal is to identify which methods will work without freezing. Please allow couple of minutes for each method before terminating it.
]]>The use of wildcards in the "Close Window" action requires Shutter to enumerate all active windows, in order to match their titles against the specified pattern. The enumeration procedure is performed through EnumWindows (Windows API function) and involves querying each window for its title. Unfortunately, some misbehaving applications can block this procedure indefinitely [...]
Hm, I think that autoit uses the same method. What I have understand is, that it also doesn't use window handles (HWNDs) (autoitscript.com/autoit3/docs/intro/windowsadvanced.htm). Maybe the wildcard is automatically set at the end when the WinTitleMatchMode is 1 and not 3.
If this is indeed what is causing your freezes, then we could try to isolate the application which blocks the enumeration procedure. The enumeration procedure is also executed when you trigger a dropdown menu in the "Close Window" action configuration. Can you confirm if the dropdown menu also causes Shutter to freeze?
Yes, if it has happened and I have killed the process and have started it again, it freezes again when any method is used to set the window title, also a klick on the dropdown arrow. I have to restart the OS to fix it until the next time. This indicates that something must be crashed while shutter has searched for the window title.
You have mentioned that the freeze occurs only sometimes. Can you identify if it occurs when you lunch some particular applications?
I cannot reproduce it if I want and have tried all windows that I typically use (browsers, mediaplayer, explorer, cmd, configuration windows of applications and tools and certainly the terminals. :-( I have an instance always running for testing this. Maybe any update has fixed the problem accidentally.
I am surprised that AutoIt script doesn't freeze as well. Maybe it is using an alternative window enumeration method, or perhaps it just didn't encounter the problematic application/window yet.
Certainly it can be a coincidence. Could it be an ANSI/unicode problem somewhere (window titles or the program code)?
]]>If this is indeed what is causing your freezes, then we could try to isolate the application which blocks the enumeration procedure. The enumeration procedure is also executed when you trigger a dropdown menu in the "Close Window" action configuration. Can you confirm if the dropdown menu also causes Shutter to freeze?
You have mentioned that the freeze occurs only sometimes. Can you identify if it occurs when you lunch some particular applications?
I am surprised that AutoIt script doesn't freeze as well. Maybe it is using an alternative window enumeration method, or perhaps it just didn't encounter the problematic application/window yet.
]]>Opt("WinTitleMatchMode", 1) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase
WinClose("window_title_beginning_from_the_left_no_wildcard_is needed")
Exit
]]>
Do you use any wildcard characters in your Close Window action configuration? Such as *, ?, []
Yes: * is used with all 3 "send CLOSE message" actions because the application which have to close uses tabs and from the asterisk on, the tab titles are different. The title of an tab is fixed not dynamically, but the application have to close if any tab is active. I use the "CLOSE message" because the application does save its data from the RAM to files on closing automatically.
Which method do you have selected in the Close Window configuration?
Only "send CLOSE message"
Which version of Shutter are you using?
3.8 (3.8.1 beta also tested)
]]>
Which method do you have selected in the Close Window configuration?
Which version of Shutter are you using?
It would help if you could provide a screenshot of the rule configuration window and the main window.
]]>I can not reproduce the problem. Sometimes it happens and sometimes not. Shutter is started from Windows task scheduler with an command line preset. The preset event is an countdown and the action is "close window" and "utilities: close application". I notice that Shutter is freezed, when it is staying in the tray after the countdown has expired. Then the Shutter tray tooltip shows "Time left: 00:00:01". It seems to work until 1 second before the action "close window" should be done.
When Shutter then is opened with double click on the tray icon, the event and action areas are blank (no response). There are also no responses via tray right click (no menu) and Shutters window menu. The only way to exit Shutter is to kill the process via task manager.
And the only way to get the action "close window" to work after the first freeze, is to restart the OS, maybe to restart the explorer.exe (I will try this the next time after it has happend).
Edit: I'm using Actual Window Manager from Actualtools, which is always looking for new windows. I use this to set the CPU priority and CPU affinity for the process of an opened window, make the window stay on top and start an application with an opened window with no issues. I have tried an exception in AWM for the shutter program folder but it doesn't make any difference for this problem.
]]>Sometimes Shutter freezes if the action is "close window".
When exactly does this happen? When you are configuring an action, or when it is executing?
Can you provide a screenshot please?
]]>I have tried to add the shutter program folder to the exception list of my antivirus, but it doesn't make any difference.
Any Ideas?
]]>