Hi,

I want to ask how to set the taskbar to auto-hide in the windows CE
application?
Thx~

Re: How to set the taskbar to auto-hide in the application? by Tom

Tom
Thu Oct 27 23:04:02 CDT 2005

You first need to set the registry entry that tells the shell to auto hide
the taskbar. That registry value is the unnamed value for the key
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shell\AutoHide]. This DWORD is
normally zero when auto hide is turned off. You need to set it to a
non-zero to turn auto hide on.

That alone, however, won't have an immediate effect on the taskbar. You'll
need to send it a message to tell it you've changed the setting. This is
done with the WM_SETTINGCHANGE message, with 0 and 5000 for wParam and
lParam respectively. Here's a short app that does all this:

#include "stdafx.h"

wchar_t * szAutoHideName = L"Software\\Microsoft\\Shell\\AutoHide";

void SetAutoHide(DWORD dwAutoHide);

int _tmain(int argc, TCHAR *argv[], TCHAR *envp[])
{
HWND hWndTB = FindWindow( L"HHTaskBar", NULL);
if (hWndTB != NULL)
{
SetAutoHide(TRUE);
SendMessage(hWndTB, WM_SETTINGCHANGE, 0, 5000);
}
return 0;
}

void SetAutoHide(DWORD dwAutoHide)
{
LONG lRet;
HKEY hkey;
DWORD dw;

lRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE, szAutoHideName,
0, KEY_ALL_ACCESS, &hkey);

if (lRet != ERROR_SUCCESS)
{
lRet = RegCreateKeyEx(HKEY_LOCAL_MACHINE, szAutoHideName, 0, NULL,
0,
KEY_ALL_ACCESS, NULL, &hkey, &dw);
}

if (lRet == ERROR_SUCCESS)
{
RegSetValueEx(hkey, L"", 0, REG_DWORD, (LPBYTE)&dwAutoHide,
sizeof(DWORD));
RegCloseKey(hkey);
}
}


Tom Gensel (eMVP)



Re: How to set the taskbar to auto-hide in the application? by tam

tam
Fri Oct 28 04:52:47 CDT 2005

I solve the problem! Thx Tom for ur detailed answer : )


Re: How to set the taskbar to auto-hide in the application? by Dan

Dan
Mon Oct 31 09:54:53 CST 2005

tam wrote:
> I want to ask how to set the taskbar to auto-hide in the windows CE
> application?

If you're doing this with PB you can just define these two registry
settings in platform.reg:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shell\OnTop]
"Default"=dword:0
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shell\AutoHide]
"Default"=dword:1

Sending message to HHTaskBar may work for some (it didn't work in my CE
4.2 platform), but this method is shotgun-style easy. ;-)