Page 1 of 1

Get Event from ActiveX

Posted: Mon Nov 22, 2021 6:38 am
by AUGE_OHR
hi,

while search for "Shell.Explorer.2" i found Sample X:\hmg.3.4.4\HARBOUR\contrib\gtwvg\tests\_activex.prg

Code is written by Pritpal Bedi using Xbase++ OOP Style and have its Method & Property
now i saw this Code

Code: Select all

      oCom:CLSID := "Shell.Explorer.2"
      oCom:mapEvent( 269, {|| wapi_OutputDebugString( " E X P L O R E R - 2 6 9" ) } )
      oCom:mapEvent( 105, {|| wapi_OutputDebugString( " E X P L O R E R - 105"   ) } )
it is to "get" a (Notify) Event from ActiveX an "react" on it ( Codeblock )

---

Question : can i use (lib)GTWVG.a together with HMG :idea:

i know GTWVG is based on Terminal but for ActiveX i do not need Console Window for In/Out-Put

---

Future Request :

now we can use ActiveX "one Way" but we can not "receive" (Notify) Event "from" ActiveX to "react"
it would be nice when get "mapEvent" for HMG / MiniGUI

p.s. did someone know where to get Source of GTWVG ( include C-Code ) :?:

Re: Get Event from ActiveX

Posted: Tue Nov 23, 2021 12:10 am
by danielmaximiliano
Hola Jimmy : GTWVG es una contibucion en Harbour y se encuentra dentro de su paquete C:\harbour\contrib\gtwvg
sino lo tiene se encuentra dentro del repositorio Harbour . Gitub https://github.com/harbour/core/tree/ma ... trib/gtwvg

Re: Get Event from ActiveX

Posted: Tue Nov 23, 2021 7:20 am
by AUGE_OHR
hi Daniel,

thx for link.

i do found GTWVG-master.zip\core-master\contrib\hbwin\

and this Sample
GTWVG-master.zip\core-master\contrib\hbwin\tests\activex.prg

it include win_axGetControl()
GTWVG-master.zip\core-master\contrib\hbwin\axfunc.prg

Code: Select all

FUNCTION win_axGetControl( hWnd, bHandler, cID )
LOCAL oAx := win_oleAuto()
   oAx:__hObj := __axGetControl( hWnd )
   IF bHandler != NIL
      oAx:__hSink := __axRegisterHandler( oAx:__hObj, bHandler, cID )
   ENDIF
RETURN oAx
it does install a "Sink" where a Codeblock is assign and a ID

Question : "where" do i get ID for e.g. "Shell.Explorer.2" :?:

---

you can use "Shell.Explorer.2" to "navigate" to a Website.

i want to avoid it when get "BeforeNavigate2" Event
https://docs.microsoft.com/en-us/previo ... 0(v=vs.85)

Code: Select all

FUNCTION EventInfo( event, aParams, pParams )
   IF event == "BeforeNavigate2"
      SetEventParam( pParams, 7, .t. ) // Comment this to allow navigation
   ENDIF
RETURN NIL

Re: Get Event from ActiveX

Posted: Tue Nov 23, 2021 10:32 pm
by AUGE_OHR
hi,

i found out that MiniGUI does use "MapEvent" :)

Code: Select all

c:\minigui\Samples\ActiveX\
seems i have to change to MiniGUI