Re: Add application to files context menu and send selected files as parameters
You have got it.
The timer will be fine... for something like this using API's isn't worth the effort.
Re: Add application to files context menu and send selected files as parameters
thank you
Is there anyway to let him wait less time than 1 second and make sure that am not losing any message ? something like estimate the time i should wait instead of getting a constant of 1 second ?
Re: Add application to files context menu and send selected files as parameters
Well, the more you build into your recieve message function, the longer it will take to execute and thus increase the likelyhood that you will backup the message que to your application....
Okay where is it...
Okay, can't find it....
Must be because I'm using the wrong keywords but I thought this site's codebank had an alternative to using doevents and what it did was to read and process messages that were in the que and the thought was.... (does 2+2=4 yet?) the thought was you might be able to use it... but then again...
Okay, I'm back from that thought tangent... Now where was I. Oh yeah! The more you put in there the longer it will take...
Okay, here comes another tangent.... THREADS!!!!
Whew! Now hopefully this tangent business is all over with... :) ...and so you would build up the messages que. You want that recieving piece of code to operate as fast as possible. I mean it is possible to come up with some sort of averaging algorithm that takes/uses GetTickCount along with some addition and division or you could like I posted earlier, reduce the timers interval to less than 1 second...
Good Luck
Re: Add application to files context menu and send selected files as parameters
I am keep advancing on my application with your help, please tell me is there a way to add a relative path to the registry for my application ? or i should add a full path like D:\Documents and Settings\MyUser\Desktop\Myapplication.exe ?
i can't add simply Myapplication.exe ? so that wherever is my application windows will locate it and open it ?
I am asking because i find this better and i found in the registry some values like %root etc...so i said maybe there is a way to specify a relative path or simply the name of the exe....
waiting your reply and thanks in advance
Re: Add application to files context menu and send selected files as parameters
There isn't a way to leave out the path, and even if there was it wouldn't be a good idea... not only would it take several minutes for Windows to find it, but also if there was more than one program with the same name how would Windows know which one to use?
The things you have seen like %system% etc are actually full paths - they are just a shorter way of writing them (and are only available for certain special folders).
Using a path written out in full is the best thing you can do, because it is easier and safer than the alternatives.
Re: Add application to files context menu and send selected files as parameters
Guys, due to your help i could advance a lot on my application..10x a lot....Once i finish it, i will close this thread, but there is something "weird" maybe i am getting :
In fact i added my application as you told me to the :
HKEY_CLASSES_ROOT\*\Shell\Open With MyProg
All is working good,i mean the user right click on any file, he got my program name on windows context menu and my application receive the file name ...great !
but i noticed that if i double click on some files with extensions that windows haven't associate them to some applications, my programme is launched, any idea why ? This is not happening with all extensions by the way, i could get this with .swf, or .exp or .lib ..
i don't have an application installed to open them, so when the user double click instead of getting the windows menu that usually tells, select an application to open this file with, i get my program launched !
I tried with other extensions like .abc, .asd etc.. and it's not doing this, i am getting the normal windows that tell me to select with wich application i want to open !
Any idea why ? and how to avoid this ?
Re: Add application to files context menu and send selected files as parameters
Right-click on a file, and see what option is shown in bold - that is the action that will be performed when you double-click on the file.
I don't know enough about Windows shell integration to know what caused the current situation, or how to fix it.
Re: Add application to files context menu and send selected files as parameters
thanks si_the_geek, i am not finding a solution for that, do you suggest me to post it on different forum than vb or different section ?
I noticed the following : for the file type that they are openning with my application .swf, .lib, etc...as you said if i make right click, i see on bold my application appearing, but for other file type that they are not opened with my application, my application doesnt appear on bold, but the default "Open" ...
I noticed also, that in the HKEY_CLASSES_ROOT\*\Shell\ , there is only my application, but if i added another one that has a name with alphabetical order less than mine ,then, when you right click the .swf, .lib etc... windows try to open them with the new added one , not my application,
so to conclude, it seems windows is automatically trying to open some extensions with the first key that exists in the registry HKEY_CLASSES_ROOT\*\Shell\ ....