PDA

View Full Version : how do you call a windows function?


Lucian Cain
10-25-2006, 09:43 AM
I am trying to call the Add/Remove Programs Dialog box via the appwiz.cpl file in c:\windows\system32 folder. Similar to using the above file from the command prompt in the START>> RUN dialog. This is for a "Removal of Software" button.

"ON CLICK"
File.Run("appwiz.cpl", "", "", SW_SHOWNORMAL);

Am I missing something... does it HAVE to be an EXE? Will AMS 5.0.5.0 not recognize the .cpl file extension?

Tek
10-25-2006, 10:32 AM
Try this code below. You have to call the rundll32.exe file with the parameters to open the Add/Remove Programs screen.


File.Run("rundll32.exe", "shell32.dll,Control_RunDLL appwiz.cpl,,0", "", SW_SHOWNORMAL, false);