Conditionally Activating a Button in Windows HelpLast reviewed: May 2, 1996Article ID: Q76534 |
The information in this article applies to:
SUMMARYAn application can add buttons to the Windows Help engine button bar. There may be times when the button should be activated or deactivated based on an external condition. For example, if an application adds a tutorial button to the bar and the user has not chosen to install the tutorial, the button should be dimmed to indicate that the tutorial is not available.
MORE INFORMATIONThe following code fragment demonstrates activating and deactivating buttons using the macro facility:
char szMacro[255]; . . . /* Bring up the Help engine with the HLP file */ /* This code fragment assumes that a button has */ /* been defined with an ID of TUTORIAL_BUTTON */WinHelp (hWnd, lpHelpFile, HELP_CONTENTS, 0L) if (fTutorial) /* If the tutorial is installed, the macro should enable the button */ lstrcpy(szMacro,"EnableButton(`TUTORIAL_BUTTON')");else /* If the tutorial is not installed, the macro should disable the button */ lstrcpy(szMacro,"DisableButton(`TUTORIAL_BUTTON')"); /* Note that the single quote character before TUTORIAL must be a backquote /* (`) for the function to work correctly. /* Run the appropriate macro */WinHelp (hWnd, lpHelpFile, HELP_COMMAND, (LONG)szMacro);
|
Additional reference words: 3.10 3.50 4.00 95 grayed out disabled
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |