Focus "into" ActiveX Control

Discuss anything else that does not suite other forums.

Moderator: Rathinagiri

Post Reply
User avatar
AUGE_OHR
Posts: 2062
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Focus "into" ActiveX Control

Post by AUGE_OHR »

hi,

i have put a ActiveX into a FMG.
it does load file and show it

Code: Select all

   ShowHtml.Activex_1.Object:Navigate(cFile)
   ShowHtml.Activex_1.SetFocus
   Activate Window ShowHtml
now the Focus is not "inside" ActiveX so i must click into it to scroll it
i have try

Code: Select all

   ShowHtml.Activex_1.Object.SetFocus
   ShowHtml.Activex_1.Object:SetFocus
but this Syntax was wrong. :(
who can help me please with Syntax.
have fun
Jimmy
User avatar
SALINETAS24
Posts: 667
Joined: Tue Feb 27, 2018 3:06 am
DBs Used: DBF
Contact:

Re: Focus "into" ActiveX Control

Post by SALINETAS24 »

Hola Auge, no he utilizado ese tipo de control, pero prueba con
DoMethod( cWind, cCtrol, 'SetFocus' )
y también tienes
SetProperty("ShowHtml","Activex_1","setFocus",.t.)

Suerte...!!
Como dijo el gran pensador Hommer Simpson..., - En este mundo solo hay 3 tipos de personas, los que saben contar y los que no. :shock:
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: Focus "into" ActiveX Control

Post by andyglezl »

Parece que ese control no tiene ese método o propiedad...
*------------------------------------------------------------------------
It seems that control does not have that method or property ...

hmgdoc/data/index.htm



Revisando en mi código, yo lo maneje hace algún tiempo así
(dentro de una ventana PANEL)
*-------------------------------------------------------------------------
Checking in my code, I handled it some time ago like this
(inside a PANEL window)

Code: Select all

	DEFINE WINDOW cWinPso ROW 030 COL 000 WIDTH nWinWidth HEIGHT nWinHeight-45 PANEL BACKCOLOR GRAY
		_DefineActivex('PagWeb', cWinPso, 000, 000, 1024, nWinHeight-45, "shell.explorer" )
		oPagina := GetProperty( cWinPso, 'PagWeb', 'Object')
		oPagina:Navigate( "http://www.net2ftp.com/index.php" )
		DOMETHOD( cWinPso, "SetFocus")
		_PushKey( VK_DOWN )
	END WINDOW	
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
luisvasquezcl
Posts: 1258
Joined: Thu Jul 31, 2008 3:23 am
Location: Chile
Contact:

Re: Focus "into" ActiveX Control

Post by luisvasquezcl »

Try with:
ShowHtml.Activex_1.Object:document.getElementById("my_control").focus()
User avatar
AUGE_OHR
Posts: 2062
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: Focus "into" ActiveX Control

Post by AUGE_OHR »

luisvasquezcl wrote: Mon Dec 16, 2019 5:18 pm Try with:
ShowHtml.Activex_1.Object:document.getElementById("my_control").focus()
thx for Tip but
C:\hmg.3.4.4\0\MAIL\email.prg(1628) Error E0030 Syntax error "syntax error at '.'"
but is is the same Idea as i had but i fail too

Code: Select all

PROCEDURE DoPreShow()
      hWnd := GetControlHandle( 'Activex_1', "ShowHtml" )
      FindDocObject(hWnd)
RETURN

FUNCTION FindDocObject(hWnd)
LOCAL nRet := 0
ALTD()
   nRet := FindWindowEx(hWnd,0,"Internet Explorer_Server",0)
   IF nRet > 0
      Set_Focus(nRet)
   ELSE
      nRet := FindWindowEx(hWnd,0,"Shell DocObject View",0)
      IF nRet > 0
         Set_Focus(nRet)
      ELSE
         nRet := FindWindowEx(hWnd,0,0,"Shell DocObject View")
         IF nRet > 0
            Set_Focus(nRet)
         ELSE
            nRet := FindWindowEx(hWnd,0,0,"Internet Explorer_Server")
            IF nRet > 0
               Set_Focus(nRet)
            ENDIF
         ENDIF
      ENDIF
   ENDIF

RETURN nRet
none of them find "Child" in Form ... :cry:
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2062
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: Focus "into" ActiveX Control

Post by AUGE_OHR »

hi

have try more and found "." Problem

Code: Select all

ShowHtml.Activex_1.Object:document:getElementById(
but than i got the Error
NoFocus.jpg
NoFocus.jpg (53.33 KiB) Viewed 1945 times
i will try more ... but i guess it simple does not work with HMG

ActiveX of HMG seems limited to CreateObject() so you can Call it but not react on Event :cry:
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2062
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: Focus "into" ActiveX Control

Post by AUGE_OHR »

i still try to set Focus into AX Control.

now i saw in Debugger :shock:
AX_HWND.png
AX_HWND.png (106.26 KiB) Viewed 1925 times
i got Hwnd this Way

Code: Select all

   hWnd := GetControlHandle( 'Activex_1', "ShowHtml" )
so what can make the Difference :?:

p.s. the App i use is WinID https://www.dennisbabkin.com/winid/
have fun
Jimmy
Post Reply