2 // System.Windows.Forms.CommonDialog.cs
5 // stubbed out by Jaak Simm (jaaksimm@firm.ee)
6 // Dennis Hayes (dennish@Raytek.com)
8 // (C) Ximian, Inc., 2002
11 using System.ComponentModel;
13 namespace System.Windows.Forms {
16 /// Specifies the base class used for displaying dialog boxes on the screen.
20 public abstract class CommonDialog : Component {
24 /// --- constructor ---
26 public CommonDialog() : base ()
32 protected virtual IntPtr HookProc(IntPtr hWnd,int msg,IntPtr wparam,IntPtr lparam)
34 // FIXME: center window in response to WM_INITDIALOG message
40 protected virtual void OnHelpRequest(EventArgs e)
44 // end of event methods
47 protected virtual IntPtr OwnerWndProc(IntPtr hWnd,int msg,IntPtr wparam,IntPtr lparam)
49 throw new NotImplementedException ();
52 public abstract void Reset();
54 protected abstract bool RunDialog(IntPtr hwndOwner);
57 public DialogResult ShowDialog()
59 bool res = RunDialog ( Control.getOwnerWindow ( null ).Handle );
60 return res ? DialogResult.OK : DialogResult.Cancel;
64 public DialogResult ShowDialog(IWin32Window owner)
66 bool res = RunDialog ( owner.Handle );
67 return res ? DialogResult.OK : DialogResult.Cancel;
72 public event EventHandler HelpRequest;