Jump to content

Palm install question


Recommended Posts

I made a script that will install the Palm software on the PC and also set the conduits so it will sync with Outlook. Works fine. My problem is I want to script it so after the install I can change the types of connections that is turned on. Default from the install is USB, but I need to have the serial connection also turned on. I can easily do this by clicking on the system tray icon and clicking what I want, but depending on the PC, the icon may be in a different place. I tried searching the registry, and other places to see if I can set it, but this is the only way I can find.

My question is this: Has anyone scripted turning something on from a icon in the system tray, and if so, how?

I looked at trayitemgethandle, but I didn't research it that much. Am I on the right path?

Link to comment
Share on other sites

Unfortunately, TrayItemGetHandle only applies to your script's own TrayItems, not those of other apps.

Check if the window you need already exists (hidden), in which case you can bypass the tray icon.

If not, look at _SysTrayIconPos in tuape's SysTray UDF. You can try clicking based on those coordinates.

[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Link to comment
Share on other sites

Thanks! Works perfectly. Did this

$oldMatchMode = Opt("WinTitleMatchMode", 4)
$oldChildMode = Opt("WinSearchChildren", 1)
$class = "classname=Shell_TrayWnd"
$hControl = ControlGetHandle($class, "", "Button2")
$posTray = WinGetPos(_FindTrayToolbarWindow()) 
MouseMove($posTray[0], $posTray[1])
If $hControl <> "" And ControlCommand($class, "", $hControl, "IsVisible","") Then
    ControlClick($class, "", $hControl)
    Sleep(250)
EndIf
$index = _SysTrayIconIndex("Hotsync.exe")
If $index <> -1 Then
    $pos = _SysTrayIconPos($index)
    
    If $pos = -1 Then Exit
    MouseMove($pos[0], $pos[1])
    Sleep(1000)
    MouseClick("left")
EndIf
ConsoleWrite(@CRLF & @CRLF & "Pos[0]: " & $pos[0] & "$pos[1]: " & $pos[1])
Opt("WinTitleMatchMode", $oldMatchMode)
Opt("WinSearchChildren", $oldChildMode)
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...