Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
This function enables or disables individual soft keys by command identifier or index.
Note: |
---|
Beginning with Windows Mobile 6.5.3, soft keys are replaced by touchable tiles on Windows Mobile Professional phones. |
Syntax
HRESULT SHEnableSoftkey( HWND hwndMenuBar, UINT uid, BOOL bByIndex, BOOL bEnable ); |
Parameters
- hwndMenuBar
-
[in] Handle to the soft key bar as returned from SHCreateMenuBar .
- uid
-
The command identifier of the soft key or the index (0 or 1). If a soft key, then 0 indicates SK1 and 1 indicates SK2.
- bByIndex
-
Set to TRUE if the uidparameter is an index, FALSE if it is a command identifier.
- bEnable
-
Set to TRUE to enable the soft key, FALSE to disable it.
Return Value
S_OKindicates success; otherwise, returns a failure code.
Code Example
The following code example demonstrates how to use SHEnableSoftkey.
Note: |
---|
To make the following code example easier to read, security checking and error handling are not included. This code example should not be used in a release configuration unless it has been modified to include them. |
Copy Code | |
---|---|
#include <aygshell.h> HWND g_hwndMb; LRESULT CALLBACK SHCreateMenuBarWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { bool bSKEnabled = TB_ISBUTTONENABLED(1); switch(message) { case WM_KEYDOWN: { // When the user presses the space key, toggle between enabling and disabling SK2. if (VK_SPACE == wParam) { if(bSKEnabled) { SHEnableSoftkey(g_hwndMb, 1, TRUE, FALSE); } else { SHEnableSoftkey(g_hwndMb, 1, TRUE, TRUE); } } break; } } return DefWindowProc(hwnd, message, wParam, lParam); } |
Requirements
Header | aygshell.h |
Library | aygshell.lib |
Windows Embedded CE | Windows CE 3.0 and later |
Windows Mobile | Pocket PC for Windows Mobile Version 5.0 and later, Smartphone for Windows Mobile Version 5.0 and later |