Jump to content

---help--- System Tray (task Bar) Script


Recommended Posts

Hi, I need to shutdown a firewall (Cyberarmor) run severaltasks and finally reopen the firewall.

The only way I find to acces the firewall is from the system tray (where the window clock is).

My problem is that its icon changes it position so I dont know how to shutdown the firewall.

If I use the Infowindow it treats all the icons as a same window but there aren't any identifiers to destiguish them

Title:

Class: Shell_TrayWnd

Size: X: 0 Y: 734 W: 1024 H: 34

help wanted! :)

Link to comment
Share on other sites

Hi,

search for Sys udf or systray udf.

Hope that helps.

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

do you mean search the web, or search AutoIT documentation?

HI,

I meant this forum. Have a look at : http://www.autoitscript.com/forum/index.ph...&hl=systray+udf

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

Thanks Mega, I'm having a look to it right now.

Im quite a begginner.... whats a UDF?

HI,

no prob. Udf = user defined function

Have a look at the help file. There you'll find a lot of udf or in Scripts& ... Forum

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

Mega,

Have you tested the Systray_udf but it seems to have errors during execution. Did it work correctly when you tested it?

I attach an example:

Line 233 (File "D:\Profiles\GUILLEFA\Desktop\Systray_UDF.au3"):

Dim $TBBUTTON = DllStructCreate($str)

Dim $TBBUTTON = ^ ERROR

Error: Unknown function name.

Link to comment
Share on other sites

HI,

are you using beta? If not, check it out!

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

OK that was part of it.... but here I have one more inconvinient when running

Line 414 (File "D:\Profiles\GUILLEFA\Desktop\SysTray_UDF.au3"):

DllStructDelete($TBBUTTON)

^ ERROR

Error: Unknown function name.

the code line 414 is

DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $procHandle[0])

DllStructDelete($TBBUTTON)

DllStructDelete($TBBUTTON2)

DllStructDelete($ExtraData)

I have no file named kernel32.dll (im using windows XP) may this be the reason?

my test code is as follows:

#include "SysTray_UDF.au3"

; -- Example 1 --

; Get window titles of all windows that have icon on systray

$iTitles = _SysTrayIconTitles()

; Get process names of all processes that have icon on systray

$iProcesses = _SysTrayIconProcesses()

For $i=0 to Ubound($iTitles)-1

; write the info to consolewindow

ConsoleWrite(@CR & "#" &$i & "Title: " & $iTitles[$i] & ", process: " & $iProcesses[$i])

Next

Link to comment
Share on other sites

HI,

try using this modified one:

http://www.autoitscript.com/forum/index.ph...pe=post&id=5938

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

This sounds a little freakin suspicious to me at this point :)

So I just look at this and this is what I see:

1. You stop my firewall

2. You run your "tasks"

3. All the while you stop me from using the mouse.

Like I said doesn't sound good to me.

Edited by Neoborn

~Projects~1. iPod Ejector 1.0 - Tool Used To Eject iPod in Windows - Uses DevEject.exe :P2. SmartFTP Close Popup Tool - Closes reminders from freeware SmartFTP.~Helpful Links For New Users~1. LXP's Learning AutoIT PDF Guide - <<< Go here for a PDF Guide on learning AutoIT from the ground up!<<<2. AutoIt 1-2-3 <<<Want to learn more about AutoIT quickly? Go Here<<<3. How To Install The Beta And Production Versions Of AutoIT / SciteAutoIT

Link to comment
Share on other sites

mouse solved :)

the reason for blocking the user is that if they expanded the taskbar during the script manually, the script entered an infinite loop....

nothing stange

#include "SysTray_UDF.au3"

;desactivate Mouse & keyboard

If @OSVersion <> "WIN_98" And @OSVersion <> "WIN_ME" Then

BlockInput(1)

EndIf

; Get window titles of all windows that have icon on systray

$iTitles = _SysTrayIconTitles()

; Get process names of all processes that have icon on systray

$iProcesses = _SysTrayIconProcesses()

;Checks if CyberArmor is running and if it does ity opens/closes the profile

For $i=0 to Ubound($iTitles)-1

if $iProcesses[$i] = "pcs.exe" then

; Press hide inactive icon's button

$oldMatchMode = Opt("WinTitleMatchMode", 4)

$oldChildMode = Opt("WinSearchChildren", 1)

$class = "classname=Shell_TrayWnd"

$hControl = ControlGetHandle($class, "", "Button2")

; get tray position and move there. Helps if Auto Hide tray option is used.

$posTray = WinGetPos(_FindTrayToolbarWindow())

MouseMove($posTray[0], $posTray[1])

; If XP and the Hide Inactive Icons mode is active

If $hControl <> "" And ControlCommand($class, "", $hControl, "IsVisible","") Then

ControlClick($class, "", $hControl)

Sleep(250); Small delay to allow the icons to be drawn

EndIf

; Open/Close Cyberarmor profile

$index = _SysTrayIconIndex("pcs.exe")

If $index <> -1 Then

$pos = _SysTrayIconPos($index)

If $pos = -1 Then Exit

MouseMove($pos[0], $pos[1])

Sleep(1000)

MouseClick("right")

Send("{DOWN}")

Send("{DOWN}")

Send(@crlf)

Send(@crlf)

EndIf

;reactivate Mouse & Keyboard

If @OSVersion <> "WIN_98" And @OSVersion <> "WIN_ME" Then

BlockInput(0)

EndIf

EndIf

Next

Edited by Guillote
Link to comment
Share on other sites

HI,

so you solved your problems on your own. Great! :)

You can also use _MouseTrap() to avoid moving the mouse.

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

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...