Can anyone tell me how to auto load data content from a file (primarily containing rtf)
when the file is opened. I want to create a system like Microsoft word where you create
docx/doc files and double clicking them opens word software and loads the files.

I know file associations so just help me with the auto load context

You associate the file type with your program and your program has to check for command line parameters on load. If the command line param is there then you load the file specified by the param.