AutoHotkey Community

It is currently May 25th, 2012, 11:44 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 32 posts ]  Go to page 1, 2, 3  Next
Author Message
PostPosted: February 7th, 2008, 8:08 pm 
Hi all!

Hope somebody can help, I've been trying to get this to work for hours.

I want to be able to press win-alt-t and have the auto hide taskbar property be toggled.

Here is what I think should work:
Code:
;Open Taskbar properties, toggle autohide taskbar, apply and close window
;------------------------------------------------------------------------
#!t::Run, RunDLL32.EXE shell32.dll`,Options_RunDLL 1
WinWait, Taskbar and Start Menu Properties
Send, ua{ESC}


Problem is it doesn't. It gets as far as opening the taskbar properties but then nothing else happens. Even if you comment out the send line and try to open a webpage it doesn't do that either.

I can get it to work by splitting the work between two key combos, one to open the window one to do the sending. Does this suggest something wrong with the WinWait?

I've tried countless other workarounds and stuff to try and get it to work but to no avail. Anybody have any ideas?

Thanks in advance.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 7th, 2008, 8:13 pm 
Offline

Joined: June 6th, 2006, 3:19 pm
Posts: 1654
Location: Denmark
This is what i use (note different hotkey):
Code:
+esc::
if toggle := !toggle
   WinHide ahk_class Shell_TrayWnd
else
   WinShow ahk_class Shell_TrayWnd
return

Edit: Credits goes to jonny for this!

Also note that for multi-line scripts the code have to start on the line below the hotkey label.

_________________
RegEx Powered Dynamic Hotstrings
COM
AutoHotkey 2


Last edited by tonne on February 7th, 2008, 8:23 pm, edited 2 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 7th, 2008, 8:19 pm 
Offline

Joined: June 6th, 2006, 3:19 pm
Posts: 1654
Location: Denmark
Sorry, my script doesn't toggle autohide, it merely hides or unhides the taskbar. But it works for me ;-)

_________________
RegEx Powered Dynamic Hotstrings
COM
AutoHotkey 2


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 7th, 2008, 8:37 pm 
Thanks for your reply Tonne.

As you said it only hides the taskbar by sort of making it completely transparent it doesn't give me the extra little bit of screen space that I'm after. I'm trying to make oneNote's full screen, more full screen if you know what I mean.

Any other ideas, anyone?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 7th, 2008, 8:41 pm 
Forget the above post, I've fixed it!

Re-read Tonne's post and noticed the comment about starting on the line below, moved it down so it now looks like this:

