I need to find the source file and location of anythinig pasted into my program.
I don't know how (or of you can) access this info at all from a clipboard
Printable View
I need to find the source file and location of anythinig pasted into my program.
I don't know how (or of you can) access this info at all from a clipboard
What do you mean by "the source file of anything pasted into my program"?
if a user opens up a file in notepad, has text he wants to use, selects it and copies it, it gets pasted into
my program, some container. i can detect the paste
but need to figure out where it came from
Where it came from? It came from the clipboard. AFAIK, it doesn't "track" it or anything. Why do you even need to do this?
you mean you need to find out which program placed the data onto the clipboard...Quote:
Originally posted by brendanm
if a user opens up a file in notepad, has text he wants to use, selects it and copies it, it gets pasted into
my program, some container. i can detect the paste
but need to figure out where it came from
at a rough guess, the easiest way is to get the currently focused program using the windows API call GetForegroundWindow which gives you a hwnd handle, and then GetWindowText which takes a hwnd and gives you a string