How to Call Windows Help Search Macro in FoxPro 2.x

Last reviewed: October 29, 1995
Article 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


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: October 29, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.