Open/Save Dialog synchronizer

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
zeroflag
Junior Member
Junior Member
Posts: 3
Joined: 2010-01-10, 15:11 UTC

Open/Save Dialog synchronizer

Post by *zeroflag »

Hi,

I would like to develop a totalcommander plugin which is able to "synchronize" all systemwide open/save dialog path with the current directory in total commander. I mean if the current directory is c:\foo\bar on the selected panel/tab, and I open a opendialog from a different application, the current directory of the dialog will be c:\foo\bar as well. I hope it's clear what I want.
So my question is: Is it possible to somehow query the actual directory from totalcommander, or bind an event to every directory change?

thanks
User avatar
Hacker
Moderator
Moderator
Posts: 13142
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

Hello zeroflag,
Some of us are using a simple AHK script to paste the active path from TC into the dialogbox, thus changing the directory. Not sure if the necessary changes for TC 7.50 have already been performed on the script.

HTH
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.
zeroflag
Junior Member
Junior Member
Posts: 3
Joined: 2010-01-10, 15:11 UTC

Post by *zeroflag »

Hi Hacker,
Thanks for you answer. Currently I do this manually by using CTRL+P, ENTER and pasting it to the dialog. The script is a bit better, but a fully automatic solution would be a lot better. I suspect there is no way to bind an event to the directory change from any type of plugin, right?
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Current path may be copied e.g. from status bar or from panel titles. Following code copies text from status bar (path will have trailing '>' characher that you need to erase then):

Code: Select all

			HWND tcwnd=FindWindow("TTOTAL_CMD", 0);
			char buf2[1024]; int k2=0;
			HWND cmdpanel=0;
			while (1) {
				if (!(cmdpanel=FindWindowEx(tcwnd, cmdpanel, "TMyPanel", ""))) break;
				if (FindWindowEx(cmdpanel, 0, "TMyComboBox", "") || FindWindowEx(cmdpanel, 0, "TComboBox", "")) {
					HWND pathpanel=FindWindowEx(cmdpanel, 0, "TMyPanel", 0);
					k2=GetWindowText(pathpanel, buf2, sizeof(buf2));
					if (k2&&buf2[k2-1]=='>') break; else k2=0;
				}
			}
			if (k2) buf2[--k2]=0;
(this will find right panel with right child panel; should work for TC 7.5 and earlier too)

Status bar always contains path of current panel.
Last edited by MVV on 2010-01-13, 15:32 UTC, edited 1 time in total.
User avatar
Hacker
Moderator
Moderator
Posts: 13142
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

zeroflag,
I suspect there is no way to bind an event to the directory change from any type of plugin, right?
I do not know for sure but I do not think so, no.

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.
User avatar
nsp
Power Member
Power Member
Posts: 1917
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Post by *nsp »

zeroflag wrote:,
I suspect there is no way to bind an event to the directory change from any type of plugin, right?
TC is not very extensible, no automation API and win message system great to push info but nothing great to get info from TC.

Instead of getting in touch every time TC change a folder, you should get the current folder by your own !

If you want to get informed that Tabs change, you can continuously parse wincmd.ini or get current folder as MVV shown and build a TC spy Daemon yourself.

FavMenu (see AHK/TC forum) is already doing a lot of good stuff about fileDialog automation, you should get a eye on it.
Last edited by nsp on 2010-01-11, 12:52 UTC, edited 1 time in total.
tcvol
Junior Member
Junior Member
Posts: 67
Joined: 2009-02-02, 12:35 UTC

Post by *tcvol »

hey zeroflag:

see here if this is what you need:
http://ghisler.ch/board/viewtopic.php?p=193866#193866
zeroflag
Junior Member
Junior Member
Posts: 3
Joined: 2010-01-10, 15:11 UTC

Post by *zeroflag »

I'll check this favmenu stuff. Thanks to everyone.
User avatar
robinsiebler
Senior Member
Senior Member
Posts: 460
Joined: 2003-03-05, 21:04 UTC

Post by *robinsiebler »

If someone gets this working under Windows 7, could you post the entire program so that everyone doesn't have to play Cut & paste & hope I did it right?
Robin L. Siebler
Personal License #13949
------------------------------
"Bother", said Pooh, as he deleted Windows
Post Reply