kill window

  • Thread starter Thread starter Konrad
  • Start date Start date
K

Konrad

Hi

How to kill some window from the same application
but from other thread having name of this window?

Thanks Konrad
 
You may want to structure the application so that the thread knows more
about the window than just the name.

However, with just the name, you could certainly use P/Invoke.

FindWindow to get the handle to the window, then
SendMessage to send a WM_CLOSE to the window

Jerry
 
* "Konrad said:
How to kill some window from the same application
but from other thread having name of this window?

What's the "name" of the window?
 
Hi Konrad,

Since it's in the same application, you may pass in your Form reference to
your thread, and call the close <form>.Invoke(new
MethodInvoker(<form>.Close()));
You need call Form.Close by Control.Invoke method, because it's not
recommended to operate GUI on another thread.


Best regards,

Ying-Shen Yu [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, "online" should be removed before
sending.
 
Back
Top