Get Event from ActiveX

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

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

Get Event from ActiveX

Post 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 ) :?:
have fun
Jimmy
User avatar
danielmaximiliano
Posts: 2763
Joined: Fri Apr 09, 2010 4:53 pm
DBs Used: DBF
Location: Argentina
Contact:

Re: Get Event from ActiveX

Post 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
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
Telegram invitation https://t.me/HMGWorkspace
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: Get Event from ActiveX

Post 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
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: Get Event from ActiveX

Post 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
have fun
Jimmy
Post Reply