locked
HOW TO GET WINDOW HANDLE RRS feed

  • Question

  • Hello!

     

    I am using the Windows GDI DocumentProperties function to launch the Printer Preference Dialog.

     

    The first parameter to this function is an IntPtr which is a Handle to the parent window.

     

     How do I get this value??

     

    The "Handle" property only works for a Form object.
    I am using a Window object.

     

     

    Thanks for helping!

     

    Thursday, December 13, 2007 3:06 AM

Answers

  • Try this:

     

    IntPtr windowHandle = new WindowInteropHelper(Application.Current.MainWindow).Handle;

     

    use the System.Windows.Interop namespace.

    Thursday, December 13, 2007 3:09 AM

All replies