.Net GURU Wanted ---> TaskBar Hide Show & ScrollBar size

  • Thread starter Thread starter spielmann
  • Start date Start date
S

spielmann

Hi

How can we hide and show the taskbar without dll on vb.net?
How can we set the scrollbar size without dll on vb.net?
 
spielmann said:
How can we hide and show the taskbar without dll on vb.net?
How can we set the scrollbar size without dll on vb.net?


Without DLL?? Everything is in a DLL.

There's not built-in method in the .NET framework. You can only retrieve
some values from System.Windows.Forms.SystemInformation

You have to use pInvoke (calling API functions) to change the settings. See
the platform SDK for details.
 
Hello,

spielmann said:
How can we hide and show the taskbar without dll on vb.net?

http://www.activevb.de/tipps/vb6tipps/tipp0003.html

Notice that the sample is written in VB6, in order to use it with VB .NET,
you must replace all "As Long"s with "As Int32"s.

Without DLL? I do not understand...
How can we set the scrollbar size without dll on vb.net?

This should be done in the dialogs provided by the operating system.

Regards,
Herfried K. Wagner
 
In VB6 you could do this
put in module: (change all types in declare to vb.net equivalents)

Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal
hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Public Const WS_EX_TRANSPARENT = &H20&
Public Const WS_EX_NOPARENTNOTIFY = &H4&
Global hwnd1 As Long

Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal
hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long,
ByVal cy As Long, ByVal wFlags As Long) As Long
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal
lpClassName As String, ByVal lpWindowName As String) As Long

Global Const SWP_SHOWWINDOW = &H40
Global Const SWP_HIDEWINDOW = &H80

Now put this in your form or class whatever

'Default Property Values:
Const m_def_HideTaskBar = 0

'Property Variables:
Dim m_HideTaskBar As Boolean

Private Sub HideTheTaskBar(HideIt As Boolean)
hwnd1 = FindWindow("Shell_traywnd", "")
If HideIt Then
OK = SetWindowPos(hwnd1, 0, 0, 0, 0, 0, SWP_HIDEWINDOW)
Else
OK = SetWindowPos(hwnd1, 0, 0, 0, 0, 0, SWP_SHOWWINDOW)
End If
End Sub

Private Sub Image1_Click()
HideTheTaskBar (HideTaskBar)
End Sub

Public Property Get HideTaskBar() As Boolean
HideTaskBar = m_HideTaskBar
End Property

Public Property Let HideTaskBar(ByVal New_HideTaskBar As Boolean)
m_HideTaskBar = New_HideTaskBar
HideTheTaskBar New_HideTaskBar
PropertyChanged "HideTaskBar"
End Property

Private Sub Form_Load()
m_HideTaskBar = m_def_HideTaskBar
End Sub

Take this code and modify a bit for .NET and it will work.
be sure to declare HWND variables as required and change declares as you
should.

HTH

Shane Story
 
In VB6 you could do this
put in module: (change all types in declare to vb.net equivalents)

Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal
hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Public Const WS_EX_TRANSPARENT = &H20&
Public Const WS_EX_NOPARENTNOTIFY = &H4&
Global hwnd1 As Long

Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal
hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long,
ByVal cy As Long, ByVal wFlags As Long) As Long
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal
lpClassName As String, ByVal lpWindowName As String) As Long

Global Const SWP_SHOWWINDOW = &H40
Global Const SWP_HIDEWINDOW = &H80

Now put this in your form or class whatever

'Default Property Values:
Const m_def_HideTaskBar = 0

'Property Variables:
Dim m_HideTaskBar As Boolean

Private Sub HideTheTaskBar(HideIt As Boolean)
hwnd1 = FindWindow("Shell_traywnd", "")
If HideIt Then
OK = SetWindowPos(hwnd1, 0, 0, 0, 0, 0, SWP_HIDEWINDOW)
Else
OK = SetWindowPos(hwnd1, 0, 0, 0, 0, 0, SWP_SHOWWINDOW)
End If
End Sub

Private Sub Image1_Click()
HideTheTaskBar (HideTaskBar)
End Sub

Public Property Get HideTaskBar() As Boolean
HideTaskBar = m_HideTaskBar
End Property

Public Property Let HideTaskBar(ByVal New_HideTaskBar As Boolean)
m_HideTaskBar = New_HideTaskBar
HideTheTaskBar New_HideTaskBar
PropertyChanged "HideTaskBar"
End Property

Private Sub Form_Load()
m_HideTaskBar = m_def_HideTaskBar
End Sub

Take this code and modify a bit for .NET and it will work.
be sure to declare HWND variables as required and change declares as you
should.

HTH

Shane Story


spielmann said:
Hi

How can we hide and show the taskbar without dll on vb.net?
How can we set the scrollbar size without dll on vb.net?
 
Thx but I want something like this

System.Windows.Forms.SystemInformation.VerticalScrollBarWidth

I won't use a dll, I will use vb.net object only, like this it will be
transparent for me.

but thx
 
Back
Top