Artículo original: ActiveX generic fix
http://www.foxpert.com/knowlbits_200804_1.htm
Autor: Christof Wollenhaupt
Traducido por: Ana María Bisbé York
Después de leer mi artículo ActiveFiX que trataba sobre la no respuesta de controles ActiveX, Carlos Alloatti llegó a una solución genérica del problema:
*!* Habilitar ventanas de controles ActiveX #Define GW_CHILD 5 #Define GW_HWNDNEXT 2 Declare Integer GetWindow In win32api As apiGetWindow ; Integer nhWnd, ; Integer uCmd Declare Integer RealGetWindowClass In win32api ; As apiRealGetWindowClass ; Integer nhWnd, ; String @pszType, ; Integer cchType Declare Integer EnableWindow In win32api As apiEnableWindow ; Integer nhWnd, ; Integer bEnable Local ; m.lnChildHWnd As Integer, ; m.lnCmd As Integer, ; m.lnEnable As Integer, ; m.lcClassName As String, ; m.lnBufferLen As Integer *!* Para probar, cambie m.lnEnable a 0 *!* para inhabilitar las ventanas OleControl m.lnEnable = 1 If Thisform.ShowWindow = 2 Or Thisform.ScrollBars > 0 Then m.lnChildHWnd = apiGetWindow(Thisform.HWnd, GW_CHILD) Else m.lnChildHWnd = Thisform.HWnd Endif m.lnCmd = GW_CHILD Do While .T. m.lnChildHWnd = apiGetWindow(m.lnChildHWnd, m.lnCmd) If m.lnChildHWnd = 0 Then Exit Endif m.lcClassName = Space(254) m.lnBufferLen = apiRealGetWindowClass(m.lnChildHWnd, ; @m.lcClassName, Len(m.lcClassName)) m.lcClassName = Left(m.lcClassName , m.lnBufferLen) If m.lcClassName == "CtlFrameWork_ReflectWindow" Then apiEnableWindow(m.lnChildHWnd, m.lnEnable) Endif m.lnCmd = GW_HWNDNEXT Enddo