Using FoxPro to Test Presence of Icon in a Program Group

Last reviewed: April 29, 1996
Article ID: Q104472
The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, version 3.0
  • Microsoft FoxPro for Windows, versions 2.5 and 2.5a

To test for the existence of a particular icon within a program group in Program Manager, you can use dynamic data exchange (DDE) with PROGMAN.EXE, as follows:

  1. Using DDE, initiate a channel to Program Manager from FoxPro for Windows.

  2. Store the contents of the desired group to a memory variable by supplying the description of the program group:

          m.chan = DDEINITIATE("progman","progman")
          m.grp = DDEREQUEST(m.chan,"main","CF_TEXT")
    

    The m.grp memory variable will now contain a listing of all program items and their properties.

  3. Use <expC1> $ <expC2> to determine if the desired program item exists in the m.grp memory variable. The search is case sensitive; therefore, use the UPPER() function on both sides of the expression to ensure accurate results. This comparison will return true (.T.) if the expression was found.

          m.found = UPPER("write.exe") $ UPPER(m.grp)
    

The value stored in m.found will be the logical result of the search.


Additional reference words: VFoxWin 3.00 FoxWin 2.50 2.50a
KBCategory: kbinterop kbprg
KBSubcategory: FxinteropDde


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: April 29, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.