I try to include externals executables in a splitterGadget
I don't know if it's the good and more simple way for do this, but i put it in a container
And when i resize the splitter left to right, the exe loose his color and flickering
Have you an idea for adding fluidity ?
This is the zip with redwindow
https://prov.reec.fr/SplitterGadget.zip
and the code
Code: Select all
; https://www.purebasic.fr/english/viewtopic.php?p=45782#p45782
Procedure WindowProc(hWnd,Msg,wParam,lParam)
result = #PB_ProcessPureBasicEvents
If Msg = #WM_SIZE And hWnd = WindowID(0)
ResizeGadget(5,0,0,lParam&$FFFF,(lParam>>16)&$FFFF)
result = 0
ElseIf Msg = #WM_SIZE And hWnd = GadgetID(2)
RedrawWindow_(GadgetID(2), 0, 0, #RDW_INVALIDATE|#RDW_UPDATENOW)
result = 0
EndIf
ProcedureReturn result
EndProcedure
OpenWindow(0,0,0,800,600,"Split",#PB_Window_SystemMenu|#PB_Window_ScreenCentered|#PB_Window_SizeGadget)
ListIconGadget(1,0,0,0,0,"Title",200,#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection)
EditorGadget(3,0,0,0,0)
ContainerGadget(2,0,0,0,0)
CloseGadgetList()
; splitter1: listicon and editor1
SplitterGadget(4,0,0,500,300,1,2,#PB_Splitter_Vertical|#PB_Splitter_Separator)
SetGadgetState(4,350) ; Set splitter width
; splitter2: splitter1 and editor2
SplitterGadget(5,0,0,800,600,4,3,#PB_Splitter_Separator)
SetGadgetState(5,500) ; Set splitter width
SetWindowCallback(@WindowProc())
; Insert executable
RedWindow = RunProgram(GetPathPart(ProgramFilename()) + "FenetreRouge.exe","",GetPathPart(ProgramFilename()), #PB_Program_Open|#PB_Program_Hide)
If RedWindow
While hRedWindow = #Null
hRedWindow = FindWindow_(0, "RedWindow")
Wend
EndIf
SetParent_(hRedWindow, GadgetID(2))
ShowWindow_(hRedWindow, #SW_SHOWMAXIMIZED)
RedrawWindow_(GadgetID(2), 0, 0, #RDW_INVALIDATE|#RDW_UPDATENOW)
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
KillProgram(RedWindow)


