Control Panel applets
-
Hi, i'm developing an app where i want to detect internet connection status. I have a linked label on a statusbar (where i show if i'm connected or not). On the click event of the label, i have this code: try { System.Diagnostics.Process proc = new System.Diagnostics.Process(); proc.StartInfo.UseShellExecute = false; proc.StartInfo.FileName = "cmd"; proc.StartInfo.Arguments = "rundll32.exe shell32.dll,Control_RunDLL ncpa.cpl,,0"; proc.Start(); //proc.WaitForExit(); } catch { } As you can tell, the idea is to show the Network Connections avaible on the target system. I searched a while for it, and since C# doesn't support Shell, this is supossed to be the way. :doh: I'm just getting the cmd "poped up". It doesn't call the arguments. When I copy/paste the arguments string on cmd, i get the Network Connections window opened, but cmd remains open as well. Is there any other way to call the control panel applets in c#? If not, is there any way that to emulate the "Run..." from Start menu with c#? Thanks for your time fellas. :laugh: daniel sovino
-
Hi, i'm developing an app where i want to detect internet connection status. I have a linked label on a statusbar (where i show if i'm connected or not). On the click event of the label, i have this code: try { System.Diagnostics.Process proc = new System.Diagnostics.Process(); proc.StartInfo.UseShellExecute = false; proc.StartInfo.FileName = "cmd"; proc.StartInfo.Arguments = "rundll32.exe shell32.dll,Control_RunDLL ncpa.cpl,,0"; proc.Start(); //proc.WaitForExit(); } catch { } As you can tell, the idea is to show the Network Connections avaible on the target system. I searched a while for it, and since C# doesn't support Shell, this is supossed to be the way. :doh: I'm just getting the cmd "poped up". It doesn't call the arguments. When I copy/paste the arguments string on cmd, i get the Network Connections window opened, but cmd remains open as well. Is there any other way to call the control panel applets in c#? If not, is there any way that to emulate the "Run..." from Start menu with c#? Thanks for your time fellas. :laugh: daniel sovino
kiweed wrote:
since C# doesn't support Shell
Ummm. Are you sure?:)
ProcessStartInfo NetworkConnections = new ProcessStartInfo("rundll32.exe", "shell32.dll,Control_RunDLL ncpa.cpl");
Process.Start(NetworkConnections);Regards:rose:
-
kiweed wrote:
since C# doesn't support Shell
Ummm. Are you sure?:)
ProcessStartInfo NetworkConnections = new ProcessStartInfo("rundll32.exe", "shell32.dll,Control_RunDLL ncpa.cpl");
Process.Start(NetworkConnections);Regards:rose: