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
Solved

Programmatically Change AutoHide on Taskbar

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
URL for downloading Google Chrome for Win XP 2 182
tidtcpserver connection lost handle 2 102
When i run adoquery my application freezes 26 178
Firemonkey webbrowser scrollbars ? 1 50
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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

840 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