Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't anybody answer this? 2

Status
Not open for further replies.

ripper12

Programmer
Mar 24, 2001
5
US
I want to build a Training Card system using WinHelp 4 in my VB6 app and have buttons on the Trainig Card intiate action in my vb program.

WinHelp describes WM_TCARD messages and states they are "sent to a program that has initiated a training card with the WinHelp program".

But, how do you receive the message in VB?

VB help doesn't help on this. Where's some good documentation on using WinHelp macros in VB?

Thanks!
 

You want to look for your WM_TCARD message in your VB program, and one way to do that is peek at the messages being sent to your program.

[tt]
Type MSG
hWnd As Long
message As Long
wParam As Long
lParam As Long
time As Long
pt As POINTAPI
End Type
Declare Function PeekMessage Lib "user32" Alias "PeekMessageA" (lpMsg As MSG, ByVal hWnd As Long, ByVal wMsgFilterMin As Long, ByVal wMsgFilterMax As Long, ByVal wRemoveMsg As Long) As Long

Public Const PM_NOREMOVE = &H0
Public Const PM_NOYIELD = &H2
Public Const PM_REMOVE = &H1

'-----------------------------

Dim whMsg as MSG
Dim bRC as Boolean

Do
bRC = PeekMessage(whMsg, 0, WM_TCARD, WM_TCARD, PM_REMOVE Or PM_NOYIELD)

If bRC Then
' Process the message in whMsg.

' Look at the definition of WM_TCARD in MSDN
' to see what it's contents are.

End If

' Be nice and DoEvents
DoEvents
Loop
[/tt]

Hope this helps.

Chip H.

 
Thanks, Chip - that looks like the answer. I'll try it out.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top