Valaraukar 4 Junior Poster

I want to create a program that reads some data from a specified .txt source file (this part is absolutely no problem) and then write that data to the currently active/open file (something like copy & paste functionality where the copy function reads data from the source file and paste appends that data to the document that I am currently working on). I'm hoping to be able to use a macro key on my keyboard to run the executable with fixed parameters (i.e. a specific source file).
The part that I really need help with/understanding is how to determine what file is currently in use and how I can then append the data to it

Example:
Lets say I am currently working in Notepad++ and I hit my macro key. I now want the text from source.txt to be copied and pasted at the current position of my cursor (this isn't essential; a simple append would do).

One problem that I can already think of is dealing with different file types. I don't want my program to only have the ability to append data to .txt files for example. I could be working on a .cs, .cpp, .txt, .exe file etc. - perhaps doing a binary read solves this issue?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.