Jump to content

help with anoying problem (tray and other things not work together)

Recommended Posts

hello, i have a problem with my code. I just went to create a program which will throo screenreaders or Sapi com say if and when clipboard changes and to say clipboard contents. But it won't work together, if i configure it to tray work, then another part won't work, it just checks if $cbc variable is $clipb which is $clipb = clipget(). Here is a code

(in this way, i think that just part with clipboard works not with tray)

#include <GUIConstantsEx.au3>

#include <WindowsConstants.au3>

#include <EditConstants.au3>

#include <StaticConstants.au3>

#include <misc.au3>

$cbc = ""

$clipb = ""

$v = ObjCreate("Say.Tools")

TraySetToolTip("clipboard agent")


$arace = TrayCreateItem("Arace clipboard", -1, -1, 1)

$about = TrayCreateItem("about", -1, -1, 1)

$website = TrayCreateItem("website", -1, -1, 1)

$checkforupdate = TrayCreateItem("check for the updates", -1, -1, 1)

$exitca = TrayCreateItem("exit", -1, -1, 1)

$msg = TrayGetMsg()

$v.say("Welcome to the clipboard agent!")

while 1

$cbc = $clipb

$clipb = clipGet()

if $msg = 0 then



if $msg = $arace then


$v.say("Clipboard araced!")


if $msg = $about then

msgbox (64, "About clipboard agent","Clipboard agent ©© NS studios, all rights reserved! The clipboard agent is a program which monitors a clipboard content. It uses to speak primerly screenreaders if any of supported is active, if not, it speaks throo Sapi. Supported screenreaders are: NVDA, JAWS for windows, window-eyes, System access, and Sapi.")


if $msg = $website then

shellexecute (@WindowsDir&"\explorer.exe", "http://www.nsstudios.tk/")


if $msg = $checkforupdate then

;shellexecute (@ScriptDir&"\updater.exe")


if $msg = $exitca then

$v.say("Exiting clipboard agent!")



if not $cbc = $clipb then

$cbc = $clipb

$v.say("clipboard agent: Clipboard changed to "&$cbc&"!")




if you want, you can download a full program here


Link to comment
Share on other sites

hello, i tryed everything, but when tray part works, another one will stop working. You must download full program from the link posted in my earlyer post, because there is library which i used. You must register com server lib.dll in lib folder dooing for example "regsvr32.exe c:\clipboard agent\lib\lib.dll" and now you can use it.

You can add me to the skype: nikola.stojsic

aim: nikolastojsic

twitter: nsstudios1

Link to comment
Share on other sites


well in the zip file are au3 source, and folder lib.

You need to register lib.dll from folder lib in order to program works. You can do it for example:

regsvr32.exe c:\program files\clipboard agent\lib\lib.dll

and then you can try.

I don't know what's a problem here, because i must give you it via link.

I n the link is source

Link to comment
Share on other sites

  • Moderators


one problem is that $msg = traygetmsg() poses script execution, which is an autoit 3 bug i think so. Same problem is with gui get msg

Think again! ;)

Those functions do not "pause the script". They do have a built-in sleep period (up to a maximum of about 10-12 ms) but that is to reduce the CPU load when the system is idle and is barely noticable by humans. :graduated:


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:


ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area


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

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...