refresh child window

Windows specific forum
User avatar
Le Soldat Inconnu
Enthusiast
Enthusiast
Posts: 306
Joined: Wed Jul 09, 2003 11:33 am
Location: France

refresh child window

Post by Le Soldat Inconnu »

Hello

I have problem to refresh child window.
For testing, I use PureBasic editor.
I make a new window and set PureBasic editor child of my window

Code: Select all

WindowE = GetForegroundWindow_()

OpenWindow(0, 200, 200, 500, 500, #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget, "Options")

SetWindowLong_(WindowE, #GWL_STYLE, GetWindowLong_(WindowE, #GWL_STYLE) | #WS_CHILD)
SetParent_(WindowE, WindowID())

MoveWindow_(WindowE, 0, 0, 400, 400, 1)



Repeat
  Event = WaitWindowEvent()
  
Until Event = #WM_CLOSE

SetWindowLong_(WindowE, #GWL_STYLE, GetWindowLong_(WindowE, #GWL_STYLE) ! #WS_CHILD)
SetParent_(WindowE, 0)
Thanks

Excuse me for mystakes.
LSI
User avatar
Le Soldat Inconnu
Enthusiast
Enthusiast
Posts: 306
Joined: Wed Jul 09, 2003 11:33 am
Location: France

Post by Le Soldat Inconnu »

YES, I find the solution :D

Code: Select all

WindowE = GetForegroundWindow_()

OpenWindow(0, 200, 200, 500, 500, #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget | #WS_CLIPCHILDREN, "Options")

SetWindowLong_(WindowE, #GWL_EXSTYLE, GetWindowLong_(WindowE, #GWL_EXSTYLE) | #WS_EX_MDICHILD)
SetParent_(WindowE, WindowID())

MoveWindow_(WindowE, 0, 0, 400, 400, 1)



Repeat
  Event = WaitWindowEvent()
  
Until Event = #WM_CLOSE

SetWindowLong_(WindowE, #GWL_EXSTYLE, GetWindowLong_(WindowE, #GWL_EXSTYLE) ! #WS_EX_MDICHILD)
SetParent_(WindowE, 0)
LSI
Post Reply