Microsoft KB Archive/138782

{| = How to Call Windows Help Search Macro in FoxPro 2.x =
 * width="100%"|

ID: Q138782

The information in this article applies to:


 * Microsoft FoxPro for Windows, versions 2.5, 2.5a, 2.5b, 2.6, 2.6a

SUMMARY
This article shows by example how to use program code to invoke Windows Help and open the Search Macro.

MORE INFORMATION
Developers who write a custom Windows Help file for their application may also want to include program code that invokes the Help session and goes immediately to the Search macro. This can be done with the following example:

Create a program to contain the following code:

SET LIBRARY TO HOME+"FOXTOOLS.FLL"           && Locates Foxtools hhand=REGFN("WinHelp","LCIC","L") LPZFILENAME=HOME+"FOXHELP.HLP"+CHR(0) WCOMMAND=258 DWDATA="SEARCH"+CHR(0) MYCALL=MAINHWND HELP =CALLFN(hhand,MYCALL,LPZFILENAME,WCOMMAND,DWDATA) RELEASE HHAND SET LIBRARY TO                                 && Releases Foxtools NOTE: This code is intended for use with FoxPro Versions 2.x for Windows. While it will work under Visual FoxPro for Windows running under Windows 95, it can produce the following error with Visual FoxPro for Windows running under Windows 3.X:  Program Error: "Stack violation. Please check the parameters." For more information about code that will work with Visual FoxPro for Windows, please see the following article in the Microsoft Knowledge Base: ARTICLE-ID: Q138781 TITLE    : How to Call a Windows Help Search Macro by Using Code Additional reference words: 2.50 2.50a 2.50b 2.60 2.60a FoxWin stack violation KBCategory: kbtool kbhowto kbcode KBSubcategory: FxtoolWinhelp
 * }