>>DECLARE INTEGER GetModuleFileName IN Win32API; >> INTEGER hModule, STRING @lpFilename, INTEGER nSize >>DECLARE INTEGER GetClassLong IN Win32API; >> INTEGER hWnd, INTEGER nIndex >>* Get the main window handle from FOXTOOLS >>lnhWnd = MainhWnd() >>* Get the module handle >>lnmodule = GetClassLong(lnhWnd, -16) >>* Initialize the parameters >>lcfilename = SPACE(265) >>lnsize = LEN(lcfilename) >>* Get the filename >>lnsize = GetModuleFileName(lnmodule, @lcfilename, lnsize)>>If lnsize is less than or equal to 1, the function failed. Otherwise, it represents the number of characters in the buffer.
>>hth,
>
>George,
>FoxTools not available in Borland C++ - I just tried it and mainhwnd() is nowhere to be found. Although your solution is correct, this thread should be in Visual Studio (C++) forum. I have exactly the same problem as Matt here so I am following the thread with great interest. Sorry Bill old pal, but Borland also seem to have a good C++ package!
Nigel,
My example was intended to be run under VFP, not C++. In that environment, you would use other functions (such as FindWindow()) to retrieve the window handle.George
Ubi caritas et amor, deus ibi est