Intermec Home

How to Buy | Partner Login

Developers Forum

Reply
Regular Contributor
AhmedAbdin
Posts: 82
Registered: ‎July 7 2010
0

disappear or block start menu in all of application

hello

 

i faced small problem and i hope someone to help me

i develop small program to lock screen on handheld so i tried code to disappear start menu only not task bar. and i worked perfectly. but when i open another application like mobilecalculator.exe from my interface

the startmenu will be back to appear.

 

i need to disappear or block start menu on all of application that are open, not only my application.

namespace startmenu { //Created to classes to implement this code public class SHAPI { public const int SHFS_SHOWTASKBAR = 1; public const int SHFS_HIDETASKBAR = 2; public const int SHFS_SHOWSIPBUTTON = 4; public const int SHFS_HIDESIPBUTTON = 8; public const int SHFS_SHOWSTARTICON = 16; public const int SHFS_HIDESTARTICON = 32; [DllImport("aygshell.dll")] private extern static bool SHFullScreen(IntPtr hWnd, int dwState); public static bool FullScreen(IntPtr hWnd) { return SHFullScreen(hWnd, SHFS_HIDESTARTICON | SHFS_HIDETASKBAR); } [DllImport("coredll.dll")] internal static extern int SetForegroundWindow(IntPtr hWnd); } public class API { [DllImport("coredll.dll", EntryPoint = "FindWindow")] private extern static IntPtr FindWindow(string lpClassName, string lpWindowName); public static IntPtr FindWindow(string windowName) { return FindWindow(null, windowName); } } }

 

 

call function from previous classes

 

//this code to call the function in previous classes and disappear //startmenu only private void button1_Click(object sender, EventArgs e) { IntPtr hWnd = API.FindWindow(this.Text); if(hWnd != IntPtr.Zero) { //this.MaximizeBox = false; //this.MinimizeBox = false; //this.Focus(); SHAPI.SetForegroundWindow(hWnd); SHAPI.FullScreen(hWnd); } }

 

 

open mobilecalculator.exe

 

        private void button2_Click(object sender, EventArgs e) { System.Diagnostics.ProcessStartInfo p = new System.Diagnostics.ProcessStartInfo(@"\Windows\MobileCalculator.exe", ""); System.Diagnostics.Process.Start(p); }

 

Intermec Expert
hjgode
Posts: 1,886
Registered: ‎January 29 2009

Re: disappear or block start menu in all of application

Hello

 

I believe the SHFullScreen API is unusable for this, it will 'work' only for the active foreground application. This will be np problem, if you are writing a kiosk mode application where no other apps are needed.

 

I have seen a solution to block the start menu, where subclassing is used:

 

LRESULT CALLBACK TaskbarWindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
if (message == WM_LBUTTONDOWN)
{
POINTS pts;
pts.x = LOWORD(lParam);
pts.y = HIWORD(lParam);
if (pts.y < MAX_YBOTTOM_APP_TITLE)
return TRUE;
}
if (message == WM_KEYDOWN &&
wParam == VK_LWIN && lParam == 1)
return TRUE;
return CallWindowProc(oldWindowProc, hWnd, message, wParam, lParam);
}

void __stdcall LockStartMenu()
{
taskbarhWnd = FindWindow(TEXT("HHTaskBar"), NULL);
if (taskbarhWnd != NULL)
{
WNDPROC p = TaskbarWindowProc;
oldWindowProc = (WNDPROC)SetWindowLong(taskbarhWnd, GWL_WNDPROC, (long)p);
}
}

void __stdcall UnlockStartMenu()
{
if (oldWindowProc)
oldWindowProc = (WNDPROC)SetWindowLong(taskbarhWnd, GWL_WNDPROC, (long)oldWindowProc);
oldWindowProc = 0;
}

 

This subclassing prohibits clicks on start menu icon and disables the WinKey. The code has been taken of a DLL.

 

 

 

.....................Don't be lazy, give KUDOS........................
-------------==========================--------------
See all my tips and tools at hxxp://www.hjgode.de/dev
and the NEW http://www.hjgode.de/wp
code at google com:
http://code.google.com/p/itc-keyboard/
http://code.google.com/p/rdesktop-ce/
http://code.google.com/p/win-mobile-code/source/browse/#svn%2Ftrunk
Regular Contributor
AhmedAbdin
Posts: 82
Registered: ‎July 7 2010
0

