LRESULT CDesktopView::HandleInitMenuPopup(HMENU hmenu, PopupMenuInfo * pPopupMenuInfo)
{
LRESULT result = CDefShellView::HandleInitMenuPopup(hmenu, pPopupMenuInfo);
if ((0 == result) && (FWF_DESKTOP & m_fFlags))
{
if (pPopupMenuInfo && (FOLDER_MENU_OFFSET == pPopupMenuInfo->offset))
{
::RemoveMenu(hmenu, FOLDER_VIEW_MENU_OFFSET, MF_BYPOSITION); // "View" sub-menu
::RemoveMenu(hmenu, FOLDER_VIEW_MENU_OFFSET, MF_BYPOSITION); // "View" separator
::RemoveMenu(hmenu, FOLDER_VIEW_MENU_OFFSET, MF_BYPOSITION); //"图标排列方式"
::RemoveMenu(hmenu, FOLDER_VIEW_MENU_OFFSET+1, MF_BYPOSITION); //separator
::RemoveMenu(hmenu, FOLDER_VIEW_MENU_OFFSET+1, MF_BYPOSITION); //"粘贴"
::RemoveMenu(hmenu, FOLDER_VIEW_MENU_OFFSET+1, MF_BYPOSITION); //"粘贴快捷方式"
::RemoveMenu(hmenu, FOLDER_VIEW_MENU_OFFSET+1, MF_BYPOSITION); //separator
::RemoveMenu(hmenu, FOLDER_VIEW_MENU_OFFSET+1, MF_BYPOSITION); //"新建文件夹"
}
else if (pPopupMenuInfo && (ITEM_MENU_OFFSET == pPopupMenuInfo->offset))
{
::RemoveMenu(hmenu, IDC_EDIT_CUT, MF_BYCOMMAND);
::RemoveMenu(hmenu, IDC_EDIT_COPY, MF_BYCOMMAND);
::RemoveMenu(hmenu, IDC_FILE_DELETE, MF_BYCOMMAND);
::RemoveMenu(hmenu, IDC_FILE_RENAME, MF_BYCOMMAND);
::RemoveMenu(hmenu, ITEM_MENU_OFFSET+1, MF_BYPOSITION); // separator
::RemoveMenu(hmenu, ITEM_MENU_OFFSET+1, MF_BYPOSITION); // separator
}
}
修改背景颜色:
// --- Original code commented out ---
// ::FillRect(hdc, &rc, ::GetSysColorBrush(COLOR_BACKGROUND));
// Explicitly set the background color.
::FillRect(hdc, &rc, ::GetSysColorBrush(RGB(230, 150, 230)));
修改显示的os版本信息(类似“windows ce.net 4.2")
/* -- Original code commented out --
::wsprintf(wszVersion, L" Microsoft Windows /
CE v%d.%02d (Build %d on %s) ", VerInfo.dwMajorVersion,
VerInfo.dwMinorVersion, VerInfo.dwBuildNumber,
TEXT(__DATE__));
*/
// Display shell name along with Windows CE version information.
::wsprintf(wszVersion, L"< Shell Name > for Microsoft Windows /
CE v%d.%02d (Build %d on %s) ",
VerInfo.dwMajorVersion, VerInfo.dwMinorVersion,
VerInfo.dwBuildNumber, TEXT(__DATE__));
5.。。。。待续
//=====================================================================================================
//AUTHOR:
// norains
//DATE:
// Tuesday 25-April -2006
//=====================================================================================================
1.让桌面不显示"我的电脑","回收站"
删除以下键值:
[ HKEY_LOCAL_MACHINE /Explorer/Desktop]
{000214A0-0000-0000-C000-000000000046} ;"My Computer"
{000214A1-0000-0000-C000-000000000046} ;Recycle Bin"
存在这两个键值的文件有:
$(_WINCEROOT)/PUBLIC/SHELL /OAK/FILES/shell .reg
$(_WINCEROOT)/PUBLIC/WCESHELLFE/OAK/FILES/wceshellfe.reg
$(_WINCEROOT)/PUBLIC/WCESHELLFE/OAK/FILES/wceshellfe88.reg
2.直接删除文件,不放回回收站
[HKEY_LOCAL_MACHINE /Explorer]
"UseRecycleBin"=dword:0 ;设置0为直接删除;设置1为放入回收站
3.修改XP皮肤的系统界面颜色
如果选择了XP SKIN,则在控制面板的"显示"选项中是无法更改一些窗口的颜色的.不过,我们倒是可以通过更改$(_WINCEROOT)/PUBLIC /COMMON/OAK/FILES/common.reg文件中的XP颜色参数来达到更改窗口颜色的目的.
原XP样式的颜色参数如下:
[HKEY_LOCAL_MACHINE /SYSTEM/GWE]
"SysColor"=hex:/
00,00,00,00,/
3A,6E,A5,00,/
00,00,00,00,/
00,00,00,00,/
EF,EB,DE,00,/
FF,FF,FF,00,/
00,00,00,00,/
00,00,00,00,/
00,00,00,00,/
FF,FF,FF,00,/
C0,C0,C0,00,/
C0,C0,C0,00,/
80,80,80,00,/
31,69,C6,00,/
FF,FF,FF,00,/
EF,EB,DE,00,/
AD,AA,9C,00,/
80,80,80,00,/
00,00,00,00,/
00,00,00,00,/
FF,FF,FF,00,/
73,6D,63,00,/
FF,FF,FF,00,/
00,00,00,00,/
FF,FF,E1,00,/
EF,EB,DE,00,/
00,00,00,00
代表的意思是:
0 COLOR_SCROLLBAR Color of the gray area of a scroll bar.
1 COLOR_BACKGROUND Background color of the desktop window.
2 COLOR_ACTIVECAPTION Color of the title bar of an active window.
3 COLOR_INACTIVECAPTION Color of the title bar of an inactive window.
4 COLOR_MENU Background color of a menu.
5 COLOR_WINDOW Background color of a window.
6 COLOR_WINDOWFRAME Color of a window frame.
7 COLOR_MENUTEXT Color of the text in a menu.
8 COLOR_WINDOWTEXT Color of the text in a window.
9 COLOR_CAPTIONTEXT Color of the text in a title bar and of the size box and scroll bar arrow box.
10 COLOR_ACTIVEBORDER Color of the border of an active window.
11 COLOR_INACTIVEBORDER Color of the border of an inactive window.
12 COLOR_APPWORKSPACE Background color of multiple document interface (MDI) applications.
13 COLOR_HIGHLIGHT Color of an item selected in a control.
14 COLOR_HIGHLIGHTTEXT Color of the text of an item selected in a control.
15 COLOR_BTNFACE Color of the face of a button.
16 COLOR_BTNSHADOW Shadow color of buttons for edges that face away from the light source.
17 COLOR_GRAYTEXT Color of shaded text. This color is set to 0 if the current display driver does not support a solid gray color.
18 COLOR_BTNTEXT Color of the text for push buttons.
19 COLOR_INACTIVECAPTIONTEXT Color of the text in the title bar of an inactive window.
20 COLOR_BTNHIGHLIGHT Highlight color of buttons for edges that face the light source.
21 COLOR_3DDKSHADOW Color of the dark shadow for three-dimensional display elements.
22 COLOR_3DLIGHT Highlight color of three-dimensional display elements for edges that face the light source.
23 COLOR_INFOTEXT Color of the text for ToolTip controls.
24 COLOR_INFOBK Background color for ToolTip controls.
25 COLOR_STATIC Background color for static controls and dialog boxes. Supported in Windows CE 2.0 and later.
26 COLOR_STATICTEXT Color of the text for static controls. Supported in Windows CE 2.0 and later.
27 COLOR_GRADIENTACTIVECAPTION Color of the title bar of an active window that is filled with a color gradient.
28 COLOR_GRADIENTINACTIVECAPTION
4.文件夹映射更改
假设我们要将"桌面"文件夹从根目录(在这里指的是RAM空间)移动到某个外部储存器"HardDisk" 中,可以按如下步骤:
1.将$(_WINCEROOT)/PUBLIC/COMMON/OAK/FILES/INTLTRNS/0804 /common.str文件中的LOC_PATH_DESKTOP宏定义改为"file://harddisk//Windows// 桌面"
2. 然后将所有.dat文件中关于LOC_DESKTOP_DIR的选项,全部在windows前添加"/HardDisk",
如:Directory("/Windows /LOC_DESKTOP_DIR"):-File("LOC_INTERNETEXPLORER_LNK", "/Windows/iesample.lnk")
改为:Directory("/HardDisk/Windows /LOC_DESKTOP_DIR"):-File("LOC_INTERNETEXPLORER_LNK", "/Windows/iesample.lnk")即可.
如果有创建文件夹的话,也要改:
如:root:-Directory("/LOC_PROGRAMFILES_DIR")
改 为:root:-Directory("HardDisk/LOC_PROGRAMFILES_DIR")
环境:
Wince5.0+ARM926
目的:
按照自己的风格建立Shell
背 景:
考虑到产品外观及风格的一致性,无法直接把Explorer作为Shell ,而且,又无简单的把Explorer直接放 到后台(会出现一些问题,譬如启动的瞬间,Explorer会显示一下)
方法:
1. 直接修改Explorer,改为自己的风格。个人认为这是最根本最有效的方法,但是工作量比较大,考虑到时间只能放弃。
2. 直接用自己的Shell 替 代Explorer。在Shell .reg中有一句
[HKEY_LOCAL_MACHINE /init]
"Launch50"="explorer.exe"
"Depend50"=hex:14,00, 1e,00
就是这一句在启动的最后把Explorer启动起来。(Launchxx的含义及用法在PB的帮助里面有解释)。
把 explorer.exe替换自己的shell 即可(譬如MyShell.exe),以前一直使用这种方法。
但这种方法有缺陷:wince 的Common Dialog是依赖于Explorer的,这就导致很多Wince自带的程序执行时有问题,譬如WordPad无法打开和保存。。。(如果哪位知道如何在 不启动Explorer的情况下使用Common Dialog的话,还烦请告诉小弟)
3. 现在是对Explorer稍作修改确保显示没有问题,然后放在后台,步骤如下:
3.1. 按照PB Help的提示修改Explorer(如果通过修改注册表实现,则尽量不修改Explorer代码)
a. 复制WINCE500/PUBLIC/SHELL /OAK /HPC,到WINCE500/PUBLIC/SHELL /OAK目录下,并重命名为MyShell
b. 修改dir文件
c. 去掉桌面上显示的"Microsoft Windows CE...........":
直接把desktopview.cpp 中#ifndef SHIP_BUILD改为#if 0即可。
(理论上在Platform Setting里面可以设置此段文字不显示的,但是不知为何不起作用)
d. 修改Taskbar自动隐藏时的高度:
taskbar.hxx 中,把TASKBAR_HEIGHT_AUTOHIDE改为0
e. 去掉Explorer启动时的音乐:
把WinMain中的 sndPlaySound(c_szSystemStart, SND_ALIAS|SND_ASYNC|SND_NODEFAULT);注释掉。
(注 册表中,没有找到开机音乐的键值。如果哪位知道,请不吝赐教)
3.2. 修改注册表
a. Shell .reg: 桌面上去掉"My Device"和"Recycle Bin"两个图标
找到
[HKEY_LOCAL_MACHINE /Explorer/Desktop]
"{000214A0-0000-0000-C000-000000000046}"="My Device"
"{000214A1-0000-0000-C000-000000000046}"="Recycle Bin"
改 为
[HKEY_LOCAL_MACHINE /Explorer/Desktop]
;"{000214A0-0000-0000-C000-000000000046}"="My Device"
;"{000214A1-0000-0000-C000-000000000046}"="Recycle Bin"
b. 去掉桌面上的其它快捷方式
wince用Directory("/Windows /LOC_DESKTOP_DIR"):-File("LOC_MSPWORD_LNK","/Windows/wordpad.lnk")的方式在桌面 上建立快捷方式
把WINCE500/PUBLIC/WCEAPPSFE/OAK/FILES/wceappsfe.dat中的所有 Directory("/Windows/LOC_DESKTOP_DIR"):-File(...)全部注释掉。
把 WINCE500/PUBLIC/WCESHELLFE/OAK/FILES/wceshellfe.dat中的所有Directory(" /Windows/LOC_DESKTOP_DIR"):-File(...)全部注释掉。
c. 设置Taskbar为自动隐藏
在注册表 中添加
; -- 使任务栏缺省自动隐藏
[HKEY_LOCAL_MACHINE /Software /Microsoft /Shell /AutoHide]
@="1"
; -- 使任务栏缺省不总在最前
[HKEY_LOCAL_MACHINE /Software /Microsoft /Shell /OnTop]
""=dword:0
d. 修改桌面背景颜色
[HKEY_LOCAL_MACHINE /SYSTEM/GWE]
"SysColor"=hex:/
00,00,00,00,/
00,00,00,00,/ //Desktop窗口背景颜色,现在设置为黑色
00,00,00,00,/
00,00,00,00,/
EF,EB,DE,00,/
FF,FF,FF,00,/
00,00,00,00,/
00,00,00,00,/
00,00,00,00,/
FF,FF,FF,00,/
C0,C0,C0,00,/
C0,C0,C0,00,/
80,80,80,00,/
31,69,C6,00,/
FF,FF,FF,00,/
EF,EB,DE,00,/
AD,AA,9C,00,/
80,80,80,00,/
00,00,00,00,/
00,00,00,00,/
FF,FF,FF,00,/
73,6D,63,00,/
FF,FF,FF,00,/
00,00,00,00,/
FF,FF,E1,00,/
EF,EB,DE,00,/
00,00,00,00
e. 背景图片
[HKEY_CURRENT_USER/ControlPanel/Desktop]
"wallpaper"="//NandDisk//Startup//wallpaper.bmp"
f. 启动自己的Shell
[HKEY_LOCAL_MACHINE /init]
"Launch70"="//Windows//ShellLoader.exe"
"Depend70"=hex:14,00, 1e,00
效果:系统启动后,先启动explorer显示wallpaper.bmp,然后启动ShellLoader.exe