I m developping a little soft to notify users when they are pasting content in unauthorized applications, i hook the GetClipboardData to do so. Nearly everything is working fine but when i copy content from Word for example, i click on InternetExplorer, i open an explorer window and close it, some GetClipboardData are launched from explorer. Can someone help 开发者_运维技巧me to understand that behavior ? Thanks in advance Regards
It is common to receive unexpected clipboard events from certain applications, mostly from Microsoft, when you do things like closing windows or doing anything that makes the application stop and think: "hey, maybe I left some crap on the clipboard, I'd better clean it up, maybe re-post it as plain text without the OLE stuff, maybe I already did that, but I can't remember, so I'll do it again." It's a sort of OCD that they build into just about everthing. Sometimes you get a pop-up saying "you've placed a large amount of data on the clipboard, would you like to make it available for other applications" when you quit a program. That's the same thing. Basically, they've put a bunch of formats on the clipboard that would require "delayed rendering" to be pasteable. And now the app is worried about leaving invalid data on the clipboard, so it has to re-post the data without the fancy formats. You'll also get this if you copy a cell from Excel, and then un-highlight that cell. If you get a clipboard event when STARTING an app, it's likely an add-in hooking into the clipboard chain, or perhaps committing the worst sin of all: copy/pasting its icon into a toolbar.
精彩评论