.ctl32_dwExStyle = 0 .ctl32_lpClassName = [msctls_progress32] .ctl32_lpWindowName = .ctl32_lpClassName + SYS(2015) .ctl32_dwStyle = Bitor(WS_CHILD, WS_CLIPSIBLINGS) .ctl32_hWndParent = .ctl32_HostHwnd .ctl32_Left = .Left .ctl32_Top = .Top .ctl32_Width = .Width .ctl32_Height = .Height .ctl32_hMenu = 0 .ctl32_hInstance = GetWindowLong(.ctl32_HostHwnd, GWL_HINSTANCE) .ctl32_lpParam = 0 .ctl32_ControlHwnd = CreateWindowEx( ; .ctl32_dwExStyle, ; .ctl32_lpClassName, ; .ctl32_lpWindowName, ; .ctl32_dwStyle, ; .ctl32_Left, ; .ctl32_Top, ; .ctl32_Width, ; .ctl32_Height, ; .ctl32_hWndParent, ; .ctl32_hMenu, ; .ctl32_hInstance, ; .ctl32_lpParam) .ctl32_OldProc = GetWindowLong(_vfp.HWnd, GWL_WNDPROC) Bindevent(This.ctl32_controlHwnd, WM_PAINT, This, [ctl32_WM_Paint], 1)I understand that this window, although is a child of a VFP form, somehow its not part of the VFP message queue, or something like that.
If .Flat = .T. SetWindowLong(.ctl32_ControlHwnd, GWL_EXSTYLE, 0) Else SetWindowLong(.ctl32_ControlHwnd, GWL_EXSTYLE, WS_EX_STATICEDGE) Endif *!* Refresh control window so frame change gets redrawn SetWindowPos(.ctl32_ControlHwnd, ; HWND_TOP, ; 0, ; 0, ; 0, ; 0, ; BITOR(SWP_NOMOVE, SWP_NOSIZE, SWP_NOZORDER, SWP_FRAMECHANGED))And this is how I draw the black border:
m.lnDC = GetDC(.ctl32_ControlHwnd) m.lcRect = Space(16) GetClientRect(.ctl32_ControlHwnd, @m.lcRect) m.lnLeft = .uStrToLong(Substr(m.lcRect, 1,4)) m.lnTop = .uStrToLong(Substr(m.lcRect, 5,4)) m.lnRight = .uStrToLong(Substr(m.lcRect, 9,4)) - 1 m.lnBottom = .uStrToLong(Substr(m.lcRect, 13,4)) - 1 MoveToEx(m.lnDC, m.lnLeft, m.lnTop, []) LineTo(m.lnDC, m.lnRight, m.lnTop) LineTo(m.lnDC, m.lnRight, m.lnBottom) LineTo(m.lnDC, m.lnLeft, m.lnBottom) LineTo(m.lnDC, m.lnLeft, m.lnTop) ReleaseDC(.ctl32_ControlHwnd, m.lnDC)The only thing left is to have ctl32_WM_Paint fire every time the control window receives a WM_PAINT message.