Re: disappear or block start menu in all of application

[ Edited ]

thank you higode

 

but i need know where i found these method?which DLL file used?

TaskbarWindowProc

LockStartMenu

UnlockStartMenu

 

 

please help me

 

Intermec Expert
hjgode
Posts: 1,886
Registered: ‎January 29 2009

Re: disappear or block start menu in all of application

[ Edited ]

The code I provided are C code snippets. You normally should go on and create your own DLL or class from it.

 

Anyway, I have done a DLL and a C# sample for you:

 

265i15400462CABB4B74      267i1331C9B32E504305

 

Attached is the VS2005 / WM6 SDK source code and the C-DLL called StartLock.DLL

 

EDIT:

The DLL provides the following functions:

LockStartMenu()/UnlockStartMenu()

    disables tapping (clicking) the start menu (clicks within first 158 pixels from left are catched and will not reach the taskbar window). Additionally the press of the WIN key is catched and does not reach hhtaskbar code.

 

LockStartbar()/UnlockStartbar()

    disables or enables the whole taskbar window (the top bar of the today screen but also the title bar of apps, as long as part of the taskbar)

 

LockDown(title)/Unlockdown()

   makes some calls to SHFullscreen API and makes the window with the title fullscreen

 

.....................Don't be lazy, give KUDOS........................
-------------==========================--------------
See all my tips and tools at hxxp://www.hjgode.de/dev
and the NEW http://www.hjgode.de/wp
code at google com:
http://code.google.com/p/itc-keyboard/
http://code.google.com/p/rdesktop-ce/
http://code.google.com/p/win-mobile-code/source/browse/#svn%2Ftrunk
Regular Contributor
AhmedAbdin
Posts: 82
Registered: ‎July 7 2010
0

Re: disappear or block start menu in all of application

hi

LockStartMenu() method close taskball not start menu.

i need method that close start menu only of all the application.

can you help me?

Regular Contributor
AhmedAbdin
Posts: 82
Registered: ‎July 7 2010
0

Re: disappear or block start menu in all of application

hi

 

i clarify what i need?

 

i need disable or close start menu only from taskbar and windows button on keypad.

and when i open any application from this interface , the start menu still not working .

 

i tried the prevoius code but when i open the calculator inside my application interface, the start menu is return to work .

please help me

Intermec Expert
hjgode
Posts: 1,886
Registered: ‎January 29 2009

Re: disappear or block start menu in all of application

I did some testing and although I cannot follow your issue, I see there is one possible issue:

The 'hot area' of the StartMenu is the top left Start symbol + the title of the current window/application. I changed the DLL to define 2/3 of the screen width as 'forbidden area'. Any clicks/taps in the area 0,0 x 26,2/3*screenwidth are not forwarded to hhtaskbar.

You can 'see' the hot area in the image below. It is the visible part of the title "A very long Application title text"

 

277i9EB3E7D3B4E6B084    

 

279iAEF1CA4531566341

 

In landscape, the hot area is up to x=~196 pixels. In portrait it looks like being up to 148 pixels. So the assumption using 2/3 of screen width is approximately OK.

 

To test the DLL with the demo app, start StartLockTestCS and then click [Lock Start]

try to tap the start menu or press Win key to open startmenu, it should not be possible

tap on [Launch MobileCalculator]

try again to open the start menu, it should be impossible

you can still click outside the hot area, for example the connection symbol or the close button (X) in Calculator.

tap the (X) in calculator to go back to StartLockTestCS

 

As long as StartLock is running and the window proc subclassing is in place you will not be able to open the start menu.

 

See video here StartLock Video

 

 

 

.....................Don't be lazy, give KUDOS........................
-------------==========================--------------
See all my tips and tools at hxxp://www.hjgode.de/dev
and the NEW http://www.hjgode.de/wp
code at google com:
http://code.google.com/p/itc-keyboard/
http://code.google.com/p/rdesktop-ce/
http://code.google.com/p/win-mobile-code/source/browse/#svn%2Ftrunk
Moderator
GeorgeBrown
Posts: 642
Registered: ‎January 28 2009

Re: disappear or block start menu in all of application

You should look at the "Intermec Launcher" utility on the Intermec website at www.intermec.com.  This might be exactly what you need.

VC Access
Renato
Posts: 1
Registered: ‎January 11 2012
0

Re: disappear or block start menu in all of application

How do I use this dll. NET?