RE:Ventana POPUP en MAIN o MDI
No se a que ejemplo de refieres, pero por si sea diferente aquí te envio los objetos, son dos y lo que tienes que hacer es importar a tu librería y listo.
Le abres de la siguiente maner desde donde tú quieras:
openwithparm(w_messenger , "mensage_a_mostrar")
********************************************************************************
Este código le guardas como: w_messenger.srw
-----------------------------------------------------------------------------------------------------
$PBExportHeader$w_messenger.srw
forward
global type w_messenger from window
end type
type st_1 from st_uo_transparent within w_messenger
end type
type p_1 from picture within w_messenger
end type
type st_messenger from st_uo_transparent within w_messenger
end type
type p_messenger from picture within w_messenger
end type
type st_contador from statictext within w_messenger
end type
end forward
global type w_messenger from window
boolean visible = false
integer x = 1650
integer y = 2160
integer width = 827
integer height = 516
boolean border = false
windowtype windowtype = popup!
long backcolor = 8388608
st_1 st_1
p_1 p_1
st_messenger st_messenger
p_messenger p_messenger
st_contador st_contador
end type
global w_messenger w_messenger
type prototypes
Public Function Long SetWindowPos (Long hWnd, Long hWndInsertAfter, Long lx, Long ly, Long cx, Long cy, Long wFlags) library "user32"
FUNCTION boolean sndPlaySoundA (string SoundName, uint Flags)LIBRARY "winmm.dll"
end prototypes
type variables
Constant Long HWND_TOPMOST = -1
Constant Long HWND_NOTOPMOST = -2
Constant Long SWP_NOSIZE = 1
Constant Long SWP_NOMOVE = 2
Constant Long SWP_NOACTIVATE = 30
Constant Long SWP_SHOWWINDOW = 64
// Instances variables
Long BorderSize, TitleSize, dX, dY, ScreenWidth, ScreenHeight
Long Left
Long Top_Max
Long Top_Min
Long Top_Top
Long Top_Baj
Boolean Top
Long Refresh
int Interrup
end variables
event open;// Setea Flotante y en la Pos. de la Tray
SetWindowPos (Handle (This), HWND_TOPMOST, 0,2856,0,0, SWP_NOACTIVATE + SWP_SHOWWINDOW + SWP_NOMOVE + SWP_NOSIZE)
environment env
GetEnvironment (env)
ScreenWidth = env.ScreenWidth
ScreenHeight = env.ScreenHeight
// Esto es para solucionar
// Al final lo debo poner Falso para el aspecto de salir de adentro
// solo otra ventana lo tapara.
This.BringToTop = False
// Seteos
Timer (0.01) // Tiempo del evento Timer
Interrup = 10000 // Tiempo de Interrupcion
Refresh = 2 // Incremento para Subir y bajar el Aviso
// Aquí es donde se juega con las posiciones para
// ubicar la ventana
//Posiciones para la ventana de Aviso
Left = 2830
//Estas variaran en el evento Timer
Top_Max = 2160
Top_Min = 1658
//Estas seran parametros de control
Top_Top = 2160
Top_Baj = 1658
Top = False // LLave Control
St_Messenger.Text="Wend Systems"
st_1.Text = Message.StringParm
sndPlaySoundA("Type.wav",3)
end event
on w_messenger.create
this.st_1=create st_1
this.p_1=create p_1
this.st_messenger=create st_messenger
this.p_messenger=create p_messenger
this.st_contador=create st_contador
this.Control[]={this.st_1,&
this.p_1,&
this.st_messenger,&
this.p_messenger,&
this.st_contador}
end on
on w_messenger.destroy
destroy(this.st_1)
destroy(this.p_1)
destroy(this.st_messenger)
destroy(this.p_messenger)
destroy(this.st_contador)
end on
event timer;//Posicionar Sobre TrayBar esperando mostrar msge
Int n
n=0
This.x = (ScreenWidth - This.Width) + Left
This.y = (ScreenHeight - This.Height) + Top_Max
Choose Case Top
Case False // Comienza a subir el Aviso
If Top_Max >= Top_Min Then
Top_Max = Top_Max - Refresh
end if
If Top_Max = (Top_Min + Refresh) Then
//Momento en que se interrumpe antes de bajar
For n = 1 to Interrup
st_Contador.Text = String(n) //Solo para activar el for next
yield()
next
Top = True
end if
Case True // Comienza a bajar el Aviso
if Top_Min <= Top_Baj Then
Top_Max = Top_Max + Refresh
end if
// Cerrar el Aviso
If Top_Max = Top_Top Then Close(This)
End choose
end event
type st_1 from st_uo_transparent within w_messenger
integer x = 27
integer y = 120
integer width = 782
integer height = 384
integer textsize = -8
integer weight = 400
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
string text = "Esta es una prueba de ventansa de mensajes"
alignment alignment = left!
end type
type p_1 from picture within w_messenger
integer x = 741
integer y = 36
integer width = 64
integer height = 48
boolean originalsize = true
string picturename = "close.jpg"
boolean focusrectangle = false
end type
event clicked;Halt Close
end event
type st_messenger from st_uo_transparent within w_messenger
integer x = 123
integer y = 24
integer width = 585
integer height = 68
integer textsize = -9
integer weight = 700
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
boolean italic = true
long backcolor = 16777215
string text = " "
end type
type p_messenger from picture within w_messenger
integer width = 827
integer height = 520
string picturename = "Messenger.JPG"
boolean focusrectangle = false
end type
type st_contador from statictext within w_messenger
integer x = 713
integer y = 408
integer width = 96
integer height = 64
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "System"
string text = " "
alignment alignment = center!
boolean focusrectangle = false
end type
********************************************************************************
Este código le guardas como: st_uo_transparent.sru
-----------------------------------------------------------------------------------------------------
$PBExportHeader$st_uo_transparent.sru
forward
global type st_uo_transparent from statictext
end type
end forward
global type st_uo_transparent from statictext
integer width = 251
integer height = 72
fontcharset fontcharset = ansi!
string facename = "System"
string text = "None"
alignment alignment = center!
event ue_paint pbm_paint
end type
global st_uo_transparent st_uo_transparent
type variables
boolean ib_Painting
end variables
event ue_paint;if IsValid(this) then
if ib_Painting then return 0
ib_Painting = TRUE
this.visible = false
do while yield() ; loop
this.visible = true
ib_painting=false
end if
return 0
end event
event constructor;call super::constructor;this.BackColor = 2^29
end event
on st_uo_transparent.create
end on
on st_uo_transparent.destroy
end on