Link to home
Start Free TrialLog in
Avatar of ST3VO
ST3VOFlag for United Kingdom of Great Britain and Northern Ireland

asked on

ShellExecute to a Shortcut - How to

Hi experts,

I need to know how to ShellExecute to a Shortcut ?

Anyone know how?

Thanks

ST3VO
SOLUTION
Avatar of Johnjces
Johnjces
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of MerijnB
MerijnB
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
MerijnB,

That's what I have.... Other than you have a 0 handle.

John
sorry, hadn't seen your comment when I posted mine
As a side note, if you want to create an URL shortcut make a text file with a .url extension and write:

[InternetShortcut]
URL=http://delphi.about.com

Save it anywhere.

John
Avatar of ST3VO

ASKER

Hmmm.....In my situation none seem to work.

I'll explain better.

I've written an active Form Control which is deployed in a web page.
OnClick it uses Shellexecute to Run an Application.
The Application actually does run BUT this application is a control application which itself shellexecutes other .exe (apps).

By using Shellexecute directly to run the .exe, it will run the exe but this opened .exe will not run other .exe from it.

So, I decided to try via a Shortcut, which it why I'm asking here.

The problem is that the shortcut don't run the .exe from the Active Form.

Any ideas of how to solve this issue please?

Thanks

ST3VO
I think this is a security precaution to prevent you from running something from a webpage.
Avatar of ST3VO

ASKER

I can actually get it to run!

This with the case:

1 -----Active Form
              |___Loads App1.exe (works ok)
                                       |___Load external exe (Doesn't work)

So, it's not that the Active Form doesn't run the .exe ....It's the .exe that it loads that doesn't load the external app from itself.

p.s: This works fine if I load the application directly bypassing the Active Form!

Do you get any errors from app1.exe?
If not, build in some logging so you can see where things are going wrong.
and why can't you start external.exe directly?
Avatar of ST3VO

ASKER

No...no errors at all....the app just doesn't load!

I'll give it a go!
St3vo and EE Moderator,

I do not mean to complain. But...

This question has gone from a fairly simple,

"I need to know how to ShellExecute to a Shortcut ?"

to a second and much broader question;

"I've written an active Form Control which is deployed in a web page. OnClick it uses Shellexecute to Run an Application. The Application actually does run BUT this application is a control application which itself shellexecutes other .exe (apps). By using Shellexecute directly to run the .exe, it will run the exe but this opened .exe will not run other .exe from it. So, I decided to try via a Shortcut, which it why I'm asking here. The problem is that the shortcut don't run the .exe from the Active Form."

I do not believe this is proper and am asking the moderator and you to rethink this question.

Close it and ask again properly and in its entire context, or something.

Open to discussion from other experts as well if I am all wet, wrong, or too complaining etc.!

John
I tend to doubt.

For one part I agree with you, on the other hand, ST3VO is always _very_ generous with his points (he actually _always_ gives 500 points) even for very simple questions.

If this question was awarded with < 100 points I'd agree, now I'm not sure...
Avatar of ST3VO

ASKER

Thanks MerijnB for your comment! It's my pleasure, because you guys are always there to help!

Any 95% of the time I need an answer ASAP and your guys are giving me your knowledge and time!

I wish I was at least a decent programmer but I am not, although I DO try my best to learn things as quick as possible! I learn every day with the help you your guys!

About this question, Yes, I agree that I didn't explain myself properly. This is because I thought that executing a shortcut would solve the problem but it hasn't.

I agree that all I asked is to perform a shellexecute on a .lnk file, so if you wan't just assign those points and open another question!

Thanks again and sorry about that!

ST3VO
It's not that I desire the points nor is it about the points... really!

It's about being full and open with the problem you are trying to solve. I realize at times we believe that there is a simple solution but it does not turn out to be simple.

I really like to help and provide as much information that I know. But don't we deserve all the information from the "gitgo?

But, IMHO (for what it is worth), questions should not grow whether you assign 50 points or 1000 points. If the question is answered and answered correctly, then it should be closed.

If the question grows into something completely different like executing an application from an application from a link then I believe that is entirely separate and a new question. I believe that in most your questions (from what I have read), you should supply as much information to those that might help you at the very beginning. Read through some posts and see how they have grown?

Show some snippets of what you've done and where the problem is. Is simply closing and reopening an ADOQuery going to solve your problem?

I could be really off base. I am not flaming, but I too am trying to learn. About this forum and more about Delphi.

Again... my opinion and how I read the rules.

My rant and 2 cents.

Thanks and sorry if I offended someone or if they took this the wrong way!

John
Last of my 2 cents....

Would a batch file work for you?

Create a batch .bat file with the path and executable contained therein. Try and create a link to the batch file and see if that works.

John
Avatar of ST3VO

ASKER

Here are the points! Question closed! Yes...the asked question a question and got an answer but as MerijnB said I am usualy very generous with the points and the gradings because I appreciate your time and effort and a bit of flexibility would have been appreciated considering the number of questions I ask and the grades I give.
But never mind! I'll be more careful next time!
Thanks

ST3VO
Avatar of ST3VO

ASKER

OK, I'll try ...thanks!!!