Solved

Change taskbar properties (eg. set autohide) in VB.NET

Posted on 2003-10-31
6
1,735 Views
Last Modified: 2012-08-14
Using vb.net, how can I set properties of the windows taskbar?  
For simplicity sake, I have a form with a single button on it....
I'd like the button to show the taskbar status of autohide, not autohide
As the button clicked, I'd like to toggle the state back and forth.
I can't find what I need in the framework.
thanks
0
Comment
Question by:jctiii
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 48

Expert Comment

by:Mikal613
ID: 9659275
You cant But you can get if it in autohide or the coordiantes with the api SHAppBarMessage .
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 9660086
With the SHAppBarMessage function, and ABM_GETSTATE and ABM_SETSTATE, you can get/set the state of the AutoHide and AlwaysOnTop properties of the taskbar.
0
 

Author Comment

by:jctiii
ID: 9660429
I've read about  the SHAppBarMessage function...   How do I use this function in vb.net?
 
0
Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 9660540
  Public Structure RECT
      Public Left As Integer
      Public Top As Integer
      Public Right As Integer
      Public Bottom As Integer
   End Structure

   Public Structure APPBARDATA
      Public cbSize As Integer
      Public hwnd As Integer
      Public uCallbackMessage As Integer
      Public uEdge As Integer
      Public rc As RECT
      Public lParam As Integer      'message specific
   End Structure 'APPBARDATA'

   Private Const ABM_GETSTATE As Integer = &H4
   Private Const ABS_ALWAYSONTOP As Integer = &H2

   Private Declare Function SHAppBarMessage Lib "shell32.dll" _
       (ByVal dwMessage As Integer, ByRef pData As APPBARDATA) As Integer

   Private Function AutoHide() As Boolean

      Dim appBar As APPBARDATA
      Dim state As Integer

      appBar.cbSize = Len(appBar)

      state = SHAppBarMessage(ABM_GETSTATE, appBar)

      Return (state <> ABS_ALWAYSONTOP)

   End Function
0
 

Author Comment

by:jctiii
ID: 9670501
Ok... you gave me enough to get the state but not how to set the state.  Nevertheless, you did provide enough for one (even if not 'learned') to figure it out....
Thanks.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 9670509
The opposite side is ABM_SETSTATE.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question