Windows Mobile 6.5中禁用菜单栏菜单栏、Windows、Mobile

2023-09-03 17:19:26 作者:大猪蹄子

我是从WM5移植.NET应用程序WM6.5。除了新的决议,我注意到了开始菜单和标题栏(标题栏)不同的UI行为。我的应用程序需要一种kiosk模式下工作,在那里用户无法退出应用程序,并绕过我们的认证。为此,在WM5我躲在启动按钮和关闭按钮。我使用下面的函数:

I'm porting .NET application from WM5 to WM6.5. Besides new resolution I noticed different UI behavior for start menu and title bar (caption bar). My application needs to work in kind of kiosk mode where user can't exit application and bypass our authentication. For this purpose on WM5 I was hiding start button and close button. I am using following function:

SHFullScreen(hWnd, SHFS_HIDESTARTICON | SHFS_HIDESIPBUTTON); 

隐藏按钮样的工作在WM6.5过,但还有另一个问题。用户可以点击标题栏(菜单栏,标题栏 - 我不知道什么是正确的叫法 - 在屏幕顶部的工具栏),并可以访问Windows任务管理器。见所附的截屏

Hiding buttons kind of works on WM6.5 too, but there is another problem. User can tap on the title bar (menu bar, caption bar - I'm not sure what is proper name for it - the bar on the top of the screen) and get access to Windows Task Manager. See attached screenshot

我cirlced地方,用户可以通过点击并全身而退任务管理器是这样的:

I cirlced places where user can tap and get out to Task Manager like this:

任何想法如何禁用互动?设备是摩托罗拉MC65。运行Windows Mobile 6.5。

Any ideas how to disable that interaction? Device is Motorola MC65. Running Windows Mobile 6.5.

所以,最后的答案是答案的一部分贴在下面:

So, the final answer is part of an answer posted below:

IntPtr tWnd = FindWindow("HHTaskBar", null);
EnableWindow(tWnd, false);

我们只要找到HHTaskBar并禁用它。它有一些缺点,但总体上是卓有成效的。

We just find the HHTaskBar and disable it. It has some downside, but overall does the trick.

推荐答案

您可以隐藏整个顶部任务栏和最大限度地提高您的形式:

You can hide the whole top taskbar and maximize your form:

// the following three lines are p/invoked
IntPtr tWnd = FindWindow("HHTaskBar", null);
EnableWindow(tWnd, false);
ShowWindow(tWnd, SW_HIDE);

// maximize your form
form.Size = new Size(240, 320); // or whatever the device's screen dimensions are
form.WindowState = FormWindowState.Maximized;