Sign in to follow this  
Followers 0
Xichael

Script Request: "All Programs" Auto-Opener

9 posts in this topic

If I could have the Windows 7 Start Menu "All Programs" pane show immediately upon opening the start menu, I'd be very pleased indeed; but my completely amateur AutoIt skills are no match for this one.

I was hoping I could use WinWaitActive and a ControlClick, but AutoIt doesn't seem to notice the Start Menu's title parameter.

Anyone care to have a crack at it?

Share this post


Link to post
Share on other sites



Xichael: The whole idea of learning is to find someting that you can not do, and figure out how to do it.

We do not do script requests. We are happy to help you with problems encountered in the script however we do not make them for you.

Sorry.


[font="Comic Sans MS"]My code does not have bugs! It just develops random features.[/font]My Projects[list][*]Live Streaming (Not my project, but my edited version)[right]AutoIt Wrappers![/right][/list]Pure randomness[list][*]Small Minds.......................................................................................................[size="1"]Simple progress bar that changes direction at either sides.[/size][*]ChristmasIt AutoIt Christmas Theme..........................................................[size="1"]I WAS BOOOORED![/size][*]DriveToy..............................................................................................................[size="1"]Simple joke script. Trick your friends into thinking their computer drive is haywire![/size][/list]In Development[list][*]Your Background Task Organiser[*]AInstall Second Generation[/list]BEFORE POSTING ON THE FORUMS, TRY THIS:
%programfiles%/AutoIt3/autoit3.chm

Share this post


Link to post
Share on other sites

Who is this "we" you're speaking on behalf of?

I've noticed the exact opposite on this forum. Page after page of people writing and rewriting scripts for each other.

Perhaps others here will be a bit less offended the word "request". I'm keeping my fingers crossed.

And I would absolutely love to learn, if anyone would care to instruct.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

#NoTrayIcon
local $Ran

while 1

    sleep(50)

if WinActive("[Class:DV2ControlHost]") Then
    If $Ran = 0 Then
    ControlClick("[Class:DV2ControlHost]", "", "[CLASS:Button; INSTANCE:1]", "Left", 1)
    $Ran = 1
    EndIf
Else
$Ran = 0
EndIf

WEnd

Spoiler - Contains a More effective version of the code above when the taskbar is not showing, I welcome peoples view on this idea-style of coding if it should be supported or not :)

#NoTrayIcon
local $Ran

while 1
sleep(50)

if WinActive("[Class:DV2ControlHost]") or $Ran=1 Then
    if $Ran = 0 Then
    ControlClick("[Class:DV2ControlHost]", "", "[CLASS:Button; INSTANCE:1]", "Left", 1)
    $Ran = 1
    Elseif $Ran = 1 Then
         if WinActive("[Class:DV2ControlHost]") Then
         Else
         $Ran = 0
         EndIf
    EndIf
EndIf

WEnd

Less effective when Window is active but more effective when window is not active. The idea behind is, in the first code when the window is not active the code goes. Check Active - No, Check Else, Do Else, End. Whereas this code is just Check Active - No, End.

Edited by IanN1990
1 person likes this

Share this post


Link to post
Share on other sites

Thanks IanN1990! This is a long-time dream come true.

I make a habit of culling away all but the most essential shortcuts form All Programs, which has always made the Start Menu seem an unnecessary obstacle.

Now off to wrap my head around how it all works.

Share this post


Link to post
Share on other sites

Just added

ControlFocus("[CLASS:DV2ControlHost]", "", "[CLASS:DirectUIHWND; INSTANCE:1]")
to give focus back to the search box.

#NoTrayIcon
Local $Ran

While 1
   Sleep(50)

If WinActive("[CLASS:DV2ControlHost]") or $Ran=1 Then
   If $Ran = 0 Then
   ControlClick("[CLASS:DV2ControlHost]", "", "[CLASS:Button; INSTANCE:1]")
   ControlFocus("[CLASS:DV2ControlHost]", "", "[CLASS:DirectUIHWND; INSTANCE:1]")
   $Ran = 1
   ElseIf $Ran = 1 Then
      If WinActive("[CLASS:DV2ControlHost]") Then
      Else
      $Ran = 0
      EndIf
   EndIf
EndIf

WEnd

Share this post


Link to post
Share on other sites

Glad i was able to help :)

Share this post


Link to post
Share on other sites

A bit late to the party but thanks Xichael and IanN1990

This script is invaluable to me and a lifesaver when using Windows 7 on a daily basis

I wondered however if the script could be improved to cover 2 slight issues I've come across whilst using it?

  1. Occasionally when clicking on my start button and my start menu opens and the script fires and correctly shows 'All Programs' I find that focus isn't always given to the search box until I mouse off my start button and over my start menu. Could the focus code be extended to remove this side effect?
  2. When deleting folders from my start menu upon completion of the delete my start menu jumps to showing me the recent/pinned apps list. I then have to click 'All Programs' again manually to be shown what I want to see. Could the script refire on this occasion to automatically show 'All Programs' again or is there a way to prevent a delete from reverting back to the recent/pinned apps list?

I am a noob at AutoIt but a willing programmer.

Thanks

Share this post


Link to post
Share on other sites

First off, necro-posting after more than two years is generally discouraged. It would be better if you started a thread of your own, rather than expecting people to read through an entire topic to get to your question.

As to that question, the answer is yes; those items can be added, and quite easily. Why not post what you tried on your own?

1. What can you find in the help file regarding giving a window focus (look under Window Management).

2. Look at Func in the help file, so you can see how to call the code to launch all programs, and then call it again if necessary.

If you run into issues, feel free to post what you have and we will do our best to help.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0