Welcome Guest.   Make a donation to an author on the site April 23, 2014, 02:02:37 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Learn about the DonationCoder.com microdonation system (DonationCredits).
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: IDEA: Clipboard Chain broken notifier  (Read 6273 times)
springro
Charter Member
***
Posts: 39


see users location on a map View Profile Give some DonationCredits to this forum member
« on: May 24, 2007, 01:48:17 PM »


Idea is for an application that monitors the clipboard chain and lets you know when it breaks for troubleshooting what is causing it.

I'm having problems where the clipboard chain gets disconnected, but I don't what's the cause of it.
This happens every so often and even "repair clipboard chain" doesn't seem to do the trick (in this case it clipcache2.9).

Sounds like Clip Mate has something that is a similar function, but I really don't want to try having 2 clipboard managers running at the same time.
see:  http://www.clipmate.com/c...rt.htm#TroubleChainBroken

Is this something that can be done in AutoHotkey to test for the chain?

Thanks,
Rob
Logged
jgpaiva
Global Moderator
*****
Posts: 4,710



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: May 24, 2007, 02:31:12 PM »

Well.. I'd recomend using mouser's Clipboard Help and Spell. I use it myself and i don't even know what it means to have the clipboard chain disconnected tongue
Logged

lanux128
Global Moderator
*****
Posts: 6,047



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #2 on: May 24, 2007, 09:43:01 PM »

we have had several discussions here on the clipboard chain.. btw, if you're doing programming work, this is a good place to start.. All you ever wanted to know about the Clipboard... smiley

Logged

springro
Charter Member
***
Posts: 39


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #3 on: May 25, 2007, 05:58:48 AM »


I searched for clipboard chain, but didn't get anything...
Ah -- It looks like the standard Donation Coder search won't dig anything up, you need to go with the google search of donationcoder.com to get results.

Sorry Lanux - not that level of programmer to use the information you linked to, more script tinkerer.

Maybe just a question - if the clipboard chain gets broken, does it break all links or just ones "after it" (if this is how it works).

Does a new application launching that uses the clipboard chain automatically go to the end of the list?  Just wondering if when an application is started can affect how often it would be affected by other applications.  This might be useful to add a simple application that checks for something getting added to the clipboard every time CTRL+C is pressed.  At least I think this should be easy in Autohotkey, just add a pass through script for CTRL+C and monitor for a clipboard change.  If it receives a CTRL+C, but no change report, there may have been an issue.

Crazy?

Thanks,
Rob
Logged
wr975
Charter Member
***
Posts: 369



View Profile Give some DonationCredits to this forum member
« Reply #4 on: May 25, 2007, 06:19:40 AM »

Perhaps this is useful for you:

ArsClip offers a "clipboard chain break notification". There's also an option to enable an extended checking.

http://www.joejoesoft.com/

Quote
Automatic clipboard chain break detection

UPDATE: Vista users can and should disable chain break detection, since breaks are no longer present on the Vista operating system.

Unfortunately, any program can mess up the "clipboard chain", because it is left up to the program to correctly handle clipboard messages. ArsClip has a workaround for this. It checks the contents of the clipboard every 1 minute to make sure that it was automatically notified of the current items arrival. If it wasn't, it will display an error message, and then transparently fix any future problems this session without bugging you. This can help you track down programs that break any clipboard monitors. For example, if you run a program and copy an item to the clipboard and up to a minute later you get this ArsClip error message, you can be pretty sure that program can break the windows clipboard chain. Please let me know of any programs you use that break the chain.

ArsClip nows monitors for programs that may have crashed or left the clipboard chain without properly notifying windows. This helps detect chain breaks much earlier and increases the accuracy of detecting problem programs.

There is an option (under Config -> Clipboard) to disable the Notification window all together, but it is only recommended for advanced users.

« Last Edit: May 25, 2007, 06:24:20 AM by wr975 » Logged
tranglos
Supporting Member
**
Posts: 1,079



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #5 on: May 25, 2007, 08:14:52 AM »

Maybe just a question - if the clipboard chain gets broken, does it break all links or just ones "after it" (if this is how it works).

As I understand the relevant MS documentation, the application gets added to the front of the list, so it would break all previous links in the chain. Applications that register themselves for clipboard monitoring later should not be affected.

Does a new application launching that uses the clipboard chain automatically go to the end of the list?

To the beginning of the list, actually, and it is responsible for doing two things:
1. It must forward clipboard messages to the next application in chain
2. It muat cleanly remove itself and restore the chain when it stops monitoring the clipboard.

Failing to to either will break the chain.

Just wondering if when an application is started can affect how often it would be affected by other applications.  This might be useful to add a simple application that checks for something getting added to the clipboard every time CTRL+C is pressed.  At least I think this should be easy in Autohotkey, just add a pass through script for CTRL+C and monitor for a clipboard change.  If it receives a CTRL+C, but no change report, there may have been an issue.

Just a reminder that Ctrl+C  is only one of many ways of copying stuff to clipboard.
Logged

tranglos
Supporting Member
**
Posts: 1,079



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #6 on: May 25, 2007, 08:30:40 AM »

