views:

113

answers:

2

I want to detect when the user pasted something into the textbox. I want to detect it whether the user used the mouse or keyboard.

This is vb6

+1  A: 

I think the only way to do this is to subclass the textbox and detect the WM_PASTE event.

pm_2
+3  A: 

Karl E. Peterson's HookXP is a pretty cool code sample that shows you how to capture a paste event, along with a bunch of other interesting stuff. I modified and stripped it down a bit, and was able to do what you asked, so I can vouch that it works. I'd post it here, but I'd be violating his license.

raven
+1 For HookXP, +1 again for not pasting the code here! Karl **hates** that.
MarkJ