Solved

Programmatically Change AutoHide on Taskbar

Posted on 1998-08-06
2
404 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
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Correct Component for Shopping Cart. 2 120
CheckListBox usage 3 80
enhance the following code 3 42
Twebbrowser add css to the header 3 37
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
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…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

685 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