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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Threads 1
Giveaway Killing Floor ---- FREE for a limited time! 0
prevent from refresh 4
window invisible 2
internet connection 3
Special UV light safely kills airborne flu virus 10
Change assembly name 3
Can't delete file 3

Back
Top