Page 1 of 1

How Can I make Codejock Control dialog modal

Posted: Sat Nov 09, 2013 10:53 am
by unixkd
Hi all,

How Can I make Codejock Control dialog modal to EXTERNAL dll dialog window.

I use Fastreport and would like to make the "SAVE AS" dialog of codejock to be modal to the REPORT DESIGNER of the Fast Report.

Joe.

Re: How Can I make Codejock Control dialog modal

Posted: Sun Nov 10, 2013 9:42 pm
by Auge_Ohr
hi,

Codejock CommonDialog Control Members have Property : ParentHwnd
Handle to the parent control from which the dialog is displayed.
Used to center dialog to the parent window.

Re: How Can I make Codejock Control dialog modal

Posted: Mon Nov 11, 2013 1:34 am
by unixkd
Hi Jimmy,

I have tried that, NOT working. 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. 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() ?

Thanks.

Joe.

Re: How Can I make Codejock Control dialog modal

Posted: Mon Nov 11, 2013 1:51 pm
by Auge_Ohr
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