Page 1 of 1

refresh child window

Posted: Wed Mar 10, 2004 8:54 am
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.

Posted: Wed Mar 10, 2004 9:40 am
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)