So I'm making a Notepad replica in my spare time just for fun, the core of the project is all done. However, I can't open my application from a file. For example, if you had a .txt file, you double click it and it would open the app (by default its Notepad).
I already know how to set the default application, but the code does not support opening the files yet, it can only open files from the menu inside the program.
How would I go about making it so that my application can be opened by files?