Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable menu bar in Windows Mobile 6.5

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); 

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 Application

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

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);

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

like image 526
sha Avatar asked Mar 29 '11 12:03

sha


1 Answers

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;
like image 171
Tom van Enckevort Avatar answered Sep 30 '22 18:09

Tom van Enckevort