FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Siempre "on top"
Posts: 230
Joined: Sat Apr 19, 2008 10:28 PM
Siempre "on top"
Posted: Sat Jan 24, 2009 04:05 PM

Buenas tardes,

¿Hay alguna forma de que la ventana principial de un programa en FWH esté siempre encima de otras aplicaciones de windows, aunque no tenga el foco?
He buscado en el foro y no lo he encontrado.

Muchas gracias.

Alvaro

Posts: 1076
Joined: Fri Oct 07, 2005 10:41 PM
Re: Siempre "on top"
Posted: Sat Jan 24, 2009 04:28 PM

alvaro,

SetWindowPos( oWnd:hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE |;
SWP_NOSIZE |;
SWP_SHOWWINDOW |;
SWP_NOACTIVATE )

William, Morales

Saludos



méxico.sureste
Posts: 230
Joined: Sat Apr 19, 2008 10:28 PM
Re: Siempre "on top"
Posted: Sat Jan 24, 2009 06:04 PM

Muchas gracias.

Al compilar me da este error:

.\source\FSIFR.PRG(89) Error E0030 Syntax error: "syntax error at '|'"

¿hace falta algun header?

¿luego como se quita que esté "on top"?

Gracias por tu ayuda.

Alvaro

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Siempre "on top"
Posted: Sat Jan 24, 2009 06:59 PM

Alvaro,

Tienes que llamar a la función nOr() en vez de a "|":

nOr( SWP_NOMOVE, SWP_NOSIZE, SWP_SHOWWINDOW, SWP_NOACTIVATE )

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 230
Joined: Sat Apr 19, 2008 10:28 PM
Re: Siempre "on top"
Posted: Sat Jan 24, 2009 11:46 PM

Muchas gracias a los dos.

Alvaro

static ontop:=.t.
SetWindowPos( oWnd:hWnd, if( ontop , HWND_TOPMOST , HWND_NOTOPMOST ) , 0, 0, 0, 0, ;
nOr( SWP_NOMOVE, SWP_NOSIZE, SWP_SHOWWINDOW, SWP_NOACTIVATE ) )
ontop:=!ontop

define SWP_NOSIZE 0x0001

define SWP_NOMOVE 0x0002

define SWP_NOZORDER 0x0004

define SWP_NOREDRAW 0x0008

define SWP_NOACTIVATE 0x0010

define SWP_FRAMECHANGED 0x0020 / The frame changed: send WM_NCCALCSIZE /

define SWP_SHOWWINDOW 0x0040

define SWP_HIDEWINDOW 0x0080

define SWP_NOCOPYBITS 0x0100

define SWP_NOOWNERZORDER 0x0200 / Don't do owner Z ordering /

define SWP_NOSENDCHANGING 0x0400 / Don't send WM_WINDOWPOSCHANGING /

define HWND_TOPMOST -1

define HWND_NOTOPMOST -2

Continue the discussion