Link to home
Start Free TrialLog in
Avatar of Paer Toernell
Paer ToernellFlag for Thailand

asked on

Delphi 2007 problem opening a URL

I use the command:
ShellExecute(0, 'OPEN', '', 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?
Avatar of Lukasz Zielinski
Lukasz Zielinski
Flag of Poland image

try this:
ShellExecute(GetDesktopWindow, 'open', '', nil, nil, SW_SHOWNORMAL);
or if you call it from form
ShellExecute(Handle, 'open', '', nil, nil, SW_SHOWNORMAL);

Avatar of Geert G
Geert G
Flag of Belgium image

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


Ok, when executing the EXE file i get  error:

'' is not a valid integer

This is how i pass the command:

ShellExecute(GetDesktopWindow, 'open', PChar(s), nil, nil, SW_SHOWNORMAL);
Its an ECONVERT error
When i put the command in the "FormCreate" it works, but not later... The instatiation of the form blocks?
Geert Thanx

It works when i run just the exe, but why does it create an exception?
Ahhh - sorry, my fault. I converted a non existing string to int....

Still - why the exception?
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 ...