Moleek
Programmer
- Aug 11, 2013
- 4
Hello everyone.
My situation is, that I need to open external file (Doc, TXT, PDF or whatever), which is not a problem, but I need to find out, when this file is closed (because I need write it back to the database when work is done). I tried run it with ShellExecute(), but I was able check windows status only with it's exact title, which I don't know every time.
I think ShellExecuteEx() should return codenumber (handle) of process. Knowing this number it should be easy to find out if this process is still running or not.
I'm able to find structure ShellExecuteINFO in C++, but I can't transform it to VFP.
Is there someone who could help me please?
Thank you.
Martin.
This is it:
My situation is, that I need to open external file (Doc, TXT, PDF or whatever), which is not a problem, but I need to find out, when this file is closed (because I need write it back to the database when work is done). I tried run it with ShellExecute(), but I was able check windows status only with it's exact title, which I don't know every time.
I think ShellExecuteEx() should return codenumber (handle) of process. Knowing this number it should be easy to find out if this process is still running or not.
I'm able to find structure ShellExecuteINFO in C++, but I can't transform it to VFP.
Is there someone who could help me please?
Thank you.
Martin.
This is it:
Code:
typedef struct _SHELLEXECUTEINFO {
DWORD cbSize;
ULONG fMask;
HWND hwnd;
LPCTSTR lpVerb;
LPCTSTR lpFile;
LPCTSTR lpParameters;
LPCTSTR lpDirectory;
int nShow;
HINSTANCE hInstApp;
LPVOID lpIDList;
LPCTSTR lpClass;
HKEY hkeyClass;
DWORD dwHotKey;
union {
HANDLE hIcon;
HANDLE hMonitor;
} DUMMYUNIONNAME;
HANDLE hProcess;
} SHELLEXECUTEINFO, *LPSHELLEXECUTEINFO;