You can set the requireAdmin in the executables manifest file, and then this will request your application to be raised to admin, the user may have to supply additional credentials (like run as). It will put a little shield against your application icon in explorer.
In Visual Studio
- select properties on your project,
- then open up "Configuration Properties"
- then open up Linker
- Select "Manifest File"
- and modify "UAC Execution Level" to requireAdministrator
you can do this other ways but that's one of the easiest. So, in your example if the program you wrote had UAC execution level set to "requireAdministrator" then the program you call would then also be elevated in this case notepad. (I think that there may be some way to make sure that you are not elevated, but I have never done that)