Solved

Programmatically Change AutoHide on Taskbar

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now