Code:
;Open Taskbar properties, toggle autohide taskbar, apply and close window
;------------------------------------------------------------------------
#!t::
Run, RunDLL32.EXE shell32.dll`,Options_RunDLL 1
WinWait, Taskbar and Start Menu Properties
Send, ua{ESC}


Can't believe that's all that was wrong!

Thanks again Tonne!


Report this post
Top
  
Reply with quote  
 Post subject: Can use Taskbar space..
PostPosted: September 9th, 2008, 7:33 pm 
Gav_Oracle wrote:
Thanks for your reply Tonne.

As you said it only hides the taskbar by sort of making it completely transparent it doesn't give me the extra little bit of screen space that I'm after. I'm trying to make oneNote's full screen, more full screen if you know what I mean.

Any other ideas, anyone?


Hi Gav,
SKAN's script is perfect.

I am using Vista with the task bar on my screens right edge. With SKAN's script, the taskbar becomes invisible except for the start button and then I can move windows to the space previously for taskbar. If I toggle back the task bar, it simply overlays the windows in it position.

Perfect!!


Report this post
Top
  
Reply with quote  
PostPosted: September 9th, 2008, 7:48 pm 
Offline

Joined: September 9th, 2008, 7:35 pm
Posts: 1
neo_in wrote:
Gav_Oracle wrote:
Thanks for your reply Tonne.

As you said it only hides the taskbar by sort of making it completely transparent it doesn't give me the extra little bit of screen space that I'm after. I'm trying to make oneNote's full screen, more full screen if you know what I mean.

Any other ideas, anyone?


Hi Gav,
SKAN's script is perfect.

I am using Vista with the task bar on my screens right edge. With SKAN's script, the taskbar becomes invisible except for the start button and then I can move windows to the space previously for taskbar. If I toggle back the task bar, it simply overlays the windows in it position.

Perfect!!

Apologies..
doesnt work for full screen..


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 10th, 2008, 2:43 am 
Offline

Joined: May 17th, 2007, 9:06 pm
Posts: 421
Location: England
Does this work for you:
Code:
#SingleInstance, Force
#Persistent
#NoEnv
SetBatchLines, -1
Return

F12::
{
    If( TaskbarToggle = "" )
    {
        VarSetCapacity( APPBARDATA, 36, 0 )
        NumPut( 36, APPBARDATA, 0, "UInt" ) ; cbSize
        NumPut( WinExist( "ahk_class Shell_TrayWnd" ), APPBARDATA, 4, "UInt" ) ; hWnd
        TaskbarToggle := 0
    }
    If( TaskbarToggle = 0 )
    {
        NumPut( ( ABS_ALWAYSONTOP := 0x2 )|( ABS_AUTOHIDE := 0x1 ), APPBARDATA, 32, "UInt" ) ; lParam
        TaskbarToggle := 1
    }
    Else
    {
        NumPut( ( ABS_ALWAYSONTOP := 0x2 ), APPBARDATA, 32, "UInt" ) ; lParam
        TaskbarToggle := 0
    }
    DllCall( "Shell32.dll\SHAppBarMessage", "UInt", ( ABM_SETSTATE := 0xA ), "UInt", &APPBARDATA )
    Return
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 13th, 2008, 4:23 pm 
Offline

Joined: October 13th, 2008, 4:14 pm
Posts: 60
Location: South Park, Colorado
I've borrowed heavily from the code shown above and added a loop to re-hide the taskbar when Windows shows it again before I'm ready to see it. F12 is hotkey'd to show/hide the task bar.

I'm sure that my code can be written more elegantly, but this is working excellently for me on 64-bit Vista.

Code:
x:=1   ; set x to 0 to start script with taskbar enabled

{
   DetectHiddenWindows, On
   VarSetCapacity( APPBARDATA, 36, 0 )
   NumPut( 36, APPBARDATA, 0, "UInt" ) ; cbSize
   NumPut( WinExist( "ahk_class Shell_TrayWnd" ), APPBARDATA, 4, "UInt" ) ; hWnd
   IfWinExist, ahk_class Shell_TrayWnd
   NumPut( ( ABS_ALWAYSONTOP := 0x2 )|( ABS_AUTOHIDE := 0x1 ), APPBARDATA, 32, "UInt" ) ; lParam
   WinHide ahk_class Shell_TrayWnd
   DllCall( "Shell32.dll\SHAppBarMessage", "UInt", ( ABM_SETSTATE := 0xA ), "UInt", &APPBARDATA )
}

part1:
{
   Loop
   {   
      If (x=1)
      {
      WinHide ahk_class Shell_TrayWnd
      IfWinExist, ahk_class Shell_TrayWnd
      NumPut( ( ABS_ALWAYSONTOP := 0x2 )|( ABS_AUTOHIDE := 0x1 ), APPBARDATA, 32, "UInt" ) ; lParam
              DllCall( "Shell32.dll\SHAppBarMessage", "UInt", ( ABM_SETSTATE := 0xA ), "UInt", &APPBARDATA )
      }
      If (x=0)
      {
         goto part2
      }
      Continue
   }

}

part2:
{
           NumPut( ( ABS_ALWAYSONTOP := 0x2 ), APPBARDATA, 32, "UInt" ) ; lParam
           DllCall( "Shell32.dll\SHAppBarMessage", "UInt", ( ABM_SETSTATE := 0xA ), "UInt", &APPBARDATA )
           WinShow ahk_class Shell_TrayWnd
   x:=2
   goto part1
}

f12::
{
   if toggle := !toggle
         x:=0
   else
         x:=1
   return
}


Report this post
Top
 Profile  
Reply with quote  
PostPosted: October 29th, 2008, 3:37 am 
Hi all... I have UMPC and I need the screen space. I want to find a hotkey that will allow me to toggle the task bar on & off or off & auto-hide. I am impressed with this running post, but I have NO idea where one writes this code. Can you tell me (Or do I just need to hire someone to do this for me?)
Sylvia


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 24th, 2009, 7:13 pm 
Hello,

can anybody tell me how I use these scripts?

Because I am using the Software "ObjectDock" which creates me a new taskbar. There I checked to hide the original taskbar.

But sometimes I would like the original one to show, too...

Can I use these scripts for that, too?

If yes, how do I have to save this code? In what kind of file?

Would be great if anyone could help me!

greetings,
Josh

P.s: using Win Vista 32 Bit


Report this post
Top
  
Reply with quote  
 Post subject: Autohide Taskbar
PostPosted: April 13th, 2009, 10:17 am 
Offline

Joined: April 13th, 2009, 10:13 am
Posts: 1
I hope this helps:
http://www.mim-sraga.hr/zvuk/toggleTaskbarAutohide.htm
It's a standalone Win32 app I wrote in C++. I use AutoHotkey to trigger it :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Better Script
PostPosted: April 20th, 2009, 11:40 pm 
I was looking for something like this for a while, and this thread helped me finally make something that works, so I figured I would let people know how to do it.

Thanks very much to EricCartman for the function calls, really all I did was fix the structure of the code.

Eric's code was working perfectly until I realized it was using 25% processor :shock: when the taskbar was showing.

This code uses no looping mechanisms, so it doesn't do anything except when you want it to.

Code:
{
   DetectHiddenWindows, On
   VarSetCapacity( APPBARDATA, 36, 0 )
   NumPut( ( ABS_ALWAYSONTOP := 0x2 )|( ABS_AUTOHIDE := 0x1 ), APPBARDATA, 32, "UInt" )
   DllCall( "Shell32.dll\SHAppBarMessage", "UInt", ( ABM_SETSTATE := 0xA ), "UInt", &APPBARDATA )
   Sleep 10                                ;Sometimes the bar doesn't get hidden 'all of the way' this prevents that.
   WinHide ahk_class Shell_TrayWnd
} ;If you want the taskbar to start visible, delete this block.

x=1

f12::  ;The key used to toggle the taskbar. Change it as you like.
{
   If x=0
   {
      NumPut( ( ABS_ALWAYSONTOP := 0x2 ), APPBARDATA, 32, "UInt" )
      DllCall( "Shell32.dll\SHAppBarMessage", "UInt", ( ABM_SETSTATE := 0xA ), "UInt", &APPBARDATA )
      WinShow ahk_class Shell_TrayWnd
      x=1
      return
   }

   If x=1
   {
      DetectHiddenWindows, On
      VarSetCapacity( APPBARDATA, 36, 0 )
      NumPut( ( ABS_ALWAYSONTOP := 0x2 )|( ABS_AUTOHIDE := 0x1 ), APPBARDATA, 32, "UInt" )
      DllCall( "Shell32.dll\SHAppBarMessage", "UInt", ( ABM_SETSTATE := 0xA ), "UInt", &APPBARDATA )
      Sleep 10
      WinHide ahk_class Shell_TrayWnd
      x=0
      return
   }
}


For people wondering how to 'install'/ 'where' to write this (as I did at first): 1-Download and install autohotkey. 2-Simply copy the above code and paste it into notepad. 3-save this file as a .ahk file. 4-open the file to run the script.

I'm not sure how to get this to happen automatically when you log in, but I don't know that much about autohotkey. I'm sure there is some way to do it if you look

Hope this helps.


Report this post
Top
  
Reply with quote  
 Post subject: Re: Better Script
PostPosted: April 21st, 2009, 1:33 am 
Offline

Joined: April 18th, 2008, 7:57 am
Posts: 1390
Location: The Interwebs
indiglo wrote:
I'm not sure how to get this to happen automatically when you log in,

Put it in your startup directory:
C:\Users\USERNAMEFORCOMPUTERHERE\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
That is a directory specific to the user logged on... There's one for all users as well but I don't recall what it is at the moment. I'm sure you could find it with some quick searching.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: Better Script
PostPosted: April 28th, 2009, 6:11 pm 
Offline

Joined: April 20th, 2009, 11:42 pm
Posts: 5
Krogdor wrote:
Put it in your startup directory


I tried doing that with both the .ahk file, and after converting it into an exe. Does it take windows a long time to execute the file or something? Or is there just something else on my computer preventing it from running? Thanks.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 32 posts ]  Go to page 1, 2, 3  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, Exabot [Bot], Google Feedfetcher, LazyMan, Tegno, Yahoo [Bot] and 19 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group