STYLE WS_NOCAPTION

Post Reply
User avatar
Manuel Valdenebro
Posts: 706
Joined: Thu Oct 06, 2005 9:57 pm
Location: Málaga-España

STYLE WS_NOCAPTION

Post by Manuel Valdenebro »

En la barra superior de la ventana principal de una aplicación, quiero que aparezca lo siguiente:

Icono + Título + icono minimizar + icono maximizar y el icono "x" (cerrar) deshabilitado.

Casi lo consigo, definiendo la ventana asi:

DEFINE WINDOW oWnd TITLE cTitle MENU fMenu ICON oico ;
STYLE (WS_CAPTION, WS_MINIMIZEBOX, WS_MAXIMIZEBOX)

Todo correcto, pero desaparece el icono.

¿Alguna idea?

Un saludo y feliz fin de semana.
User avatar
Antonio Linares
Site Admin
Posts: 42449
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 20 times
Been thanked: 57 times
Contact:

Post by Antonio Linares »

Manuel,

Posiblemente tengas que añadir WS_POPUP
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Manuel Valdenebro
Posts: 706
Joined: Thu Oct 06, 2005 9:57 pm
Location: Málaga-España

Post by Manuel Valdenebro »

Antonio,

En primer lugar, muchas gracias por contestar.

He realizado el cambio que me indicas y no funciona. Te acompaño el módulo de samples teststyl.prg, con las modificaciones que he hecho y que no pita:

// Using alternatives window styles sample

#include "FiveWin.ch"

function Main()

local oWnd, oIco

DEFINE ICON oIco FILENAME "..\icons\Customer.ico"

DEFINE WINDOW oWnd FROM 8, 8 TO 20, 40 ;
TITLE "Testing Style Clause in Dialogs" ;
ICON oIco ;
STYLE nor (WS_POPUP, WS_CAPTION,WS_MINIMIZEBOX,WS_MAXIMIZEBOX)

ACTIVATE WINDOW oWnd MAXIMIZED
return nil

Un saludo
User avatar
Antonio Linares
Site Admin
Posts: 42449
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 20 times
Been thanked: 57 times
Contact:

Post by Antonio Linares »

Manuel,

Es WS_SYSMENU en vez de WS_POPUP. Mi error :)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Manuel Valdenebro
Posts: 706
Joined: Thu Oct 06, 2005 9:57 pm
Location: Málaga-España

Post by Manuel Valdenebro »

Antonio, sigue sin funcionar.- Ahora sale el icono, pero no desactiva la "x" de cerrar. Es como si no pusiera ningun Style. Este es el código:

// Using alternatives window styles sample

#include "FiveWin.ch"

function Main()

local oWnd, oIco

DEFINE ICON oIco FILENAME "..\icons\Customer.ico"

DEFINE WINDOW oWnd FROM 8, 8 TO 20, 40 ;
TITLE "Testing Style Clause in Dialogs" ;
ICON oIco ;
STYLE nor (WS_SYSMENU, WS_CAPTION,WS_MINIMIZEBOX,WS_MAXIMIZEBOX)

ACTIVATE WINDOW oWnd MAXIMIZED
return nil
User avatar
Antonio Linares
Site Admin
Posts: 42449
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 20 times
Been thanked: 57 times
Contact:

Post by Antonio Linares »

Manuel,

Puedes desactivar la "X" usando un WHEN .f.

Como prevees que salga el usuario de esa ventana ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Manuel Valdenebro
Posts: 706
Joined: Thu Oct 06, 2005 9:57 pm
Location: Málaga-España

Post by Manuel Valdenebro »

Antonio,

Funcionó con IF VALID.-

Muchas gracias.
Post Reply