Hallo Leute,
möchte das Parent nach Wahl versenken und BlackUp aufrufen.
Am Blackup muss man mehrmals Exit drücken das es reagiert!
Code: Alles auswählen
; Parent Child mit Window
ExamineDesktops()
Enumeration
#Wnd_Parent
#Wnd_Child
#Wnd_ChildButton_BlackUp
#Wnd_ChildButton_Exit
#Parent_BlackUp
#Child_BlackUp
#Btn_BlackUp
EndEnumeration
Global Wnd_Windows_X = 400
Global Wnd_Windows_Y = 300
Global Windows_X = 0
Global Windows_Y = 0
Global ParentChild_X = DesktopWidth(0) - (DesktopWidth(0)/2)
Global ParentChild_Y = DesktopHeight(0) - (DesktopHeight(0)/2)
Procedure Wnd_BlackUp()
OpenWindow(#Parent_BlackUp,300,0,Wnd_Windows_X, Wnd_Windows_Y,"Wnd_BlackUp",#PB_Window_Invisible)
OpenWindow(#Child_BlackUp,300,0,Wnd_Windows_X, Wnd_Windows_Y,"Wnd_BlackUp",#PB_Window_BorderLess,WindowID(#Parent_BlackUp))
SetWindowColor(#Parent_BlackUp,$507FFF )
ButtonGadget(#Btn_BlackUp,10,10,100,200,"BlackUp Exit")
EndProcedure
Procedure Wnd_BlackUp_Events(EEventID,WWindowNr)
Static Key.l
;{ Windows mit Maus ziehen
If EEventID = #WM_LBUTTONDOWN
; Windows mit Maus verschieben
If WWindowNr = #Child_BlackUp
If Wnd_Windows_Maus_Sperre = 0
ReleaseCapture_()
SendMessage_(WindowID(#Child_BlackUp), #WM_NCLBUTTONDOWN, #HTCAPTION,0)
EndIf
EndIf
EndIf
;}
Select EEventID
;{ SELECT
Case #PB_Event_SizeWindow
Debug "BlackUp SizeWindow"
Case #PB_Event_MoveWindow
Debug "BlackUp MoveWindow"
Case #PB_Event_Gadget
; GADGET
Select EventGadget()
Case #Btn_BlackUp
CloseWindow(#Child_BlackUp)
CloseWindow(#Parent_BlackUp)
SetWindowState(#Wnd_Child,#PB_Window_Maximize)
SetWindowState(#Wnd_Parent,#PB_Window_Maximize)
EndSelect
Case #PB_Event_Timer
; TIMER
Select EventTimer()
; LEER
EndSelect
Case #PB_Event_Menu
; MENUE
Select EventMenu()
; LEER
EndSelect
Case #WM_KEYUP
; TASTEN
Key.l = EventwParam()
Select KEY
Case 27
CloseWindow(#Child_BlackUp)
CloseWindow(#Parent_BlackUp)
EndSelect
;}
EndSelect
EndProcedure
Procedure Wnd_ParentChild()
OpenWindow(#Wnd_Parent, Windows_X, Windows_Y, ParentChild_X, ParentChild_Y, "Velindos CATCHER",#PB_Window_Invisible)
OpenWindow(#Wnd_Child,Windows_X,Windows_Y,ParentChild_X ,ParentChild_Y,"Velindos CATCHER",#PB_Window_BorderLess,WindowID(#Wnd_Parent))
SetWindowColor(#Wnd_Child, $000000)
ButtonGadget(#Wnd_ChildButton_BlackUp,10,10,100,200,"BlackUp")
ButtonGadget(#Wnd_ChildButton_Exit,110,10,100,200,"Exit")
EndProcedure
Procedure Wnd_Child_Event(EEventID)
Static Key.l
Select EEventID
Case #PB_Event_SizeWindow
Debug "Parent SizeWindow"
Case #PB_Event_MoveWindow
Debug "Parent MoveWindow"
Case #PB_Event_Gadget
; GADGET
Select EventGadget()
Case #Wnd_ChildButton_BlackUp
SetWindowState(#Wnd_Child,#PB_Window_Minimize)
SetWindowState(#Wnd_Parent,#PB_Window_Minimize)
Wnd_BlackUp()
Case #Wnd_ChildButton_Exit
CloseWindow(#Wnd_Child)
CloseWindow(#Wnd_Parent)
End
Case #WM_KEYUP
;- TASTEN
Key.l = EventwParam()
Select KEY
Case 27
CloseWindow(#Wnd_Child)
CloseWindow(#Wnd_Parent)
End
EndSelect
EndSelect
EndSelect
EndProcedure
;- >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;- RUN
Wnd_ParentChild()
;- >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;- REPEAT
Repeat
EventID = WaitWindowEvent()
WindowNr = EventWindow()
Select WindowNr
Case #Wnd_Child
;{ PRESENT
If EEventID = #WM_LBUTTONDOWN
If WindowNr = #Wnd_Parent
ReleaseCapture_()
SendMessage_(WindowID(#Wnd_Parent), #WM_NCLBUTTONDOWN, #HTCAPTION, #Wnd_Child)
ElseIf WindowNr = #Wnd_Child
ReleaseCapture_()
SendMessage_(WindowID(#Wnd_Child), #WM_NCLBUTTONDOWN, #HTCAPTION, #Wnd_Parent)
EndIf
EndIf
; Events
Wnd_Child_Event(EventID)
;}
Case #Child_BlackUp
;{ #Wnd_BlackUp
Wnd_BlackUp_Events(EventID,WindowNr)
;}
EndSelect
ForEver
;}
;- >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Wenn ich das erste Fenster aufrufe, wird das Windows nicht in der Taskleiste angezeigt, beim Aufruf vom BlackUp wird es plötzlich angezeigt, was ich nicht will, warum?
Gruss Velindos!