Sign in to follow this  
Followers 0
JonathanChan

Gracefully Closing TrayIcon Program

2 posts in this topic

#1 ·  Posted (edited)

Hello everyone,

I'm trying to close a tray icon program, but sending it a ProcessClose() kills it and the application does not write out the config file that it is supposed to on quit. I've tried sending it a WM_CLOSE with another app, but it can't send it to anything since it doesn't have any windows opened... Does anyone have any idea on how to gracefully close this app? (if anyone wants to know, it's the 1by1.exe mp3 player in tray icon mode)...

Thanks,

Jonathan

Edited by JonathanChan

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

...it doesn't have any windows opened...

run this
$var = WinList()

For $i = 1 To $var[0][0]
    If $var[$i][0] <> "" And Not IsVisible($var[$i][1]) Then
        MsgBox(0, "Details", "Title=" & $var[$i][0] & @LF & "Handle=" & $var[$i][1])
    EndIf
Next

Func IsVisible($handle)
    If BitAND(WinGetState($handle), 2) Then
        Return 1
    Else
        Return 0
    EndIf
EndFunc   ;==>IsVisible
...and it will show you the title/handle of windows that you cannot see. The app probably does have a window.

maybe:

AutoItSetOption("WinTitleMatchMode", 4)

WinClose(........)

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

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