[Coding] Debug clipboard access with care

Started by fixer, July 04, 2017, 07:10:05 PM

Previous topic - Next topic

fixer

If you tried to debug (especially trace) clipboard access then you probably know it may not work as expected. Paste doesn't paste even when everything looks fine. And it works without debugger. So what's the problem? The problem is Windows kernel checks access rights to the clipboard, and CheckProcessForClipboardAccess function has some interesting check: the window doing it must be foreground. And when you debug... that's right, your debugger is foreground and not the debuggee.