How to find MDICHILD windows

How to find MDICHILD windows

Postby Otto » Tue Feb 19, 2008 6:22 pm

Thanks in advance
Otto
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm

Mdi-Childs

Postby ukoenig » Tue Feb 19, 2008 7:54 pm

Hello Otto,

As far i know, there is only a function
IsChild()
It returns, if the active window is a Child.
The other direction i don' think so, that there
is a function.

Regards
Uwe
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Postby Otto » Tue Feb 19, 2008 8:44 pm

Hello Uwe,

I read that you have to use FindWindowEx API call.
But I don’t know how to use this function. Maybe someone has a code example.
//DLL32 Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hwndParent As Long,ByVal hwndChildAfter As Long,ByVal lpszClass As String,ByVal lpszWindow As String) As Long

Regards,
Otto
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm

Postby James Bott » Wed Feb 20, 2008 7:27 am

Otto,

I believe all the MDI child windows are stored in this array.

wndMain():oWndClient:aWnd[ ]

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Otto » Wed Feb 20, 2008 7:30 am

There are many powerful functions available in the Windows API,
so there is little doubt that some developers will want to a call Windows API function from time to time.

As there is not always a FIVEWIN GURU who has time to help I tried to find out how to do this by my self.


How I change a API declaration to FWH

1) LIB "" at the end of the declaration

2) Change the ALIAS clause to PASCAL FROM

3) delete all: ByVal, ByRef

4) change all As String, Long, ... to Uppercase

5) to call the function I found out that you have to use instead of a vbNullString NIL in FWH
example: hwndClient = FindWindowEx(hWnd, 0, "mdiclient", NIL)


DLL32 Function FindWindowEx Lib "user32" Alias "FindWindowExA" ( _
ByVal hwndParent As Long, _
ByVal hwndChildAfter As Long, _
ByVal lpszClass As String, _
ByVal lpszWindow As String) As Long


DLL32 Function FindWindowEx ( hwndParent AS LONG, hwndChildAfter AS LONG, lpszClass AS STRING,;
lpszWindow AS STRING) AS LONG PASCAL FROM "FindWindowExA" LIB "user32"




links: http://www.johnsmiley.com/cis18/Smiley026.pdf
Last edited by Otto on Wed Feb 20, 2008 7:37 am, edited 3 times in total.
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm

Postby Otto » Wed Feb 20, 2008 7:35 am

Hello James,
Thank you for your answer.
I will try your suggestion. I had not read your post before posting.

Could you please check if my guidance “how to convert a API call to FWH” is correct ?

Thanks in advance
Otto
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm

Postby Otto » Wed Feb 20, 2008 8:28 am

Hello James,

if Gurus have time you get what you need. Thanks again.
Now it works.
Regards,
Otto

if Len( oWnd:oWndClient:aWnd ) > 0
msginfo("hWnd: " + str(oWnd:oWndClient:aWnd[1,1]) + " "+ GetWindowText( oWnd:oWndClient:aWnd[1,1] ) )
endif
oWnd:CloseAll()
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 83 guests