Avatar of Paer Toernell
Paer Toernell
Flag for Thailand asked on

Delphi 2007 problem opening a URL

I use the command:
ShellExecute(0, 'OPEN', 'http://www.experts-exchange.com', nil, nil, SW_SHOWNORMAL);

from Delphi, and initially it worked. Now, however i get some CPU error and the CPU monitor shows up when i execute this command. Any tips?
Delphi

Avatar of undefined
Last Comment
Geert G

8/22/2022 - Mon
Lukasz Zielinski

try this:
ShellExecute(GetDesktopWindow, 'open', 'http://www.experts-exchange.com', nil, nil, SW_SHOWNORMAL);
or if you call it from form
ShellExecute(Handle, 'open', 'http://www.experts-exchange.com', nil, nil, SW_SHOWNORMAL);

ziolko.
ASKER CERTIFIED SOLUTION
Geert G

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Paer Toernell

ASKER
Ok, when executing the EXE file i get  error:

'' is not a valid integer
Paer Toernell

ASKER

This is how i pass the command:

ShellExecute(GetDesktopWindow, 'open', PChar(s), nil, nil, SW_SHOWNORMAL);
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
Paer Toernell

ASKER
Its an ECONVERT error
Paer Toernell

ASKER
When i put the command in the "FormCreate" it works, but not later... The instatiation of the form blocks?
Paer Toernell

ASKER
Geert Thanx

It works when i run just the exe, but why does it create an exception?
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Paer Toernell

ASKER
Ahhh - sorry, my fault. I converted a non existing string to int....

Still - why the exception?
Geert G

something to do with a breakpoint in ntdll.dll i believe
you get this for nearly all microsoft applications
they probably don't like other debuggers ...