PC Review


Reply
Thread Tools Rate Thread

disable Start menu button

 
 
Harsh Trivedi
Guest
Posts: n/a
 
      6th Mar 2007
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


 
Reply With Quote
 
 
 
 
Harsh Trivedi
Guest
Posts: n/a
 
      6th Mar 2007
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" <(E-Mail Removed)> wrote in message
news:O3ue1s$(E-Mail Removed)...
> 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
>



 
Reply With Quote
 
Paul G. Tobey [eMVP]
Guest
Posts: n/a
 
      6th Mar 2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:O3ue1s$(E-Mail Removed)...
>> 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
>>

>
>



 
Reply With Quote
 
Kay-Christian Wessel
Guest
Posts: n/a
 
      6th Mar 2007
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


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable Start Menu Button Tooltip "click here to begin" Baron Windows XP General 4 13th Jun 2008 08:05 PM
keyboard start menu button, how to disable??? Rick Windows XP Basics 3 12th May 2004 04:00 AM
Re: disable context menu at start button The Masked Crusader Microsoft Windows 2000 Registry Archive 0 25th Jun 2003 06:55 PM
Re: disable context menu at start button The Masked Crusader Microsoft Windows 2000 Registry 0 25th Jun 2003 06:55 PM
Re: disable context menu at start button The Masked Crusader Microsoft Windows 2000 Registry Archive 0 25th Jun 2003 06:55 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:05 PM.