Move The Taskbar to the Top of Desktop
来源:互联网 发布:在线网络优化培训 编辑:程序博客网 时间:2024/05/17 21:57
Move The Taskbar to the Top of Desktop
To be more similar with Windows Mobile, First I want to move the Taskbar to top, so that the bottom we can add a softkey for the keypad use.
1、Just move the taskbar to top.
Change the code of function CTaskBbar::Show in taskbar.cpp, modify the show rect:
rc.left = 0;
rc.right = GetSystemMetrics(SM_CXSCREEN);
///Lex Luo 2008.06.17 + change the taskbar to top
rc.bottom = TASKBAR_HEIGHT; ///GetSystemMetrics(SM_CYSCREEN);
///Lex Luo 2008.06.17 -
rc.top = rc.bottom - TASKBAR_HEIGHT;
rebuild the project and sysgen the os, we can see that the taskbar had been move to top of desktop, but the icon of desktop was hide below the taskbar.
2、Move down the work area.
Move down the work area, so that the ICON should not be hide by the taskbar.
Change the code of function CTaskBar::SetWorkArea in taskbar.cpp, modify the rect of top:
SystemParametersInfo(SPI_GETWORKAREA, 0, (void*)&rcWorkArea, 0);
// if the taskbar isn't on top, the workarea is the screen
SetRect(&rcWorkAreaNew, 0, 0, GetSystemMetrics(SM_CXSCREEN),
GetSystemMetrics(SM_CYSCREEN));
if (m_bTaskBarOnTop)
{
if (m_bTaskBarAutoHide)
{
///Lex Luo 2008.06.17 + change the work area to bottom
///rcWorkAreaNew.bottom -= TASKBAR_HEIGHT_AUTOHIDE;
rcWorkAreaNew.top += TASKBAR_HEIGHT_AUTOHIDE;
///Lex Luo 2008.06.17 -
}
else
{
///Lex Luo 2008.06.17 + change the work area to bottom
///rcWorkAreaNew.bottom -= TASKBAR_HEIGHT;
rcWorkAreaNew.top += TASKBAR_HEIGHT;
///Lex Luo 2008.06.17 -
}
}
// currently, only the bottom will change
///Lex Luo 2008.06.17 + change to top
///if (rcWorkArea.bottom != rcWorkAreaNew.bottom)
if (rcWorkArea.top != rcWorkAreaNew.top)
///Lex Luo 2008.06.17 -
{
SystemParametersInfo(SPI_SETWORKAREA, 0, (void*)&rcWorkAreaNew, SPIF_SENDCHANGE);
MoveWindow(
Desktop_GetWindow(),
rcWorkAreaNew.left,
rcWorkAreaNew.top,
rcWorkAreaNew.right - rcWorkAreaNew.left,
rcWorkAreaNew.bottom - rcWorkAreaNew.top,
TRUE);
}
after sysgen and build the os, we can see that the desktop first show at 0,0 and flash again move down below the taskbar. So we must change the first show of the desktop.
3、Change the desktop rect.
Go to desktop.cpp and change the rect in CDesktopwnd::Create function:
fs.ViewMode = FVM_ICON;
fs.fFlags = FWF_DESKTOP | FWF_ALIGNLEFT | FWF_NOSCROLL;
///Lex Luo 2008.06.19 + move down the desktop at first
///SetRect(&rc, 0, 0, GetSystemMetrics(SM_CXVIRTUALSCREEN), GetSystemMetrics(SM_CYVIRTUALSCREEN));
SetRect(&rc, 0, 26, GetSystemMetrics(SM_CXVIRTUALSCREEN), GetSystemMetrics(SM_CYVIRTUALSCREEN));
///Lex Luo 2008.06.19 -
// create the desktop's view window (no need to AddRef since CreateViewWindow does it)
hr = _psv->CreateViewWindow(NULL, &fs, (IShellBrowser *)this, &rc, &_hWnd);
So that we can see the desktop show below the taskbar. The other problem is that the start menu were show in 0,0 would hide the taskbar again.
4、Change the StartMenu show rect.
Go back to taskbar.cpp, and change the code in CTaskBar::StartMenu:
ClientToScreen(hwnd, (LPPOINT)&rc);
ClientToScreen(hwnd, (LPPOINT)&rc.right);
///Lex Luo 2008.06.18 + move down the start menu
///StartMenu_Track(TPM_LEFTALIGN | TPM_BOTTOMALIGN, rc.left, rc.top - 1,hwnd);
StartMenu_Track(TPM_LEFTALIGN | TPM_TOPALIGN, rc.left, /*rc.top + */TASKBAR_HEIGHT,hwnd);
///Lex Luo 2008.06.18 -
DrawItem(hwnd, hdc, 0, FALSE);
After there changes, we can see the taskbar at the top of desktop, and the work area show below the taskbar.Just finish the first work in WinCE.
- Move The Taskbar to the Top of Desktop
- Top of The World
- Top of The World
- how to move a rule to the top position at rule list?
- Move the Item of ListBox
- Function is used to Show/Hide the TaskBar
- A Friently Introduction to the Windows 7 Taskbar Features
- Virtualization: From the Desktop to the Enterprise
- [noj 1559] Jump to the Top of Mountain
- 101.You want to move all objects of the APPS user in the test database to the DB_USER schema of the
- Move the datafile to release the diskspace on the drive
- Manipulating the positions of desktop icons
- Get to the Top on Google: Tips and Techniques to Get Your Site to the Top of the Search Engine Ranki
- Turn off cache of Thumdbs.db to prevent the move blocking from it in automation
- Remote Access to the Fedora Linux Desktop
- Remote Access to the CentOS Desktop
- The top 10 game developers of 2012
- The Top Secret Of Photoshop Package
- 利用VB开发SAP接口程序初探
- 用JS动态构造GET请求之谜(ajax跨域的另类解法)
- ASP.Net 2.0 TreeView控件 介绍 详解
- 基于OWL-S的Web服务质量本体的描述模式的设计(转)
- 软件设计是一种技能,并不拘泥于一种语言
- Move The Taskbar to the Top of Desktop
- ERROR J2EE HTTP0004 Internal error raised tyring to instantiate web-application: rhtest defined in web site OC4J 10g (10.1.3) De
- 正则表达式全部符号解释
- 最简单的时间格式类
- zoj 1013解题报告 经典DP
- WinCE工作区和任务栏
- spring中事物传播规则
- UVa Problem Solution: 10149 - Yahtzee
- ASP.NET2.0探针