views:

29

answers:

0

I have a Authorize Use Policy probram i am trying to update for Windows 7. I am trying to hide/ disable the orb or start button, in the past it was a child of the taskbar so hiding the taskbar was the solution (old code below). I have found some c# code that seems to do it but have been unsuccessful at converting it.

my old code (for xp) is below and still works to hide the taskbar:

<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
Private Shared Function FindWindow( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) As IntPtr
End Function

<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
Private Shared Function ShowWindow( _
ByVal hwnd As IntPtr, _
ByVal nCmdShow As Int32) As Boolean
End Function

Public Shared Sub TaskBar(ByVal blnValue As Boolean)

Dim lngtaskbar As Long

lngtaskbar = FindWindow("Shell_TrayWnd", "")
If blnValue Then
   ShowWindow(lngtaskbar, 5)
Else
   ShowWindow(lngtaskbar, 0)
End If

End Sub

the c# code that should hide the orb is below:

[DllImport("user32.dll")] 
private static extern IntPtr FindWindowEx( 
IntPtr parentHwnd, 
IntPtr childAfterHwnd, 
IntPtr className, 
string windowText); 

IntPtr hwndOrb = FindWindowEx(IntPtr.Zero, IntPtr.Zero, (IntPtr)0xC017, null); 

ShowWindow(hwndOrb, SW_HIDE);