Jump to content

How do i get a program that is running to know that its file tpye is trying to be executed


DirtDBaK
 Share

Recommended Posts

CHECK LAST POST FOR MY IDEA ON HOW

What i need is a little how too...

Lets say in the registry i have mp3 files set to run with my autoIT copiled script

Lets say that exe reads from the command line and is currently running..

I double click that mp3 file and i want that exe that is open to play it, not restart another copy..

I wanna know the best way to set this up... if anyone knows how that would be great. Thanks!!

Edited by DBak

[center][/center]

Link to comment
Share on other sites

It is saved in the registry as the File Assocaite type, do some research on google and you'll find the answer.

I wrote a reply for that and then canceled it after I reread the post.

I don't think he wants to create a file association. He wants to run a second file without starting another incidence of the exe file

I'm thinking _Singleton() but I never use it myself so I'm not sure

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

I wrote a reply for that and then canceled it after I reread the post.

I don't think he wants to create a file association. He wants to run a second file without starting another incidence of the exe file

I'm thinking _Singleton() but I never use it myself so I'm not sure

I see what he meant, for the same reason I wonder how AutoIt handles the second instant of it's own copy, if there is a way to do this then it opens a lot of options.

_Singleton only prevents from opening another instant but will not do anything besides that, correct me if I am wrong.

Link to comment
Share on other sites

I see what he meant, for the same reason I wonder how AutoIt handles the second instant of it's own copy, if there is a way to do this then it opens a lot of options.

_Singleton only prevents from opening another instant but will not do anything besides that, correct me if I am wrong.

I know that it can be done. I just can't wrap my brain around it right now.

Maybe if the exe is running then get the PID then send the file to that process

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Doesn't Windows send a command line to the application to load a file (Like a media file) ?

Windows doesn't make a distinction in how to handle the second file though. That part is up to the app.

The exception is when you send it several files at the same time. Then it is handled by the registry or the app. Some programs handle this situation gracefuly others don't.

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Ok I think i have an idea....

two programs will be used

MediaPlayer.exe

Controller.exe

Controller.exe will be registered as the mp3 and wma files program to run.

Controller will read from the command line and say

if mediaPlayer.exe is running then

ControlSend( $file_to_be_played to the gui for mediplayer

else

ShellExecute( 'mediaplayer.exe', $file )

endif

------------and----------------

mediaPlayer.exe will read from a drag and drop so that if control send is used to the gui then it will read it...

Do you think this will work??

[center][/center]

Link to comment
Share on other sites

It might.

You won't know until you try.

Just whip up a simple test scrip but make sure to close

ControlSend( $file_to_be_played to the gui for mediplayer

this time.

Edit;

BTW I often use stub apps to do things like you want and they usuall work fine so just try it.

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...