Link to home
Start Free TrialLog in
Avatar of KIRK50
KIRK50

asked on

Need Microsoft Agent samples/code

Hi All,
I am creating an online HELP program for a Win NT 4 system, and I have been toying with the MS Agent control.  I could sure use some sample code (besides HELLO WORLD on the MS site) and perhaps a good web site, for code examples.  Namely, I'm having problems coding the click event on the character.  I want to "do something" after the pop up menu comes on screen, and I don't know how to code that.  Any help/samples/url's would be great!
Thanks!



ASKER CERTIFIED SOLUTION
Avatar of waty
waty
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of KIRK50
KIRK50

ASKER

Waty,

Thanks, as always, for the help ... very good stuff.  Now, just one LITTLE question I want to ask.  What code does it take to manipulate the pop up menu, and then activate one of the pop up menu events?  I can get items into the pop up menu, but I don't understand how to make the click event on one of the items work!

Please help!!!  Thanks!

 
Avatar of KIRK50

ASKER

Waty,

P.S.  How do I "call" the public functions in the regular program?  And do I have to specify somewhere else in my program the character ID and name, or perhaps prompt the user to choose between a couple of choices?  Please lend me a hand with those two questions, and the one about activating the popup menu!

Thanks!

-- Kirk
To start the agent :
' *** Character agent
Call Agent_Init(MyAgent, GetWindowsDirectory() & "msagent\chars\Merlin.acs", gbAssistant)
   If (gbSoundAssistant = False) Then Character.SoundEffectsOn = False

To call :
Call Agent_SearchNotFound("Search not found")



NB : Wich popup menu in the previous comment?
Avatar of KIRK50

ASKER

Waty,

The menu I mentioned is a little popup menu you can program to show a few possible choices, like HIDE, SHOW, Show The Voice Commands Window, etc.  It looks like this in code:

(assuming you have already DIM'd genie, set datapath, etc...)

Dim cmd1 As IAgentCtlCommandEx

' WhatUP appears in popupmenu when activated ... like this...
Set cmd1 = Genie.Commands.Add("WhatUP", "WhatUP")  

' then to activate the popup menu on screen, do this
Genie.ShowPopupMenu 150, 150      


So the question is, after the popup menu appears, you should be able to click on WhatUP and go somewhere, however, right now
I don't know how to program it!  Where does it go, and how does
it work??  Thanks again!

-- Kirk


Avatar of KIRK50

ASKER

Hi Waty,

Just wanted to know if you had any code, or could teach me, how to manipulate/respond to a user clicking on the popup menu?
Or, just as good, how do you get the genie to respond to events?  Do you put questions (Yes,No, Ok, Cancel) in his balloon or something?  If so, how?  Okay, sorry to bother you!
Thanks!

No, I have not done this, I have only used this to "display" with the sound some messages, and also read some titles of news.
Avatar of KIRK50

ASKER

Ok, thanks!  Appreciate the help!

-- Kirk