You can read the open tabs (apart from the current one) from the INI but the trick is you need to save the INI first before you can accurately read the lefttabs and righttabs sections - you can simply loop through the ini starting from zero 0_path 1_path etc and if you have an error there are no more tabs - add the current tab as you've probably already figured it out and then you have all tabs per panel - the controlgetfocus will tell you which panel is active (use window spy)
@hi5: That will only work if there are any tabs in the wincmd.ini. I use tabs quite heavily, however, I don't have any tabs in my wincmd.ini because I only use .tab files which I load when needed.
Secondly, a program should never ever save the user's settings in another program!
Unfortunately, I don't have anything to add about reading the open tabs - I just don't see a way to do it.
Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
JnLLnd wrote:It would have been a solution if I was writing an AHK script for myself only. But, in fact, my app is distributed to a rather large audience.
I don't see anything wrong with it as long as you explain it to TC users during the install or first setup. You can simply try to detect TC if you find TC at first start up ask the user if they want to integrate TC and explain what it needs to do in order for you to read all the open tabs. You can even offer an intermediate solution by giving the option to "only use currently active TAB" so you could skip the save INI.
Just to note: if you have tabs open and close TC the tabs are also saved, so in fact there isn't much difference - if you no longer have any tabs open in TC and close TC (or save the INI) the sections are removed from the INI.
hi5 wrote:Just to note: if you have tabs open and close TC the tabs are also saved, so in fact there isn't much difference
That's not necessarily true. You can disable the option to save open tabs on TC's exit (Operation > Save on exit > Directories). BTW, I've always had this option disabled. So the user expressed to not save any directories and tabs - and I don't expect any other program to interfere with this. Even if it's explained why this would have to be done, I expect user's complaints about that...
If there were a command SAVETABS (as opposed to OPENTABS and APPENDTABS) this would be an easy task.
Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
@Dalai: Agreed on SAVETABS - probably an easy addition to make for a future TC version. As JnLLnd has received requests from TC users I still say make it optional and leave it to the TC user to decide - start with opt-out by default. I would opt-in and you would opt-out and we'd both be happy.
In the mean time, I already have a lot of material to start working on the FP/TC integration. I'll let you know when it is ready if you accept to join the beta tests.
Just for fun - not saying it has practical use - you can get a list of all open tabs by cycling through them all using sendmessages. Example: make sure you have several tabs open in the LEFT panel - the script below will try to read the number of tabs, then simply cycle through all open tabs, store the path and restore the original active tab.
hi5 wrote:Just for fun - not saying it has practical use - you can get a list of all open tabs by cycling through them all using sendmessages.
Interesting. But when I run it (with 3 tabs on left side) SendMessage returns "FAIL". Using Window Spy, I can't find the TMyTabControl1 control in the TC window.
Sorry, forgot to add it is for 32-bit TC, 64-bit has different classes. The Window Spy isn't very good (imho) - if you download (the portable) AutoIt you can find Au3Info.exe which is much better (can't believe I'm saying this) and then you will see the TMyTabControl1 and TMyTabControl2 when you hover your mouse over these controls (32-bit, for 64-bit it is SysTabControl321). For 64-bit try this
@Hacker: the AU3_Spy.exe that has come with AHK since the beginning was never changed afaik. The newer Au3Info.exe that comes with recent AutoIt versions shows the class names of the control under the mouse more accurately. Try it with the TAB controls in TC, you won't see it with AU3_Spy.exe but you will with Au3Info.exe or other Window Spy tools (WinCheat by Alin Constantin for example) - it also has a nice "finder" where you can drag a cross-hair over a control which then gets a highlighted border around it which is a nice addition. I don't use AutoIt - I only borrow(ed) the newer spy.
Yes, I was using an old script included with AHK. In the latest AU3 package, this tool is now named Au3Info.exe (or Au3Info_x64.exe) and it shows more info. Thanks for the tip.
About your script, thanks again. But I had to change the class name (in the loop) from "Window11" to "Window9" to make it work. I'm not sure this approach is totally reliable if class name change from one version to the other (or between the 32-bit and 64-bit). I'd certainly prefer an internal command
hi5,
The only difference I see is that the AHK version shows the panel class name for the left half of the tab control for some reason, otherwise they seem to show the same info. Is there any other difference I am missing?
JnLLnd,
As far as I know those class names (well, their numbers, as in Window9 vs Window11) are dynamically generated by AHK for the given window. Not 100% sure though.
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
@Hacker: Under Win 7 and 8 pressing Shift+Alt+Tab doesn't freeze the program (you can freeze it but it has be fiddly to do so) the other Spy's shortcut to freeze does work and it gives more info (style, handle) overall presentation is better and as you've noticed it "sees" a bit more in TC.