Control from external program?
Moderators: Hacker, petermad, Stefan2, white
-
- Junior Member
- Posts: 39
- Joined: 2003-03-24, 10:47 UTC
Control from external program?
Hi all,
Is it possible to control tcmd from an external program, ie. via windows message or dde?
I want to send a message from my program to tcmd so a specific file is selected. Is this possible?
Regards
Henrik
Is it possible to control tcmd from an external program, ie. via windows message or dde?
I want to send a message from my program to tcmd so a specific file is selected. Is this possible?
Regards
Henrik
-
- Junior Member
- Posts: 39
- Joined: 2003-03-24, 10:47 UTC
Found the solution
Ups, I really should read the documentation better.
There's a command line option "/o" which does what I need.
There's a command line option "/o" which does what I need.
- SanskritFritz
- Power Member
- Posts: 3693
- Joined: 2003-07-24, 09:25 UTC
- Location: Budapest, Hungary
-
- Junior Member
- Posts: 39
- Joined: 2003-03-24, 10:47 UTC
- SanskritFritz
- Power Member
- Posts: 3693
- Joined: 2003-07-24, 09:25 UTC
- Location: Budapest, Hungary
2HenrikHusted
Yes. Albeit not too reliable, as there would be no checking if the file exists (so a wrong file gets selected maybe), etc. but you can achieve positive results by simulating keystrokes in TC.
I think it would be much better if you desccribed the problem what you want to solve.
Yes. Albeit not too reliable, as there would be no checking if the file exists (so a wrong file gets selected maybe), etc. but you can achieve positive results by simulating keystrokes in TC.
I think it would be much better if you desccribed the problem what you want to solve.
I switched to Linux, bye and thanks for all the fish!
-
- Junior Member
- Posts: 39
- Joined: 2003-03-24, 10:47 UTC
I want a standalone program to tell tcmd to select a specific file.
I.e. something like this:
::ShellExecute( NULL, "open", "c:\\Program Files\\totalcmd\\TOTALCMD.EXE", "/x c:\\mydir\\myfile.txt", NULL, SW_SHOWNORMAL );
and tcmd will go to "c:\mydir" and select "myfile.txt".
It doesn't have to be via ShellExecute, it could be messages, dde or whatnot.
I.e. something like this:
::ShellExecute( NULL, "open", "c:\\Program Files\\totalcmd\\TOTALCMD.EXE", "/x c:\\mydir\\myfile.txt", NULL, SW_SHOWNORMAL );
and tcmd will go to "c:\mydir" and select "myfile.txt".
It doesn't have to be via ShellExecute, it could be messages, dde or whatnot.
- majkinetor
- Senior Member
- Posts: 369
- Joined: 2005-11-20, 10:36 UTC
- Location: Belgrade, Serbia
- Contact:
I think that this can only be done correctly if you simulate things this way in AHK:
1. simulate + to open "expand selection" (class TCOMBOINPUT)
2. send file name to combobox
3. simulate enter
This will select the file but will not position cursor over it. Also you have to make sure that correct panel is active (which can be achieved via command line params to TC, no need to simulate here)
1. simulate + to open "expand selection" (class TCOMBOINPUT)
2. send file name to combobox
3. simulate enter
This will select the file but will not position cursor over it. Also you have to make sure that correct panel is active (which can be achieved via command line params to TC, no need to simulate here)
Last edited by majkinetor on 2006-01-11, 12:29 UTC, edited 3 times in total.
We are not doing this just for the money.
We are doing it for sh*t load of money.
r-moth.com
r-moth.deviantart.com
We are doing it for sh*t load of money.
r-moth.com
r-moth.deviantart.com
- SanskritFritz
- Power Member
- Posts: 3693
- Joined: 2003-07-24, 09:25 UTC
- Location: Budapest, Hungary
This is possible, but before someone would write that script, one question remains: why do you want to select a file? What is the purpose of selecting it? I'm asking because there are quite some experts here who might point you to a utility which just does what you want.
I switched to Linux, bye and thanks for all the fish!
-
- Junior Member
- Posts: 39
- Joined: 2003-03-24, 10:47 UTC
- majkinetor
- Senior Member
- Posts: 369
- Joined: 2005-11-20, 10:36 UTC
- Location: Belgrade, Serbia
- Contact:
It will not break. It depends only on class name which usualy doesn't change in any program. If it is changed, however, you can just input new name.
I guess this can be done with Script plugin for TC. Be aware that it is still undocumented.
Also, above approach is very easy to implement. I didn't write any AHK script yet but from what I have seen around it is a peace of cake.
I guess this can be done with Script plugin for TC. Be aware that it is still undocumented.
Also, above approach is very easy to implement. I didn't write any AHK script yet but from what I have seen around it is a peace of cake.
Last edited by majkinetor on 2006-01-11, 12:53 UTC, edited 1 time in total.
- majkinetor
- Senior Member
- Posts: 369
- Joined: 2005-11-20, 10:36 UTC
- Location: Belgrade, Serbia
- Contact:
You can open the Quicksearch and then type the filename. After that you just have to press Ins (or space).HenrikHusted wrote:How does AutoHotkey let me select a specific file within tcmd?
The parameter "/o" only allows me to select the directory, the file itself is not selected.
Can AutoHotkey do this for me?
That all can be done by an autohotkey script.
cm_showquickSearch opens the quicksearchwindow, then send the specific filename and the cursor will be set to the file, ESC will close the quicksearch and 'space'will select the file while 'ins' will select the file and put the cursor to the next.
sheepdog
[edit]
But as SanskritFritz in between pointed out: You could not be sure that the right file is selected, e.g. if there is no file with this name in the directory.
[/edit]
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
- SanskritFritz
- Power Member
- Posts: 3693
- Joined: 2003-07-24, 09:25 UTC
- Location: Budapest, Hungary
- majkinetor
- Senior Member
- Posts: 369
- Joined: 2005-11-20, 10:36 UTC
- Location: Belgrade, Serbia
- Contact:
the one can check in script if file exists before continuing.
similar to batch command : if EXIST filename
You can use dogs approach but only if you are sure that file exists. In mine alternative you can leave that because dialog with "no matches found" will be isued by TC (I don't know if you can live with that)
similar to batch command : if EXIST filename
You can use dogs approach but only if you are sure that file exists. In mine alternative you can leave that because dialog with "no matches found" will be isued by TC (I don't know if you can live with that)
We are not doing this just for the money.
We are doing it for sh*t load of money.
r-moth.com
r-moth.deviantart.com
We are doing it for sh*t load of money.
r-moth.com
r-moth.deviantart.com
-
- Junior Member
- Posts: 39
- Joined: 2003-03-24, 10:47 UTC