Yoni
asked on
API fuctions troubles
I am using some API functions with no problems. I just type them and delphi recognizes the and their syntax. But when I try to use other functions they won't work. For instance Winexe is a function that delphi 4 recognizes but when I try to use shellexecute and I do the syntax right I get an "undeclared identifier "ShellExecute" error. Can anyone tell me what's the problem and how to solve it?
Thanks!
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
No, I mean in the unit you are calling the API, you must add shellapi in your USES list.
i.e.
uses xxx,xxx,...,shellapi
and you needn't add it to your project -- actually you'd better remove it from your project, Delphi can find it automatically.
i.e.
uses xxx,xxx,...,shellapi
and you needn't add it to your project -- actually you'd better remove it from your project, Delphi can find it automatically.
That's because you have a wrong syntax.. Here is the right syntax for using the the ShellExecute()
ShellExecute(0, 'open', 'C:\windows\desktop\test.t xt', nil, nil, SW_NORMAL);
Cheers,
Viktor
ShellExecute(0, 'open', 'C:\windows\desktop\test.t
Cheers,
Viktor
ASKER