Advertisement
Guest User

Untitled

a guest
Sep 20th, 2010
465
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.28 KB | None | 0 0
  1. #Region "Impertent"
  2. Imports System.Runtime.InteropServices
  3. #End Region
  4.  
  5.  
  6. Public Class TaskBoard
  7.  
  8.     Sub New()
  9.  
  10.     End Sub
  11.  
  12. #Region "Private Share Vars"
  13.     Private Shared WM_CLOSE As Integer = &H10
  14. #End Region
  15.  
  16. #Region "WIN32 API"
  17.     <DllImport("coredll.dll", EntryPoint:="FindWindow")> _
  18.     Private Shared Function FindWindow( _
  19.         ByVal lpClassName As String, _
  20.         ByVal lpWindowName As String) As IntPtr
  21.     End Function
  22.  
  23.     <DllImport("coredll.dll", EntryPoint:="FindWindow")> _
  24.     Private Shared Function FindWindowByClass( _
  25.          ByVal lpClassName As String, _
  26.          ByVal zero As IntPtr) As IntPtr
  27.     End Function
  28.  
  29.     <DllImport("coredll.dll", EntryPoint:="FindWindow")> _
  30.     Private Shared Function FindWindowByCaption( _
  31.          ByVal zero As IntPtr, _
  32.          ByVal lpWindowName As String) As IntPtr
  33.     End Function
  34.  
  35.     <DllImport("coredll.dll", EntryPoint:="SendMessage")> _
  36.    Private Shared Function SendMessage(ByVal hWnd As IntPtr, ByVal wMsg As Integer, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As Integer
  37.     End Function
  38.  
  39. #End Region
  40.     Public Sub DisableTaskMenu()
  41.         Dim TaskMenu As IntPtr = FindWindow("HHTaskBar", Nothing)
  42.         SendMessage(TaskMenu, WM_CLOSE, Nothing, Nothing)
  43.     End Sub
  44. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement