In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

EnumWindows

Xailer English public forum
Responder
Guest

EnumWindows

Mensaje por Guest »

Is the api function EnumWindows available in Xailer? I get a link
error, when trying to use it.
When a related function, IsWindowVisible, is used, no problems.
The purpose is to just try to get a list of Top level, visible windows,
without having to resort to a third-party library.
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9440
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

EnumWindows

Mensaje por ignacio »

Childers escribió el sáb, 23 junio 2012 03:38Is the api function EnumWindows available in Xailer? I get a link
error, when trying to use it.
When a related function, IsWindowVisible, is used, no problems.
The purpose is to just try to get a list of Top level, visible windows,
without having to resort to a third-party library.
Dear Sir,
That function can not be easily used at the PRG level, since it requires a callback function. BTW, I include in this message a small function to retrieve all the window handles.
Regards,

#pragma BEGINDUMP
#include <windows.h>
#include <xailer.h>
static BOOL CALLBACK EnumWndProc( HWND hWnd, LPARAM lParam )
{
if( IsWindow( hWnd ) )
{
PHB_ITEM pItem = hb_itemNew( NULL );
hb_arrayAddForward( (PHB_ITEM) lParam, hb_itemPutNL( pItem, (long) hWnd ) );
}

return TRUE;
}
//------------------------------------------------------------------------------
HB_FUNC( ENUMWINDOWS )
{
PHB_ITEM aWindows = hb_itemArrayNew( 0 );
EnumWindows( EnumWndProc, (LPARAM) aWindows );
hb_itemReturnForward( aWindows );
hb_itemRelease( aWindows );
}
#pragma ENDDUMP

Ignacio Ortiz de Zúñiga
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
Guest

EnumWindows

Mensaje por Guest »

Ok, I'll take a look at it, thanks Ignacio.
I've got another problem, a different kind. It's not really
Xailer-specific, but I just wanted to see if you have any insight. Will
forward in a separate email.
Responder