SHEnableSoftkey
Windows Mobile 6.5
4/8/2010
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. |
HRESULT SHEnableSoftkey( HWND hwndMenuBar, UINT uid, BOOL bByIndex, BOOL bEnable );
- 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 uid parameter is an index, FALSE if it is a command identifier.
- bEnable
-
Set to TRUE to enable the soft key, FALSE to disable it.
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. |
#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);
}
Reference
Shell FunctionsConcepts
Customizing Default Values for Soft Keys on the Home ScreenOther Resources
Soft Key and Menu GuidelinesCommunity Additions
Show:
Note: