ShellExecute
Simen Kjaeraas
simen.kjaras at gmail.com
Mon Feb 11 10:58:02 PST 2008
On Mon, 11 Feb 2008 19:18:27 +0100, Serj Makaroff
<serj-makaroff at yandex.ru> wrote:
> Hello!
>
> I try to use WinAPI function ShellExecute() to start web browser in new
> process. I wrote such definition
> export {
> HINSTANCE ShellExecute(HWND hwnd,LPCTSTR lpOperation,LPCTSTR
> lpFile,LPCTSTR
> lpParameters,LPCTSTR lpDirectory,INT nShowCmd);
> }
>
> and called function in such way:
>
> HINSTANCE i = ShellExecute(null, mode, url, null, null, SW_SHOW);
>
> Also I found in MSDN, that this function is in shell32.dll. I added
>
> pragma(lib, "shell32.lib");
>
> I obtain linker error "Symbol Undefined..." Help, pls
When changing the definition to
extern (Windows)
{
HINSTANCE ShellExecuteA(HWND, LPCSTR, LPCSTR, LPCSTR, LPCSTR, INT);
HINSTANCE ShellExecuteW(HWND, LPCWSTR, LPCWSTR, LPCWSTR, LPCWSTR, INT);
}
this works for me.
More information about the Digitalmars-d-learn
mailing list