This is probably tangential to your question, but I wanted to raise an issue that's rarely considered when discussing clipboard managers (and the reason I never use one Wink) Running a clipboard manager is a huge security problem if you also use a password manager or have a habit of copying/pasting passwords. The reason why is obvious; finding a solution is less so.

As far as I know, ClipMate is the only clipboard manager that behaves responsibly, but it requires cooperation from the password manager. ClipMate's author came up with a truly genius solution for password managers to tell any other program that it must not capture a particular clip. The way to do this is to register a special clipboard format, for which ClipMate checks. If clipboard contains data in this format, it will not capture the clip. It's awfully simple and can be easily implemented in any Windows program:

http://www.thornsoft.com/developer_ignore.htm

I use this technique in my Oubliette password manager, but it does depend on the clipboard manager checking for this condition and honoring it. Since most programs probably don't do that, I implemented a different (optional) technique as well. You guessed it: I intentionally break the clipboard chain. Just before Oubliette copies a password to clipboard, it registers itself in the chain, and then does not forward the clipboard notification to the next app in chain. Immediately after that the chain is restored.

This prevents *any* clipboard extender from capturing the clip, but is admittedly a heavy-handed approach, optional for those who worry about this sort of thing. It seems to be an interesting case when a momentary breaking of the clipboard chain is intended and quite beneficial.
« Last Edit: May 25, 2007, 08:33:49 AM by tranglos » Logged

justice
Supporting Member
**
Posts: 1,885



Solve issues simply.

View Profile WWW Give some DonationCredits to this forum member
« Reply #7 on: May 25, 2007, 08:32:45 AM »

Most clipboard managers allow you to specify exclusions to programs such like your password manager?
Logged

tranglos
Supporting Member
**
Posts: 1,079



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #8 on: May 25, 2007, 08:36:55 AM »

Most clipboard managers allow you to specify exclusions to programs such like your password manager?

I don't know if they do, and I don't know how it could be implemented. When an application is notified about change in clipboard data, there is no way to know "who" put the new data on clipboard. The clipboard manager cannot tell if you copied from Word or from a password manager. At least I don't know any Windows APIs that provide that information.

(This is also a generic problem with Windows APIs: the messages applications send to each other do not sxpecify the sender. If an app gets a "COPY" message, for example, it cannot know if the user clicked Edit->Copy or a trojan horse program is trying to copy some sensitive data.)
Logged

thornsoft
Participant
*
Posts: 2

View Profile Give some DonationCredits to this forum member
« Reply #9 on: May 25, 2007, 08:37:53 AM »


That's some seriously defective clipboard handling, and is the sort of thing that can and does cause clipboard chain problems in the first place.  The code on that article does not pass clipboard messages, nor does it handle the WM_CHANGECBCHAIN message.

My article pre-dates this one by a year, and properly explains how to handle the clipboard messaging, as does the SDK.
http://www.thornsoft.com/...loper_clipboardviewer.htm
Also see (clipboard mistakes in general):
http://www.thornsoft.com/...eloper_commonmistakes.htm

To the OP: while a noble idea, your stand-alone app would only notify you if your app were disconnected from the chain, and can't detect breaks further down the line.
Suppose the chain looks like this:

Outlook
Foobar App
Clipboard Toy

And you launch your monitor, and you have:

Monitoring App
Outlook
Foobar App
Clipboard Toy

Now Foobar quits, and doesn't remove itself properly.
Now the chain looks like this:

Monitoring App
Outlook

But you can only see the top of the chain. How are you going to know that the Clipboard Toy is disconnected? You can't.
Logged
thornsoft
Participant
*
Posts: 2

View Profile Give some DonationCredits to this forum member
« Reply #10 on: May 25, 2007, 08:41:29 AM »

Just before Oubliette copies a password to clipboard, it registers itself in the chain, and then does not forward the clipboard notification to the next app in chain. Immediately after that the chain is restored.

This prevents *any* clipboard extender from capturing the clip
Cool!  But it's limited to PROPER clipboard managers. I've seen lots of crappy ones over the year, usually weekend VB projects, that use a polling timer instead of clipboard event notification.  These poorly-written ones could steal the password.
Also, this technique won't work on Vista.
Logged
springro
Charter Member
***
Posts: 39


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #11 on: May 27, 2007, 07:01:04 AM »

Thanks for the feedback.  From this chain, I'm thinking one thing to do that might help out is to ensure that my clipboard manager starts later than most software at startup.  Conversely, a monitoring application should be the very first thing to start to ensure it's at the end.

It also indicates that exiting and restarting a program should restore it's clipboard chain in all cases, except when there is something really strange is going on with the system.  In that case it's probably time for a reboot.

Regarding the password manager/clipboard items: can't the issue of pasting be circumvented by using a text send command instead of a paste? 
I'm referring to something similar to Autohotkey's send or sendinput commands.  I have found them to be a little slower than pasting, but in the case of a password this shouldn't be an issue.
It would at least be a good method option to include in password software that could be set as a default, with a fall back option to pasting with a warning or similar.

Best,
Rob

Logged
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.042s | Server load: 0.23 ]