Results 1 to 7 of 7

Thread: Autoit Script Build - Help needed!

  1. #1
    Constant Bitrate
    Join Date
    Jul 2008
    Posts
    152

    Autoit Script Build - Help needed!

    Ok so i have been reading thru the Autoit tutorials in an attempt to write 2 sets of scripts. The first set of for mymobiler - need a .exe that will connect and one for disconnecting to my phone. The other is for pdanet to do the same. Both programs reside in the taskbar and can connect by double clicking on the icons. I'm trying to write these scripts to map buttons in Centrafuse that are more touch friendly. Can anyone provide me with some pointers?

  2. #2
    Constant Bitrate
    Join Date
    Jul 2008
    Posts
    152
    No one?

  3. #3
    Constant Bitrate
    Join Date
    Jul 2008
    Posts
    152

    Yeah!

    Ok found a solution in case any one has similar needs. This script will double click on the PdaNet tray icon which initiates it to connect.

    Code:
    #Include <GuiToolBar.au3>
    
    Global $hSysTray_Handle, $iSystray_ButtonNumber
    
    Global $sToolTipTitle = "PdaNet" ; <<<<<<<<<<<<<<<< Enter some tooltip text for the icon you want here
    
    $iSystray_ButtonNumber = Get_Systray_Index($sToolTipTitle)
    
    If $iSystray_ButtonNumber = 0 Then
        MsgBox(16, "Error", "Icon not found in system tray")
        Exit
    Else
        Sleep(500)
        _GUICtrlToolbar_ClickButton($hSysTray_Handle, $iSystray_ButtonNumber, "left")
    	_GUICtrlToolbar_ClickButton($hSysTray_Handle, $iSystray_ButtonNumber, "left")
    EndIf
    
    Exit
    
    ;............
    
    Func Get_Systray_Index($sToolTipTitle)
    
        ; Find systray handle
        $hSysTray_Handle = ControlGetHandle('[Class:Shell_TrayWnd]', '', '[Class:ToolbarWindow32;Instance:1]')
        If @error Then
            MsgBox(16, "Error", "System tray not found")
            Exit
        EndIf
    
        ; Get systray item count
        Local $iSystray_ButCount = _GUICtrlToolbar_ButtonCount($hSysTray_Handle)
        If $iSystray_ButCount = 0 Then
            MsgBox(16, "Error", "No items found in system tray")
            Exit
        EndIf
    
        ; Look for wanted tooltip
        For $iSystray_ButtonNumber = 0 To $iSystray_ButCount - 1
            If StringInStr(_GUICtrlToolbar_GetButtonText($hSysTray_Handle, $iSystray_ButtonNumber), $sToolTipTitle) = 1 Then ExitLoop
        Next
    
        If $iSystray_ButtonNumber = $iSystray_ButCount Then
            Return 0 ; Not found
        Else
            Return $iSystray_ButtonNumber ; Found
        EndIf
    
    EndFunc
    I got most of the code from the Autoit forums and made 2 small changes. It can also be used for other programs. For example I'm using it for My Mobiler also. Now I can just map these to a centrafuse button.

  4. #4
    Constant Bitrate
    Join Date
    Jul 2008
    Posts
    152
    Ok i spoke too early. The script above only works if you can actual see the system tray icons so for it to work i have to minimize centrafuse. I may just leave it like that... at least now I have a much larger icon. To fully achieve was I was trying to do I'd just need to add lines in the script to minimize centrafuse --> run the current script --> maximize centrafuse.

  5. #5
    Maximum Bitrate pcpete's Avatar
    Join Date
    Mar 2008
    Location
    Toronto Canada
    Posts
    474
    Good stuff man! I think I'll give it a try, sometimes I have to minimize RR, and select connect on the pdanet systray icon, this would definately make that easier....

    I wish these utilities came with hotkey support or and sdk , would make our lives alot easier....

  6. #6
    FLAC Dougw133's Avatar
    Join Date
    Nov 2007
    Location
    PA
    Posts
    1,245
    So is this working fully? I had been using a button script I wrote for sendkey which activated a hotkey for a DUN Dialer program. Now that I have a Droid I am using PDANET and I am not sure if you can dial PDANET without using the default tray icon. If you could use PDANET's connection managed like a standard windows DUN then you could use my script and just push a button in the skin to connect and disconnect.

  7. #7
    FLAC WuNgUn's Avatar
    Join Date
    Sep 2007
    Posts
    1,351
    Back from the dead!!
    Anyone know how to create a button in Centrafuse for firing this command to PDANET?

Similar Threads

  1. Replies: 51
    Last Post: 11-03-2010, 11:08 PM
  2. SARRAH Team Dropping By (consumer build advice needed)
    By SARRAHTEAM in forum Newbie - Proposed setup
    Replies: 10
    Last Post: 06-23-2009, 07:02 PM
  3. First CarPC Build
    By Badams in forum Newbie
    Replies: 2
    Last Post: 06-08-2009, 10:22 AM
  4. Microtech Dash AutoIT Script
    By mukow in forum RR Plugins
    Replies: 4
    Last Post: 01-13-2009, 05:44 PM
  5. *** NEW MJS BUILD OF RR *** (Resume Test 3)
    By mitchjs in forum Road Runner
    Replies: 8
    Last Post: 09-23-2008, 08:10 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •