Solved

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

Posted on 2003-10-31
6
1,750 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
Tutorials alone can't teach real engineering

So we built better training tools.

-Hands-on Labs
-Instructor Mentoring
-Scenario-Based Tests
-Dedicated Cloud Servers

All at your fingertips. What are you waiting for?

 
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

The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

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…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

691 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