WinMobile5.0 全屏问题

llfootballer 2007-06-15 02:50:04
加精
::SHFullScreen(m_hWnd, SHFS_HIDETASKBAR | SHFS_HIDESIPBUTTON | SHFS_HIDESTARTICON);

CRect rcScreen;
SetRect(&rcScreen, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN));
::MoveWindow(m_hWnd, rcScreen.left, rcScreen.top, rcScreen.right-rcScreen.left, rcScreen.bottom-rcScreen.top, TRUE);

这是全屏的代码,但是最底下的兰色的窗口不能隐掉,帮帮忙!
...全文
1562 25 打赏 收藏 转发到动态 举报
写回复
用AI写文章
25 条回复
切换为时间正序
请发表友善的回复…
发表回复
thinkinwm 2009-10-09
  • 打赏
  • 举报
回复
mark
lenux 2007-12-14
  • 打赏
  • 举报
回复
这么热闹
hanshu540 2007-12-13
  • 打赏
  • 举报
回复
sdk的示例程序里面就有例子的
neveroldmilk 2007-12-11
  • 打赏
  • 举报
回复
这个代码可以,从桌面直接移植过来可以用的:
BOOL CFullScrDlgDlg::OnInitDialog()
{
CDialog::OnInitDialog();

//...

int cx, cy;
HDC dc = ::GetDC(NULL);
cx = GetDeviceCaps(dc,HORZRES) +
GetSystemMetrics(SM_CXBORDER);
cy = GetDeviceCaps(dc,VERTRES) +
GetSystemMetrics(SM_CYBORDER);
::ReleaseDC(0,dc);

//去除标题和边框
SetWindowLong(m_hWnd, GWL_STYLE,
GetWindowLong(m_hWnd, GWL_STYLE) &
(~(WS_CAPTION | WS_BORDER)));

// 置对话框为最顶端并扩充到整个屏幕
::SetWindowPos(m_hWnd, HWND_TOPMOST,
-(GetSystemMetrics(SM_CXBORDER)+1),
-(GetSystemMetrics(SM_CYBORDER)+1),
cx+1,cy+1, SWP_NOZORDER);

//...

return TRUE;
}
jay24038529 2007-09-11
  • 打赏
  • 举报
回复
SHFullScreen(gMainWnd,SHFS_HIDETASKBAR | SHFS_HIDESTARTICON | SHFS_HIDESIPBUTTON);
ShowWindow(g_hwndMB,SW_HIDE);
这样在WIN32下是可以的

但是用在MFC里面就不行了,何故呢?智能把SHFS_HIDESTARTICON隐藏掉而已。
SHFullScreen(this->m_hWnd,SHFS_HIDETASKBAR | SHFS_HIDESTARTICON | SHFS_HIDESIPBUTTON);
nikalee 2007-08-18
  • 打赏
  • 举报
回复
恩,我最近也在做手机上的播放器,这个题我一开始的时候是每次都把原来的ToolBar等都析构掉,等全屏改为小屏的时候再创建出来。后来看了MSDN后发现了这样一个方法,
SHFullScreen(gMainWnd,SHFS_HIDETASKBAR | SHFS_HIDESTARTICON | SHFS_HIDESIPBUTTON);
SetRect(&rc, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN));
MoveWindow(gMainWnd, rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, TRUE);
ShowWindow(g_hwndCB,SW_HIDE);
ShowWindow(trackbar,SW_HIDE);
ShowWindow(toolbar,SW_HIDE);
你试一下
forecho 2007-08-17
  • 打赏
  • 举报
