Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I had the same problem. Additionally I was not able to directly hook a dialog to a foreign window with .NET. Therefore I supply a work around to hook a dialog to the parent of a given window handle:</p> <pre><code>// ------------------------------------------------------------------------ public class CHelpWindow : Form { // this class hooks to a foreign window handle and then it starts a // modal dialog to this form; .NET seems not to be able to hook a dialog // to a foreign window directly: therefore this solution // retrievs the parent window of the passed child [DllImport("user32.dll")] private static extern IntPtr GetParent (IntPtr hWndChild); // changes the parent window of the passed child [DllImport("user32.dll")] private static extern IntPtr SetParent (IntPtr hWndChild, IntPtr hWndNewParent); // -------------------------------------------------------------------- public CHelpWindow (long liHandle) // this constructor initializes this form and positions itself outside // the client area; then it prepares the call to create the dialog after // the form is first shown in the window { // suppressing multiple layout events SuspendLayout (); // positioning the windoe outside the parent area ClientSize = new Size ( 1, 1); Location = new Point (-1, -1); // the dialog will be created when this form is first shown Shown += new EventHandler (HelpWindow_Shown); // resuming layout events without executing pending layout requests ResumeLayout (false); // hooking to the parent of the passed handle: that is the control, not // the tab of the screen saver dialog IntPtr oParent = GetParent (new IntPtr (liHandle)); SetParent (Handle, oParent); } // -------------------------------------------------------------------- private void HelpWindow_Shown (object oSender, EventArgs oEventArgs) // this function is called when the form is first shown; now is the right // time to start our configuration dialog { // now creating the dialog CKonfiguration oConfiguration = new CKonfiguration (); // starting this dialog with the owner of this object; because this // form is hooked to the screen saver dialog, the startet dialog is // then indirectly hooked to that dialog oConfiguration.ShowDialog (this); // we don not need this object any longer Close (); } } </code></pre> <p>After extracting your handle from the command line</p> <pre><code>/c:#### </code></pre> <p>you create your Dialog by</p> <pre><code>CHelpWindow oHelpWindow = new CHelpWindow (liHandle); oHelpWindow.ShowDialog (); </code></pre> <p>Reimer</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload