Click here to Skip to main content
15,900,108 members
Home / Discussions / C#
   

C#

 
GeneralRe: Cancel Click In Inherited User Control Pin
rich_wenger14-Nov-05 9:48
rich_wenger14-Nov-05 9:48 
GeneralRe: Cancel Click In Inherited User Control Pin
rich_wenger14-Nov-05 9:58
rich_wenger14-Nov-05 9:58 
GeneralRe: Cancel Click In Inherited User Control Pin
Curtis Schlak.14-Nov-05 11:46
Curtis Schlak.14-Nov-05 11:46 
GeneralRe: Cancel Click In Inherited User Control Pin
User 58385214-Nov-05 19:14
User 58385214-Nov-05 19:14 
GeneralRe: Cancel Click In Inherited User Control Pin
rich_wenger15-Nov-05 2:10
rich_wenger15-Nov-05 2:10 
QuestionListView Sorting Pin
x-trate14-Nov-05 4:14
x-trate14-Nov-05 4:14 
AnswerRe: ListView Sorting Pin
Luis Alonso Ramos14-Nov-05 8:11
Luis Alonso Ramos14-Nov-05 8:11 
QuestionSystem Dialogs Pin
palomo9214-Nov-05 3:52
palomo9214-Nov-05 3:52 
hi all,
I would want to allow the opening of particular system dialog from my c# application. I heave find this article written in mfc/c++, is possible to written a similar class in c# ? I have tried but my solution not allow to open a system dialog as modal.

this is my class:

using System;<br />
using System.IO;<br />
using System.Diagnostics;<br />
using System.ComponentModel;<br />
using System.Windows.Forms;<br />
using System.Runtime.InteropServices;<br />
<br />
namespace System<br />
{<br />
	public class SystemDialogs<br />
	{<br />
		public SystemDialogs()<br />
		{<br />
<br />
		}<br />
<br />
		public enum Dialogs<br />
		{<br />
			SD_FORMAT               = 1,<br />
			SD_INTERNET_OPTIONS		= 2,<br />
			SD_ADD_REMOVE_PROGRAMS	= 3,<br />
			SD_DATE_TIME			= 4,<br />
			SD_DISPLAY				= 5,<br />
			SD_MODEM				= 6,<br />
			SD_MULTIMEDIA			= 7,<br />
			SD_MOUSE                = 8,<br />
			SD_NETWORK              = 9,<br />
			SD_PASSWORD             = 10,<br />
			SD_SYSTEM               = 11,<br />
			SD_REGIONAL_SETTINGS    = 12,<br />
			SD_SOUNDS               = 13,<br />
			SD_GAME_CONTROLLERS     = 14,<br />
			SD_KEYBOARD             = 15,<br />
			SD_DEVICE_MANAGER       = 16,<br />
		}<br />
		<br />
		public static void ShowDialog(SystemDialogs.Dialogs Dialog)<br />
		{<br />
			string[] Args = new string[16]<br />
			{<br />
				"Shell32.dll SHFormatDrive",<br />
				"Shell32.dll Control_RunDLLA inetcpl.cpl 0",<br />
				"Shell32.dll Control_RunDLLA appwiz.cpl",<br />
				"Shell32.dll Control_RunDLLA timedate.cpl",<br />
				"Shell32.dll Control_RunDLLA desk.cpl",<br />
				"Shell32.dll Control_RunDLLA modem.cpl",<br />
				"Shell32.dll Control_RunDLLA mmsys.cpl 0",<br />
				"Shell32.dll Control_RunDLLA main.cpl @0",<br />
				"Shell32.dll Control_RunDLLA netcpl.cpl",<br />
				"Shell32.dll Control_RunDLLA password.cpl",<br />
				"Shell32.dll Control_RunDLLA sysdm.cpl 0",<br />
				"Shell32.dll Control_RunDLLA intl.cpl 0",<br />
				"Shell32.dll Control_RunDLLA mmsys.cpl @1",<br />
				"Shell32.dll Control_RunDLLA joy.cpl",<br />
				"Shell32.dll Control_RunDLLA main.cpl @1",<br />
				"DevMgr.dll DeviceManager_ExecuteA"<br />
			};<br />
			<br />
			int i = (int) Dialog - 1;<br />
			Process p = new Process();<br />
			p.StartInfo.FileName = "Rundll32.exe";<br />
			p.StartInfo.Arguments = Args[i];<br />
			//p.StartInfo.UseShellExecute = false;<br />
			//p.StartInfo.ErrorDialog = true;<br />
			//p.StartInfo.RedirectStandardError = true;<br />
			p.Start();<br />
			//p.WaitForExit();<br />
			//string output = p.StandardError.ReadToEnd();<br />
		}<br />
	}<br />
}


