LOCAL lnHWnd >>>>IF Thisform.ShowWindow = 2 && TopLevel Form >>>> lnHWnd=SYS(2327, SYS(2325, SYS(2326,Thisform.HWnd))) && From Craig Boyd >>>>ELSE >>>> lnHWnd = Thisform.HWnd >>>>ENDIFMy conclusion is that when scrollbars are added to a form, a new client window is inserted in it, and creates the confusion of handles...
#DEFINE GW_CHILD 5 DECLARE LONG GetWindow IN User32 LONG HWND, INTEGER nIndex Local lnHwnd lnHWND = Thisform.HWND DO WHILE .T. lnClientHwnd = GetWindow(lnHWND, GW_CHILD) IF lnClientHWND = 0 lnClientHWND = lnHWND EXIT ENDIF lnHWND = lnClientHWND ENDDO Thisform.AddProperty("RealHWND", lnHWND)Hope this helps !