Results 1 to 4 of 4

Thread: How to use ShellExecute

  1. #1

    How to use ShellExecute

    After adding shellAPI to my uses, I used the Procedure:
    ShellExecute(handle, 'open', Application.ExeName, nil, nil, sw_ShowNormal);
    I get an error from Application.ExeName. It(the compiler) says "Incompatible types: 'String' and 'PAnsiChar'. Any ideas?

  2. #2

    Re: How to use ShellExecute

    Application.exeName refers to the path of the exe you want to open. It's of type PChar and should be between ' '.

    [pascal]ShellExecute(handle, 'open', 'c:\windows\notepad.exe', nil, nil, sw_ShowNormal);[/pascal]

    Hope this helps
    Wake up from the dream and live your life to the full

  3. #3

    Re: How to use ShellExecute

    just write PAnsiChar(Application.ExeName) that is assuming you have anything except D2009.

  4. #4

    Re: How to use ShellExecute

    Code:
    shellexecute(handle, 'open', pchar(fn_prg2start), '', pchar(ExtractFileDir(fn_prg2start)), sw_normal);
    for dos-boxes it's good to use 'sw_hide' so the window is hidden

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •