Sign in to follow this  
Followers 0
WillPower

AutoIt Script for LogMeIn Not Working - Close Popup Notification

16 posts in this topic

When remotely accessing my home desktop with LogMeIn, a popup notification appears on the computer being remotely accessed. I wrote an AutoIt script to automatically close this little popup, but it doesn't work! When i call WinList() it returns the title ("LogMeIn") and handle of the popup just fine, but none of the usual AutoIt commands seem to work on it (WinKill, WinClose, etc). Any help would be greatly appreciated.

Here is my original script:

Opt("TrayIconHide", 1)
Opt("WinTitleMatchMode", -2)
$i = 0
Do
   WinWait ("LogMeIn")
   Winkill ("LogMeIn")
Until $i = 1

When the above didn't work, I tried a fancier script:

Opt("TrayIconHide", 1)
Opt("WinTitleMatchMode", -2)

$i = 0
Do
   DoesLMIExist()
Until $i = 1


Func DoesLMIExist()
    $var = WinList()
    For $i = 1 to $var[0][0]
        If $var[$i][0] = "LogMeIn" Then
            ;;;;; The msgbox below appears just fine
                        MsgBox(0, "Details", "Title=" & $var[$i][0] & @LF & "Handle=" & $var[$i][1])

                        ;;;;; None of the below commands are successful in closing the popup 
            WinKill($var[$i][0])
            WinKill($var[$i][1])
            WinKill("LogMeIn")
            WinClose($var[$i][1])
            WinClose("LogMeIn")
        EndIf
    Next
EndFunc

post-63531-0-14838700-1299487377_thumb.g

Share this post


Link to post
Share on other sites



a popup notification appears on the computer being remotely accessed.

Your code looks good. But how have you verified this? It could be that the popup appears on the computer you are using to access the other computer. In that case, it would make no sense to run the script on the remote computer. And vice versa.

Many applications use hidden windows, your script may be detecting a hidden LogMeIn window and closes it. This results in some, for you, unpredictable results while the script is working perfectly fine.

Share this post


Link to post
Share on other sites

Your code looks good. But how have you verified this? It could be that the popup appears on the computer you are using to access the other computer. In that case, it would make no sense to run the script on the remote computer. And vice versa.

Many applications use hidden windows, your script may be detecting a hidden LogMeIn window and closes it. This results in some, for you, unpredictable results while the script is working perfectly fine.

Just to add some clarification, the popup appears on the computer being remotely accessed (in this case, my desktop). As I'm testing my script, i have both computers in front of me, and the script is running on the remotely accessed computer (desktop). the WinList function returns a list of all active, visible windows. When the popup is present, WinList returns a record for it. When it's not present, WinList doesn't have a record for it. So I'm pretty sure that the popup is that window. When I run the same script to close notepad or calculator.. it works fine. It's just this popup that doesn't close as it's supposed to. Very frustrating.

Share this post


Link to post
Share on other sites

Just to add some clarification, the popup appears on the computer being remotely accessed (in this case, my desktop). As I'm testing my script, i have both computers in front of me, and the script is running on the remotely accessed computer (desktop). the WinList function returns a list of all active, visible windows. When the popup is present, WinList returns a record for it. When it's not present, WinList doesn't have a record for it. So I'm pretty sure that the popup is that window. When I run the same script to close notepad or calculator.. it works fine. It's just this popup that doesn't close as it's supposed to. Very frustrating.

something in windows 7 OS is not allowing you to.

your script works great in XP OS but win7 is no go.

Share this post


Link to post
Share on other sites

something in windows 7 OS is not allowing you to.

your script works great in XP OS but win7 is no go.

Ahhhh!! So what is it in Win7 that causes it to not work?

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

dude i honestly cant say what gives.

Obviously autoit is not able to close the logmein window.

there needs to be a workaround for the winclose, that would be my guess.

Edited by Cars0n66

Share this post


Link to post
Share on other sites

logmein window probably simply disobeys kill command. You can try hiding the window via: WinSetState and @SW_HIDE.

Unfortunately, that doesn't work either.

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

on that Portuguese website it doesn't work with the updated logmein.

what they have you do is delete certain files from the logmein dll.

