Page 1 of 1

systray and shellexecute

Posted: Thu Jun 12, 2008 9:48 am
by Otto
Does someone have a sample with systray and shellexecute.

I inserted following code into testtray.prg of the fivewin samples.

Testdlg is executed but not shown.

MENUITEM "Testdlg" ACTION ( nRet:= Shellexecute(0,0,"c:\FWH\samples\test\testdlg.exe","c:\FWH\samples\test",1),msginfo(nRet))

MENUITEM "winexec" ACTION winexec ("c:\xwinhotel\xwinhotel.exe")
is working. But how can I setup the woring directory?


Thanks in advance
Otto

Posted: Thu Jun 12, 2008 11:17 am
by Antonio Linares
Otto,

It seems that you are not using the right parameters when calling ShellExecute:

HINSTANCE ShellExecute(
HWND hwnd, // handle to parent window
LPCTSTR lpOperation, // pointer to string that specifies operation to perform
LPCTSTR lpFile, // pointer to filename or folder name string
LPCTSTR lpParameters, // pointer to string that specifies executable-file parameters
LPCTSTR lpDirectory, // pointer to string that specifies default directory
INT nShowCmd // whether file is shown when opened
);

Posted: Thu Jun 12, 2008 1:49 pm
by Otto
Antonio,
thank you for your help.
Yes the parameters where wrong.

Regards,
Otto