J
James
Hello all,
Here comes a C# Form focus controlling question.
I write a C# program that only contains a form and will attach to a
general process when I execute it, (e.g.: Notepad.exe) Now, the C# form
can display successfully without stealing the focus from the Notepad
process, i.e. show-no-activate, by using [DllImport( "user32.dll" ) ]
and call the SetWindowPos as follows:
{{{
SetWindowPos( handle, (IntPtr) HWND_TOPMOST, 0, 0, 0, 0,
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_SHOWWINDOW );
form.Visible = true;
}}}
My planned next step is to prevent the C# form from getting the focus
when I click on it. That is, it is hoped that the focus should be
always on the attached application such as Notepad. Does anyone know
how to do that?
James S. Jan
(e-mail address removed)
Here comes a C# Form focus controlling question.
I write a C# program that only contains a form and will attach to a
general process when I execute it, (e.g.: Notepad.exe) Now, the C# form
can display successfully without stealing the focus from the Notepad
process, i.e. show-no-activate, by using [DllImport( "user32.dll" ) ]
and call the SetWindowPos as follows:
{{{
SetWindowPos( handle, (IntPtr) HWND_TOPMOST, 0, 0, 0, 0,
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_SHOWWINDOW );
form.Visible = true;
}}}
My planned next step is to prevent the C# form from getting the focus
when I click on it. That is, it is hoped that the focus should be
always on the attached application such as Notepad. Does anyone know
how to do that?
James S. Jan
(e-mail address removed)