unixkd wrote:The Fastreport designer has no property for the handle so I use WIN API to get the active Window handle and assigned it to the :parentHwnd property.
hm ...
if it is a activeX you can try o:Interface
unixkd wrote:What I am not sure of is if the Win API is getting the designer handle or Not.
Is there any other way to get the Hwnd of any dialog apart from WIN API :GetForegroundWindow() ?
as Name say that is only the Foreground ( Z-Order ) Windows.
to find any Window use API Function "FindWindowA()"
http://msdn.microsoft.com/en-us/library ... 85%29.aspx
find Windows by Title
Code: Select all
PROCEDURE AppSys
LOCAL cTitle := "CD-DVD"
LOCAL hWndDlg := DllCall( "User32.dll", DLL_STDCALL, "FindWindowA", 0, cTitle )
IF !( hWndDlg == 0 )
DllCall( "User32.dll", DLL_STDCALL, "SetForegroundWindow", hWndDlg )
DllCall( "User32.dll", DLL_STDCALL, "BringWindowToTop", hWndDlg )
DllCall( "User32.dll", DLL_STDCALL, "ShowWindow", hWndDlg, 1 )
DllCall( "User32.dll", DLL_STDCALL, "UpdateWindow", hWndDlg )
*** It is a second instance.... Bye Bye
QUIT
ENDIF
RETURN
find Windows by CLASS Name ("Notepad")
Code: Select all
nNotepad := DllCall("User32.dll", DLL_STDCALL, "FindWindowA", "Notepad"+ Chr(0), 0)
to find out CLASS Name i use WinID
http://www.dennisbabkin.com/winid/
find some special Windows ( e.g. Commen Dialogs )
Code: Select all
nFaxWin := DllCall("User32.dll", DLL_STDCALL, "FindWindowA", "#32770"+ Chr(0), "FRITZ!fax - send by Xbase++" + Chr(0))
and her a other Function used with Codejock
Code: Select all
FUNCTION CJ_SetXParent( hWndChild, hWndNewParent )
DllCall( 'User32', DLL_STDCALL, 'SetParent', hWndChild,hWndNewParent)
RETURN NIL