I created a custom paint program , it is really good and better than the Microsoft Paint , now i am on stage two of the program , where i want to replace the old mspaint.exe where located in C:\WINDOWS\system32\mspaint.exe with my custom paint application , i tried to do that by typing the command :
System.IO.File.Copy(@"mspaint.exe", "C:\\WINDOWS\\system32\\mspaint.exe", true);
And that was not successful , i just tried to make my custom application is the default paint program , but once i do that , the old mspaint keep comming back !!
EDIT : I am trying to do that in windows XP
EDIT 2 : i made a regestry key : LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\mspaint.exe and made a string value of name : debugger and added string : C:\windows\system32\mypaint.exe and whenever i try to open any image i get error message :
Unable to find a version of the runtime to run this application
and my custom program does not open.
Perhaps you can use image file execution options registry to forward calls of mspaint.exe to your exe.
In order to so:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\currentversion\image file execution optionsmspaint.exedebuggerand set its value to your exe file