it seems that you would need a 2009 version of logmein for it to work. that was when the article was posted.

where are you going to find one of those.

a bigger question is will the 2009 version even run if found and install as if it was the newly updated versions do.

Edited by Cars0n66

Share this post


Link to post
Share on other sites

The logmein popup has a little 'x' in the corner of it. Can you simulate a mouse click to close it?

Share this post


Link to post
Share on other sites

Try this

;simple script

While 1  ;==>start loop
    
    Sleep(1000) ;==> check every 1 sec
    
        $i = 0
        Do
            Sleep(1000)
            $click = _clickButton("LogMeIn",XXX ,XXX )
            if $click = 1 Then
                $i = 1
            Else
                $i = 0
            EndIf
        Until $i = 1 ;==> exit loop only if is cliked to btn exit and etc
    
    
WEnd ;==> endloop   


    ;func to click button
    ;return 0 if error and 1 if success
    ;$title = window title , $cordx is a diffrence between position on window x and xcord for mouse click
    ;$cordy is a diffrence between position on window y and ycord for mouse click 
    Func _clickButton($title, $cordx, $cordy)

        $pos = WinGetPos($title, "")

        $xpos = $pos[0]
        $ypos = $pos[1]

        $difx = $cordx
        $dify = $cordy

        $xclick = $xpos + $difx
        $yclick = $ypos + $dify

        WinActivate($title, "")
        Sleep(2000)
        MouseClick("left", $xclick , $yclick ,1, 0 )
        Sleep(2000)

        if WinExists ($title, "") Then
            Return 0
        Else
            Return 1
        EndIf

    EndFunc

With little modification you can expand program.

Share this post


Link to post
Share on other sites

Try this

I'm using win 7 x32 and jorolino when i use your script it has a error it says Line 10 $click = _clickbutton("LogMeIn","xxx,xxx) Error: Error parsing function call. one thing i did notice was that the logmein box which pops up when a remote user is loges in. I used the AutoIt window-info it looks like the X to close the window is button 1. but one delema is i cant figure out how to script it to control click with out being able to use the macro recorder.

Share this post


Link to post
Share on other sites

I'm using win 7 x32 and jorolino when i use your script it has a error it says Line 10 $click = _clickbutton("LogMeIn","xxx,xxx) Error: Error parsing function call. one thing i did notice was that the logmein box which pops up when a remote user is loges in. I used the AutoIt window-info it looks like the X to close the window is button 1. but one delema is i cant figure out how to script it to control click with out being able to use the macro recorder.

ControlClick?

Share this post


Link to post
Share on other sites

I'm using win 7 x32 and jorolino when i use your script it has a error it says Line 10 $click = _clickbutton("LogMeIn","xxx,xxx) Error: Error parsing function call. one thing i did notice was that the logmein box which pops up when a remote user is loges in. I used the AutoIt window-info it looks like the X to close the window is button 1. but one delema is i cant figure out how to script it to control click with out being able to use the macro recorder.

Ofc you need to change xxx,xxx with xcord and ycord.

First start the Autoit window info , get the info for window "LogMeIn" position mouse in X(close window)

is something like this

>>>> Window <<<<

Title: LogMeIn

Class:

Position: 310, 289

Size: 404, 152

Style: 0x94C801C5

ExStyle: 0x00010101

Handle: 0x000400BC

>>>> Control <<<<

Class:

Instance:

ClassnameNN:

Name:

Advanced (Class):

ID:

Text:

Position:

Size:

ControlClick Coords:

Style:

ExStyle:

Handle:

>>>> Mouse <<<<

Position: 570, 303

Cursor ID: 0

Color: 0xA4A4A4

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<

>>>> Hidden Text <<<<

Now need this 2 things

1. Position: 310, 289

>>>> Mouse <<<<

2. Position: 570, 303

so Mouse position x 570 - window position 310 = 260

and Mouse position y 303 - window position y 289 = 14

input in the xxx

$click = _clickbutton("LogMeIn",xxx,xxx)

$click = _clickbutton("LogMeIn",260,14)

and program works

Share this post


Link to post
Share on other sites

I just saw this post on LMI. This may be off the subject but here's my post from a couple of days ago if you can help. If someone has the script, I have a friend who may be able to help me.

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