Well, there are in real 11 scenarios for opening 1 or more files in UltraEdit via ueFastStart as I have found out yet after reading all posts in this topic again including the one posted by rhapdog about effect of an opened project/workspace on window title:
ueFastStart released on 2012-06-08 works for all scenarios except the last one.
Taking all 11 cases into account and avoiding false positive window detections (window of Windows Explorer or browser window containing also UltraEdit in title) as much as possible, I think the best would be that ueFastStart does following on every window title:
I think, you have combined test six and seven by comparing start of window title with just "UltraEdit-32". This is also okay and makes the tool a little bit faster. I think, in 99.999999% of all window titles it is okay to compare start of window title for compatibility with UE < v14.00 with just "UltraEdit-32" as IDM most likely has no webpage anymore with a title beginning with "UltraEdit-32".
- UltraEdit is not running.
- UE prior v14.00 is running with no file opened in UE, and also no project/workspace loaded.
A window exists with title "UltraEdit-32".
- UE prior v14.00 is running with no file opened in UE, but a project/workspace is loaded.
A window exists starting with "UltraEdit-32 -" in title.
The entire window title is "UltraEdit-32 - project name"
- UE prior v14.00 is running with at least 1 file opened in UE, but no project/workspace loaded.
A window exists starting with "UltraEdit-32 -" in title.
The entire window title is "UltraEdit-32 - [file name with or without path]"
- UE prior v14.00 is running with at least 1 file opened in UE, and a project/workspace is also loaded.
A window exists starting with "UltraEdit-32 -" in title.
The entire window title is "UltraEdit-32 - project name - [file name with or without path]"
- UE v14.00 or later is running with no file opened in UE, and also no project/workspace loaded.
A window exists with title "UltraEdit".
- UE v14.00 or later is running with no file opened in UE, but a project/workspace is loaded.
A window exists ending with "- UltraEdit" in title.
The entire window title is "project name - UltraEdit"
Interesting here is that configuration setting Start application title with file name has in this case no effect on window title. The application name is always at end of the window title after the project name.
- UE v14.00 or later is running with at least 1 file opened in UE, but no project/workspace loaded, and configuration setting Start application title with file name is not enabled, or the setting does not exist at all.
A window exists starting with "UltraEdit -" in title.
The entire window title is "UltraEdit - [file name with or without path]"
- UE v17.00 or later is running with at least 1 file opened in UE, but no project/workspace loaded, and configuration setting Start application title with file name is enabled.
A window exists ending with "- UltraEdit" in title.
The entire window title is "[file name with or without path] - UltraEdit"
- UE v17.00 or later is running with at least 1 file opened in UE, and a project/workspace is also loaded, and configuration setting Start application title with file name is enabled too.
A window exists ending with "- UltraEdit" in title.
The entire window title is "[file name with or without path] - project name - UltraEdit"
- UE v14.00 or later is running with at least 1 file opened in UE, and a project/workspace is also loaded, and configuration setting Start application title with file name is not enabled, or the setting does not exist at all.
A window exists containing in the middle of the title "- UltraEdit -".
The entire window title is "project name - UltraEdit - [file name with or without path]"
ueFastStart released on 2012-06-08 works for all scenarios except the last one.
Taking all 11 cases into account and avoiding false positive window detections (window of Windows Explorer or browser window containing also UltraEdit in title) as much as possible, I think the best would be that ueFastStart does following on every window title:
- Does the title of a window contain anywhere inside the case sensitive string "UltraEdit"?
No, this window is definitely not an UltraEdit window and ueFastStart can continue with title of next window. - Has the window title a length of exactly 9 characters?
Yes, the window is an UltraEdit window - scenario 6. - Does the window title start with case sensitive string "UltraEdit - "?
Yes, the window is an UltraEdit window - scenario 8. - Does the window title end with case sensitive string " - UltraEdit"?
Yes, the window is an UltraEdit window - scenario 7, 9 and 10. - Does the window title contain case sensitive string " - UltraEdit - "?
Yes, the window is an UltraEdit window - scenario 11. - Is the complete window title equal case sensitive string "UltraEdit-32"?
Yes, the window is an UltraEdit window - scenario 2. - Does the window title start with case sensitive string "UltraEdit-32 - "?
Yes, the window is an UltraEdit window - scenario 3, 4 and 5.
I think, you have combined test six and seven by comparing start of window title with just "UltraEdit-32". This is also okay and makes the tool a little bit faster. I think, in 99.999999% of all window titles it is okay to compare start of window title for compatibility with UE < v14.00 with just "UltraEdit-32" as IDM most likely has no webpage anymore with a title beginning with "UltraEdit-32".