Solved

Programmatically Change AutoHide on Taskbar

Posted on 1998-08-06
2
421 Views
Last Modified: 2010-04-04
How can you change the Taskbar in Windows 95 from AutoHide to not Autohide using Code. We have unsuccessfully tried SHAppBarMessage.
0
Comment
Question by:iaglass
[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
2 Comments
 
LVL 8

Accepted Solution

by:
ZifNab earned 200 total points
ID: 1361618
iaglass,

That's because SHAppBarMessage hasn't got the tools for doing this! It can't be done by SHAppBarrMessage... (If somebody knows it is possible through this function, may he then strike me with thunder and lightning bolt)

Here a the possibilities of SHAppBarMessage :

ABM_ACTIVATE  Notifies the system that an appbar has been activated.  
ABM_GETAUTOHIDEBAR  Retrieves the handle to the autohide appbar associated with a particular edge of the screen.  
ABM_GETSTATE  Retrieves the autohide and always-on-top states of the Windows taskbar.  
ABM_GETTASKBARPOS  Retrieves the bounding rectangle of the Windows taskbar.  
ABM_NEW  Registers a new appbar and specifies the message identifier that the system should use to send notification messages to the appbar.  
ABM_QUERYPOS  Requests a size and screen position for an appbar.  
ABM_REMOVE  Unregisters an appbar, removing the bar from the system's internal list.
ABM_SETAUTOHIDEBAR  Registers or unregisters an autohide appbar for an edge of the screen.  
ABM_SETPOS  Sets the size and screen position of an appbar.  
ABM_WINDOWPOSCHANGED  Notifies the system when an appbar's position has changed.  

You see, you CAN get the STATE (auto-hide, always-on-top, none), that's easy... BUT you DON'T have a method to change these damn things!

What you can do in your own program is :

procedure hideTaskbar;
var wndHandle : THandle;
    wndClass : array[0..50] of Char;
begin
 StrPCopy(@wndClass[0], 'Shell_TrayWnd');
 wndHandle := FindWindow(@wndClass[0], nil);
 ShowWindow(wndHandle, SW_HIDE); // This hides the taskbar
end;

procedure showTaskbar;
var wndHandle : THandle;
    wndClass : array[0..50] of Char;
begin
 StrPCopy(@wndClass[0], 'Shell_TrayWnd');
 wndHandle := FindWindow(@wndClass[0], nil);
 ShowWindow(wndHandle, SW_RESTORE); // This restores the taskbar
end;

But that's not exactly what you want....

So, I think the only way to change it, is to directely change it in the registry!

Regards, Zif.
0
 
LVL 2

Expert Comment

by:freter
ID: 1361619
iaglass:
Zif is damn right. There is no way to do this in Delphi. I have had a hard time finding this out myself. Even if you try to look it up on Support Online (http://support.microsoft.com) or the MSDN (www.microsoft.com/msdn), you will only find descriptions of how to do it manually (right click the taskbar, select properties, blahblah...). Hiwver, I found out which keys need to be patched in the reg. Here we go:
file autohide.reg>>>>>>>>>>>
REGEDIT4

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects]
"Settings"=hex:38,00,00,00,00,04,00,00,00,03,00,00,3e,00,00,00,3e,00,00,00,1e,\
  00,00,00,1e,00,00,00,%*AUTOHIDE*%,00,00,00,fe,ff,ff,ff,e4,02,00,00,02,04,00,00,02,03,\
  00,00,03,00,00,00,02,00,00,00
<<<<<<<<<<<<<<<<<<<<<<<<<<
Please replace the string %*AUTOHIDE*% with 01 to autohide the bar and 00 to "not autohide" it.
Ah, and don't be confused if this setting doesn't take effect immediately. Just reboot the machine. Everything should be finde then.

Hope this helps to solve your problem,
Freter
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses
Course of the Month5 days, 1 hour left to enroll

635 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