PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Compact Framework
disable Start menu button
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Compact Framework
disable Start menu button
![]() |
disable Start menu button |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Hi,
We are developing application in VS .NET 2005 + C# + .NET CF 2.0 SP1 My user requirement is ... to disable the Start menu button (Upper left side, to invoke the start up menu) . This way we can prevent the user to click on any other program or control panel when our application is running. Is there a way to achieve this? Thanks in advance -- With Best Regards, Harsh Trivedi |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Hi,
Hurrey, this worked for me...to disable the start menu... ShowWindow(FindWindow("HHTaskBar", null), 1); //0=hide, 1=show On the same track, if anyone can sent source code to set start button as visible false.... ![]() -- With Best Regards, Harsh Trivedi "Harsh Trivedi" <harsh.trivedi@gatewaytechnolabs.com> wrote in message news:O3ue1s$XHHA.1388@TK2MSFTNGP05.phx.gbl... > Hi, > > We are developing application in VS .NET 2005 + C# + .NET CF 2.0 SP1 > > My user requirement is ... to disable the Start menu button (Upper left > side, to invoke the start up menu) . This way we can prevent the user to > click on any other program or control panel when our application is > running. > > Is there a way to achieve this? > > Thanks in advance > > -- > With Best Regards, > > Harsh Trivedi > |
|
|
|
#3 |
|
Guest
Posts: n/a
|
Yes, that's one thing that you'd need to do. You'd also need to disable
that window so Alt+Tab doesn't allow the user to switch applications. You'll basically have to P/Invoke to those functions (ShowWindow, FindWindow, EnableWindow), to accomplish this operation. Paul T. "Harsh Trivedi" <harsh.trivedi@gatewaytechnolabs.com> wrote in message news:uGFEBOAYHHA.3256@TK2MSFTNGP04.phx.gbl... > Hi, > > Hurrey, this worked for me...to disable the start menu... > ShowWindow(FindWindow("HHTaskBar", null), 1); //0=hide, 1=show > > On the same track, if anyone can sent source code to set start button as > visible false.... ![]() > > -- > With Best Regards, > > Harsh Trivedi > > > > "Harsh Trivedi" <harsh.trivedi@gatewaytechnolabs.com> wrote in message > news:O3ue1s$XHHA.1388@TK2MSFTNGP05.phx.gbl... >> Hi, >> >> We are developing application in VS .NET 2005 + C# + .NET CF 2.0 SP1 >> >> My user requirement is ... to disable the Start menu button (Upper left >> side, to invoke the start up menu) . This way we can prevent the user to >> click on any other program or control panel when our application is >> running. >> >> Is there a way to achieve this? >> >> Thanks in advance >> >> -- >> With Best Regards, >> >> Harsh Trivedi >> > > |
|
|
|
#4 |
|
Guest
Posts: n/a
|
Here is something I use, which I found on the net some time ago.
Kay Imports System.Runtime.InteropServices Public Class BarControl <DllImport("coredll.dll", EntryPoint:="GetForegroundWindow", SetLastError:=True)> Private Shared Function GetForegroundWindow() As IntPtr End Function <DllImport("aygshell.dll", EntryPoint:="SHFullScreen", SetLastError:=True)> Private Shared Function SHFullScreen(ByVal hwndRequester As IntPtr, ByVal dwState As Integer) As Boolean End Function <DllImport("coredll.dll", EntryPoint:="EnableWindow")> Private Shared Function EnableWindow(ByVal hwnd As IntPtr, ByVal bEnable As Boolean) As Boolean End Function <DllImport("coredll.dll", EntryPoint:="FindWindow")> Private Shared Function FindWindow(ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr End Function Private Const SHFS_SHOWSTARTICON As Integer = &H10 Private Const SHFS_HIDESTARTICON As Integer = &H20 Private Const SHFS_HIDESIPBUTTON As Integer = &H8 Private Const SHFS_SHOWSIPBUTTON As Integer = &H4 Private Const SHFS_SHOWTASKBAR As Integer = &H1 Private Const SHFS_HIDETASKBAR As Integer = &H2 Private Shared Function SetTaskBarEnabled(ByVal bEnabled As Boolean) As Boolean Dim hwnd As IntPtr = FindWindow("HHTaskBar", Nothing) If Not hwnd.Equals(IntPtr.Zero) Then If bEnabled Then Return EnableWindow(hwnd, True) Else Return EnableWindow(hwnd, False) End If End If Return True End Function Private Shared Function SetTaskbarVisible(ByVal visible As Boolean) As Boolean Dim hwnd As IntPtr = FindWindow("HHTaskBar", Nothing) If Not hwnd.Equals(IntPtr.Zero) Then If visible Then Return SHFullScreen(hwnd, SHFS_SHOWTASKBAR) Else Return SHFullScreen(hwnd, SHFS_HIDETASKBAR) End If End If End Function Private Shared Function SetStartButtonVisible(ByVal visible As Boolean) As Boolean Dim hwnd As IntPtr = GetForegroundWindow() If Not hwnd.Equals(IntPtr.Zero) Then If visible Then Return SHFullScreen(hwnd, SHFS_SHOWSTARTICON) Else Return SHFullScreen(hwnd, SHFS_HIDESTARTICON) End If End If End Function Private Shared Function SetSIPVisible(ByVal visible As Boolean) As Boolean Dim hwnd As IntPtr = GetForegroundWindow() If Not hwnd.Equals(IntPtr.Zero) Then If visible Then Return SHFullScreen(hwnd, SHFS_HIDESIPBUTTON) Else Return SHFullScreen(hwnd, SHFS_HIDESIPBUTTON) End If End If End Function Public Shared Sub ShowTaskBar() SetTaskBarEnabled(True) SetTaskbarVisible(True) End Sub Public Shared Sub HideTaskBar() SetTaskbarVisible(False) SetTaskBarEnabled(False) End Sub Public Shared Sub ShowSIP() SetSIPVisible(True) End Sub Public Shared Sub HideSIP() SetSIPVisible(False) End Sub Public Shared Sub HideStartButton() SetStartButtonVisible(False) End Sub Public Shared Sub ShowStartButton() SetStartButtonVisible(True) End Sub End Class |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 


