nsstudios Posted October 16, 2011 Posted October 16, 2011 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") Opt("TrayMenuMode",1) $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 ContinueLoop endif if $msg = $arace then clipput("") $v.say("Clipboard araced!") endif 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.") endif if $msg = $website then shellexecute (@WindowsDir&"\explorer.exe", "http://www.nsstudios.tk/") endif if $msg = $checkforupdate then ;shellexecute (@ScriptDir&"\updater.exe") endif if $msg = $exitca then $v.say("Exiting clipboard agent!") exit endif if not $cbc = $clipb then $cbc = $clipb $v.say("clipboard agent: Clipboard changed to "&$cbc&"!") endif continueloop wend if you want, you can download a full program here http://dl.dropbox.com/u/21506578/clipboard_agent.zip
jaberwacky Posted October 16, 2011 Posted October 16, 2011 ObjCreate fails: Global $v = ObjCreate("SayIt") Also, put this in your while loop: $msg = TrayGetMsg() Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum?
nsstudios Posted October 17, 2011 Author Posted October 17, 2011 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
AutoBert Posted October 17, 2011 Posted October 17, 2011 hello, i tryed everything, but when tray part works, another one will stop working. You must download full programNo we must'nt. You are the one who needs help, so put your source to the post.
nsstudios Posted October 17, 2011 Author Posted October 17, 2011 ok. 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
nsstudios Posted October 18, 2011 Author Posted October 18, 2011 the just 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
Moderators Melba23 Posted October 18, 2011 Moderators Posted October 18, 2011 nsstudios,one problem is that $msg = traygetmsg() poses script execution, which is an autoit 3 bug i think so. Same problem is with gui get msgThink 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. M23 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: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now