回复
在wm 5.0 的PPC 下弄 FullScreen Dailog 确实郁闷。
1,要是直接用API写很容易实现 参见:http://www.codeproject.com/ce/fullscreen.asp
2, 用MFC写 主要是没搞清除那里面消息触发的来龙去脉, 一直都没有效果,网上找了很多代码,放在OnInitDialog()里面一点用都没有。
这两篇文章可能有点用:
http://support.microsoft.com/kb/266244/en-us
http://bbs.pdafans.com/archiver/tid-126783.html
下面是我的解决方法:
1,建一个叫bg的MFC 对话框程序, 在资源视图 里把对话框的 Title Bar 设置false
2,改OnInitDialog
BOOL CbgDlg::OnInitDialog()
{
m_bFullScreen = FALSE;
CDialog::OnInitDialog();

// Call SHInitDialog with flags for full screen.
SHINITDLGINFO shidi;

shidi.dwMask = SHIDIM_FLAGS;
shidi.dwFlags = SHIDIF_FULLSCREENNOMENUBAR;
shidi.hDlg = m_hWnd;
::SHInitDialog(&shidi);

// Set the icon for this dialog box. The framework does this automatically
// when the application's main window is not a dialog box.
SetIcon(m_hIcon, TRUE); // Set big icon.
SetIcon(m_hIcon, FALSE); // Set small icon.

// TODO: Add extra initialization here.
::CommandBar_Show(this->m_hWnd, FALSE);

// SHFullScreen fails if dialog box is not foreground.
SetForegroundWindow();
SHFullScreen(m_hWnd, SHFS_HIDETASKBAR | SHFS_HIDESIPBUTTON);

// Resize the window over the taskbar area.
#define MENU_HEIGHT 26
RECT rect;
GetWindowRect(&rect);
rect.top -= MENU_HEIGHT;
MoveWindow(&rect, TRUE);

return TRUE;

}
3, 添加WM_ACTIVATE, WM_SETTINGCHANGE 的响应函数

void CbgDlg::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized)
{
CDialog::OnActivate(nState, pWndOther, bMinimized);

// TODO: 在此处添加消息处理程序代码
SHFullScreen( this->m_hWnd, SHFS_HIDETASKBAR | SHFS_HIDESIPBUTTON);
}

void CbgDlg::OnSettingChange(UINT uFlags, LPCTSTR lpszSection)
{
//CDialog::OnSettingChange(uFlags, lpszSection);

// TODO: 在此处添加消息处理程序代码
}
wyl1220 2007-08-04
  • 打赏
  • 举报
回复
好像应该是你MoveWindow的问题:
SHFullScreen(hWnd, SHFS_HIDETASKBAR | SHFS_HIDESIPBUTTON | SHFS_HIDESTARTICON);
GetWindowRect(hWnd,&rc);
MoveWindow(hWnd,rc.left, rc.top-26, rc.right, rc.bottom, TRUE);

隐藏标题栏和软键盘加上这个:
g_taskbarhandle=FindWindow(_T("HHTaskBar"),NULL);
if (g_taskbarhandle!=NULL)
{
ShowWindow(g_taskbarhandle, SW_HIDE);
}
g_hSipWnd = FindWindow(_T("MS_SIPBUTTON"), NULL);
SHSipPreference(hWnd,SIP_DOWN););//隐藏软件盘
dyw 2007-08-04
  • 打赏
  • 举报
回复
How To Create Full-Screen Applications for the PocketPC
http://support.microsoft.com/kb/266244
wyl1220 2007-08-02
  • 打赏
  • 举报
回复
你加上这个试试SHFullScreen(hWnd, SHFS_HIDETASKBAR | SHFS_HIDESIPBUTTON | SHFS_HIDESTARTICON);
rz_hansen 2007-07-26
  • 打赏
  • 举报
回复
了解一下ECDS-MUI跨平台手机应用程序开发工具,13天完成一套手机交易系统的开发(alpha),只用编写一次代码,生成所支持的5个平台的应用程序,提高开发效率,降低成本,您可以在CSDN:http://download.csdn.net/source/180559上下载,或到www.ecds-mui.com了解详细情况。
zhctom 2007-07-23
  • 打赏
  • 举报
回复
void SizeFullScreen
(
HWND hWnd, // In: Window
BOOL bFullScreen // In: TRUE = Size to full screen. FALSE = Undo
)
{
RECT rc;

if (bFullScreen)
{
// Full screen size
SetRect(&rc,
0, 0,
GetSystemMetrics(SM_CXSCREEN),
GetSystemMetrics(SM_CYSCREEN));
}
else
{
// Normal size
SystemParametersInfo(SPI_GETWORKAREA, 0, &rc, FALSE);
rc.bottom -= g_iMenuHeight;
}

MoveWindow( hWnd,
rc.left, rc.top,
rc.right, rc.bottom,
FALSE);
}
zhctom 2007-07-23
  • 打赏
  • 举报
回复
可以研究一下WM6下面的那个Full的例程
the_AK47 2007-07-12
  • 打赏
  • 举报
回复
底下不能去掉的蓝色窗口是菜单条(MenuBar)。