In settings form of my application i call this method:

using System;<br />
-----------<br />
----------<br />
SystemDialogs.ShowDialog(SystemDialogs.Dialogs.SD_INTERNET_OPTIONS);


...for showing the internet options dialog as no modal Frown | :( ...

suggestions ?

tnx to all and excuse me for eventual grammar's errors .... i'm italian Wink | ;)
QuestionConverting a relative path into an absolute one Pin
Dan Neely14-Nov-05 3:52
Dan Neely14-Nov-05 3:52 
AnswerRe: Converting a relative path into an absolute one Pin
Curtis Schlak.14-Nov-05 4:55
Curtis Schlak.14-Nov-05 4:55 
GeneralRe: Converting a relative path into an absolute one Pin
Dan Neely14-Nov-05 5:19
Dan Neely14-Nov-05 5:19 
GeneralRe: Converting a relative path into an absolute one Pin
Curtis Schlak.14-Nov-05 5:30
Curtis Schlak.14-Nov-05 5:30 
QuestionCustom control that can contain other controls Pin
Christian Wikander14-Nov-05 3:04
Christian Wikander14-Nov-05 3:04 
AnswerRe: Custom control that can contain other controls Pin
Gulfraz Khan14-Nov-05 5:04
Gulfraz Khan14-Nov-05 5:04 
QuestionFire events without BeginInvoke? Pin
Russell Jones14-Nov-05 3:03
Russell Jones14-Nov-05 3:03 
AnswerRe: Fire events without BeginInvoke? Pin
S. Senthil Kumar14-Nov-05 4:45
S. Senthil Kumar14-Nov-05 4:45 
AnswerRe: Fire events without BeginInvoke? Pin
Frederic Vaillancourt14-Nov-05 10:32
Frederic Vaillancourt14-Nov-05 10:32 
QuestionMessagebox with YestToAll, NoToAll Pin
abcxyz8214-Nov-05 1:59
abcxyz8214-Nov-05 1:59 
AnswerRe: Messagebox with YestToAll, NoToAll Pin
Dan Neely14-Nov-05 2:04
Dan Neely14-Nov-05 2:04 
QuestionProblem with devenv in VS.Net 2005. Plz Help!!! Pin
Dhivya Natarajan14-Nov-05 1:19
Dhivya Natarajan14-Nov-05 1:19 
QuestionRegarding Toolbar Pin
A.Grover14-Nov-05 0:35
A.Grover14-Nov-05 0:35 
QuestionDateTimePicker With multi selection Pin
charbelasmar14-Nov-05 0:31
charbelasmar14-Nov-05 0:31 
QuestionActive Directory Problem Pin
Hamzeh14-Nov-05 0:20
Hamzeh14-Nov-05 0:20 
Questionapp.config not visible Pin
sandeep_programmer13-Nov-05 23:54
sandeep_programmer13-Nov-05 23:54 
AnswerRe: app.config not visible Pin
Sean Michael Murphy14-Nov-05 5:18
Sean Michael Murphy14-Nov-05 5:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.