Jump to content

Please complete the popup selections


Dirk98
 Share

Recommended Posts

Guys, below is a script by PaulIA. Please help me to complete it.

What it does is it finds the Volume control in the tray menu, right clicks on it and then selects/clicks one of the popupmenu items: "Open Volume Control". I need to find a way to SELECT which item to click on. In this example the alternative is "Adjust Audio Properties". Could you please modify this script to select/click "Adjust Audio Properties"?

I need this as an example to learn how to handle tray items of an external program I have. Many thanks for you help.

#include <A3LMenu.au3>
#include <A3LToolbar.au3>

Opt("WinTitleMatchMode", 4)

$hWnd   = ControlGetHandle("classname=Shell_TrayWnd", "", "Notification Area")
$iCount = _Toolbar_ButtonCount($hwnd)

for $iI = 1 to $iCount
  $iCommand = _Toolbar_IndexToCommand($hWnd, $iI)
  $sText    = _Toolbar_GetButtonText ($hWnd, $iCommand)
  if $sText = "Volume" then
    if ControlGetHandle("classname=Shell_TrayWnd", "", "Button2") <> 0 then
      ControlClick("classname=Shell_TrayWnd", "", "Button2")
    endif
    _Toolbar_ClickButton($hWnd, $iCommand, "right", False, 1, 1)
    _Menu_ClickPopupAccel("O")
    ExitLoop
  endif
next
Edited by Dirk98
Link to comment
Share on other sites

What is the purpose of this script? It could probably be accomplished without GUI interaction.

weaponx, I have a program that can only be activated by clicking on the icon in the tray and selecting a certain item in the popup menu. It is quite stupid, but so it goes. The exe is in the Program Files\GFKeys\GFKeys.exe.

Anyway, I was given the above example as a pointer to the solution. I would be happy to achieve the same in any different way (if any exists yet).

Thanks.

Link to comment
Share on other sites

So this never had anything to do with Windows Volume Control, you were just referencing that as an example??

Is this the program you are using: http://www.goflightinc.com/support.shtml

EDIT: Well i'm just going to assume this is the program you are using. I installed it but it doesn't provide full functionality because I do not have the proper device attached. However, there is a tray icon with some options:

Show Config Panel

Disable Key Mapping

Enable Key Mapping

Quit GFKeys

If you click Show Config Panel it brings up a window with buttons across the top which the AutoIT window info tool doesn't recognize.

So what do you need to do from here?

Edited by weaponx
Link to comment
Share on other sites

Not referencing the acutal program and using something standard is actually a good idea, weapon. After all, it's what the gods have done in the help file, using Notepad as the guniea pig. Besides...everyone using AutoIt has the volume control. Not everyone has GFKeys.exe installed.

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Link to comment
Share on other sites

Thanks, guys. GFkeys is a bitch, you can't activate the profile you have chosen in the normal program's GUI. YOU NEED MANUALLY invoke the menu in the tray afterwards by clicking on it with your mouse (WHICH WORKS already with the help of the above script), then selecting ENABLE KEY MAPPING option by moving your mouse pointer and clicking on this item (WHICH I can't figure out how except for with absolute mouse coordinates, that I don't really like).

Amazing community here.

Thank you very much for your efforts and help.

Edited by Dirk98
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...