如果你的程序总是全屏模式,则可以不创建菜单,或在调用SHFullScreen()之前调用 ShowWindow(hMenuBar, SW_HIDE); 这种情况下,一般将置全屏的代码放入响应WM_ACTIVATE消息下,此时常用于 wParam==WA_ACTIVE 。

另外,如果你在创建窗口时, CreateWindow() 中直接指定窗口尺寸,如 0, 0, 240, 320。。而不是CW_USEDEFAULT之类的,则直接调用SHFullScreen就可全屏了。

多查查MSDN,多看看SDK带的示例是有好处的。~~
icelyz 2007-07-12
  • 打赏
  • 举报
回复
看看sdk,里面兴许有

给你帖段ppc的,这几天看sdk看的头都大

Programming Windows CE

Full-Screen Dialog Boxes
To assist programmers in creating full-size dialog boxes, the Pocket PC shell implements a function named SHInitDialog. As the name implies, the function should be called during the handling of the WM_INITDIALOG message. The function is prototyped as

BOOL SHInitDialog (PSHINITDLGINFO pshidi);
The function takes a single parameter, a pointer to an SHINITDLGINFO structure defined as

typedef struct tagSHINITDIALOG{
DWORD dwMask;
HWND hDlg;
DWORD dwFlags;
} SHINITDLGINFO;
The dwMask field must be set to the single flag currently supported, SHIDIM_FLAGS. The hDlg field should be set to the window handle of the dialog. The third parameter, dwFlags, specifies a number of different initialization options. The SHIDIF_DONEBUTTON specifies that the navigation bar across the top of the screen contain an OK button in the upper right corner. This flag is typically set because the user interface guidelines specify that dialogs have an OK button in the navigation bar, and the guidelines specify that there be no Cancel button. While one could argue with this specification, the user interface provides no automatic way to provide a Cancel button.

The SHIDIF_SIPDOWN flag closes the SIP when the dialog is displayed. This flag should be set for informational dialogs that have no text input fields. Note that the absence of this flag doesn’t automatically display the SIP. It simply means that the state of the SIP remains unchanged when the dialog box is displayed.

Three other flags can be set in the dwFlags field:

SHIDIF_SIZEDLG
SHIDIF_SIZEDLGFULLSCREEN
SHIDIF_FULLSCREENNOMENUBAR
These flags deal with how the dialog box will be sized. The SHIDIF_SIZEDLG flag tells the system to size the dialog box depending on the state of the SIP. If the SIP is displayed, the dialog box will be sized to fit above the SIP. If the SIP is hidden, the dialog will be sized to fit just above the menu bar. If, however, you have a floating SIP, the dialog box doesn’t size correctly. This is a rare occurrence, because neither of the bundled input methods that ship with the Pocket PC can be undocked. However, the example input method in Chapter 18 does have the ability to float.

The SHIDIF_SIZEDLGFULLSCREEN and SHIDIF_FULLSCREENNOMENUBAR flags size the dialog to fit the entire screen regardless of the state of the SIP. The difference between the two flags is that SHIDIF_FULLSCREENNOMENUBAR does not leave room for the menu bar at the bottom of the screen.

tong20037 2007-07-12
  • 打赏
  • 举报
回复
http://www.codeproject.com/ce/Caleidoscope.asp
或许对你有用
北方大冬瓜 2007-07-10
  • 打赏
  • 举报
回复
下面蓝色的其实是个 ToolBar
saliors 2007-07-10
  • 打赏
  • 举报
回复
C:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Pocket PC SDK\Samples\CPP\Win32\Shellapidemo
Dlanguage 2007-06-26
  • 打赏
  • 举报
回复
学习
无聊客 2007-06-24
  • 打赏
  • 举报
回复
int lWinX = GetSystemMetrics(SM_CXSCREEN);
int lWinY = GetSystemMetrics(SM_CYSCREEN);
SHFullScreen(m_hWnd, SHFS_HIDETASKBAR | SHFS_HIDESIPBUTTON );
::SetForegroundWindow(m_hWnd);
::MoveWindow(m_hWnd, 0, 0, lWinX, lWinY, TRUE);
加载更多回复(5)

7,655

社区成员

发帖
与我相关
我的任务
社区描述
Windows Phone是微软发布的一款手机操作系统,它将微软旗下的Xbox LIVE游戏、Zune音乐与独特的视频体验整合至手机中。
社区管理员
  • Windows客户端开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