Hi, all !
Where I can find examples with function API EnumChildWindows() using ? I finded examplest on VB/Delphi/C. But ! can't write it on FWH.
EnumChildWindows
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
You can use this code to access all child windows:
Code: Select all
#define GW_CHILD 5
#define GW_HWNDNEXT 2
function ProcessChilds( oDlg )
local hCtrl := GetWindow( oDlg:hWnd, GW_CHILD )
... your code ...
while hCtrl != 0
hCtrl = GetWindow( hCtrl, GW_HWNDNEXT )
... your code ...
end
return nil
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Here you have it:
Code: Select all
// (c) FiveTech Software, 2008
#include "FiveWin.ch"
function Main()
local oDlg
DEFINE DIALOG oDlg TITLE "Test"
@ 2, 2 BUTTON "Enum" ;
ACTION EnumChildWindows( oDlg:hWnd,;
{ | hChild, nLParam | MsgInfo( GetClassName( hChild ) ), .T. },; // .T. means continue
0 ) // optional supplied value
@ 2, 8 BUTTON "Another"
ACTIVATE DIALOG oDlg CENTERED
return nil
#pragma BEGINDUMP
#include <hbapi.h>
#include <hbapiitm.h>
#include <windows.h>
void hb_evalBlock( PHB_ITEM pCodeBlock, ... );
static PHB_ITEM pCodeBlock = NULL;
BOOL CALLBACK static EnumChildProc( HWND hWnd, LPARAM lParam )
{
PHB_ITEM pHWnd = hb_itemPutNL( NULL, ( LONG ) hWnd );
PHB_ITEM pParam = hb_itemPutNL( NULL, ( LONG ) lParam );
if( pCodeBlock )
hb_evalBlock( pCodeBlock, pHWnd, pParam, 0 );
hb_itemRelease( pHWnd );
hb_itemRelease( pParam );
return hb_parl( -1 );
}
HB_FUNC( ENUMCHILDWINDOWS )
{
HWND hWnd = ( HWND ) hb_parnl( 1 );
LPARAM lParam = ( LPARAM ) hb_parnl( 3 );
pCodeBlock = hb_param( 2, HB_IT_BLOCK );
hb_retl( EnumChildWindows( hWnd, EnumChildProc, lParam ) );
pCodeBlock = NULL;
}
#pragma ENDDUMP