Solved

Programmatically Change AutoHide on Taskbar

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

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
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…

732 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