I am adding some functions to a DLL and need to pass in my apps instance handle as a HINSTANCE. Is there a way to do this??
I think it should Handle=Get_Property( Window, 'HANDLE')
akaplan@sprezzatura.com
Hi Geoff,
You need to get the handle of a window in your app and then you need to get the app's instance handle which is different from a window handle).
To do this use Aaron's code to get the window handle then use the GetWindowWord API call with the GWW_HINSTANCE argument to get the HINSTANCE of the app that owns the window.
eg.
Equ GWW_HINSTANCE$ To -6
hWnd=Get_property( "SOMEWIN", "HANDLE" )
hInstance=GetWindowWord( hwnd, GWW_HINSTANCE$ )
You'll probably have to prototype GetWindowWord as
SHORT PASCAL GetWindowWord( SHORT, SHORT )
in DLL_USER in SYSPROCS.
One other thought - do you need the HINSTANCE of OpenInsight( ie PResentation server - which owns the windows you create ) or OpenEngine, which runs the scripts and programs that call your DLL's ? ) Hmmm….
cpates@sprezzatura.com
World Leaders in all things RevSoft