Jump to content

[Solved] Refresh taskbar - icon


 Share

Recommended Posts

Is there any way i could make a script to refresh it so i wouldn't see this ??

You need to rethink the premise of your question.

Treat the cause, not the symptom.

If the dimming.exe script exited properly you wouldn't have to refresh the tray icons.

for each application, if its full-screen it runs a screen dimming .exe "which dims the left and right screen by 70% and also puts the icon into the taskbar" once the application is un-fullscreen auto ends the exe to un-dim the screens. So depending how many times i full screen depends on how many times the icon comes

"auto ends the exe" I assume, means ProcessClose of the dimming exe by the main exe?

Why not have the function that checks when the app is no longer fullscreen in the dimming exe, so it closes itself?

Alternatively, if you want to close an AutoIt script process, then use WinClose or WinKill, not ProcessClose.

If your dimming script does not have a gui, then close the hidden gui used for the tray icon/tips.

multi process check

_CloseProc("dimming.exe")
Func _CloseProc($sProcName)
Local $aPID = ProcessList($sProcName), $aWin, $iTmp, $iCnt = 0 ;get PID of all instances of dimming.exe
If @error Or $aPID[0][0] = 0 Then Return SetError(1, 0, 0)
$aWin = WinList("[CLASS:AutoIt v3]") ;get hidden window handles of all running autoit scripts
If @error Or $aWin[0][0] = 0 Then Return SetError(2, 0, 0)
For $i = 1 To $aWin[0][0]
  $iTmp = WinGetProcess($aWin[$i][1]) ;get owner process for AutoIt v3 class hidden gui
  If $iTmp <> -1 Or $iTmp <> @AutoItPID Then
   For $j = 1 To $aPID[0][0]
    If $iTmp = $aPID[$j][1] Then;found target scripts hidden gui handle
     WinClose($aWin[$i][1])
     If WinWaitClose($aWin[$i][1], "", 2) = 0 Then
      WinKill($aWin[$i][1])
      If WinWaitClose($aWin[$i][1], "", 2) = 0 Then ProcessClose($iTmp)
     EndIf
     $iCnt += 1
     ExitLoop
    EndIf
   Next
  EndIf
Next
If $iCnt = 0 Then Return SetError(3, 0, 0)
Return SetError(0, 0, $iCnt)
EndFunc
Edited by rover

I see fascists...

Link to comment
Share on other sites

Treat the cause, not the symptom.

Hell of a good quote there :graduated:

but looking at your code and links i am completely confused. WInclose and WInkill dont work for this application, and as u said it has no gui. Just a Icon in the system tray and a menu if u right click it.

PangoBright.exe

http://download.cnet.com/PangoBright/3000-2072_4-75327791.html

So i am a little confused how that code would close it, as all my code does is check if the "condictions" r meet and then runs the exe. Once run my code has no effect on what the exe can do apart from close it again

Link to comment
Share on other sites

Hell of a good quote there :graduated:

but looking at your code and links i am completely confused. WInclose and WInkill dont work for this application, and as u said it has no gui. Just a Icon in the system tray and a menu if u right click it.

PangoBright.exe

http://download.cnet.com/PangoBright/3000-2072_4-75327791.html

So i am a little confused how that code would close it, as all my code does is check if the "condictions" r meet and then runs the exe. Once run my code has no effect on what the exe can do apart from close it again

Well, that clears things up.

I assumed the exe was an AutoIt script.

PangoBright.exe enforces a single instance, (nice app, I know of the company from my days working with a laserist)

so run this line to close it.

WinClose("[TITLE:Pangolin Screen Brightness; CLASS:FadeScrClass]")

I see fascists...

Link to comment
Share on other sites

i tryed the code on Windows XP and it works pefectly when i get back home i will also try it on my home pc "Windows 7" but i have a feeling it will be posstive results :graduated: thanks for the fast reply and i will now try to use winclose over processmurdering!! ;)

**Yeap works on W7 well and with that my problem is sloved :) thanks

Edited by IanN1990
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...