Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8575427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:41:32+00:00 2026-06-11T19:41:32+00:00

I have a situation where when I receive a message I must delete a

  • 0

I have a situation where when I receive a message I must delete a window just from the hWnd. I though this must be possible since CreateWindowEx creates an object by returning a HWND, I must be able to delete one.

Note : The hWnd lies on some other process.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T19:41:33+00:00Added an answer on June 11, 2026 at 7:41 pm

    Proper way is to send WM_CLOSE message to associated window or simply call DestroyWindow which will send WM_DESTROY message to window.

    A thread cannot use DestroyWindow to destroy a window created by a different thread.

    Difference between WM_CLOSE and WM_DESTROY:

    After send WM_CLOSE a target application can prompt the user for confirmation, prior to destroying a window, by processing the WM_CLOSE message and calling the DestroyWindow function only if the user confirms the choice.

    In other words, closing window using WM_CLOSE can be rejected, but it’s considered “safer” then WM_DESTROY, because application can save ask for confirmation and save changes.
    However if you need to force closing use WM_DESTROY.

    HWND struct pointers are managed by system, don’t even try to delete them !

    It does not matter which process owns window if using WM_CLOSE message.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is the situation. I have received a WSDL (and included XSD) from someone
i have situation like this: class IData { virtual void get() = 0; virtual
I have situation in which I read a record from a database. And if
I have situation like this: user submits form with action='/pay' in '/pay' I have
I have a client server situation in which I receive data using read(socket, char_buf,
My situation is this : I have a C# tcp socket through which I
I have a situation where I have a main window with a toolbar containing
I have been dealing with this situation for a while now. I have been
Here is the situation: I have multiple clients and one host. The message format&size
I have a particular situation: a service started by a broadcast receiver starts an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.