Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. API to close any window using c++ win32

API to close any window using c++ win32

Scheduled Pinned Locked Moved C / C++ / MFC
c++json
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Subrat 4708266
    wrote on last edited by
    #1

    Hi all, I need win32 API to close any window(ex:IE) forcibly.Lets take one scenario. Steps: 1.Install toolbar(Yahoo/Google) 2.Open IE. 3.Close IE.// Here unless until we are closing toolbar popup window we can't close browser window. But I need API to close browser window without interacting with toolbar window. Thanks...

    _ H 2 Replies Last reply
    0
    • S Subrat 4708266

      Hi all, I need win32 API to close any window(ex:IE) forcibly.Lets take one scenario. Steps: 1.Install toolbar(Yahoo/Google) 2.Open IE. 3.Close IE.// Here unless until we are closing toolbar popup window we can't close browser window. But I need API to close browser window without interacting with toolbar window. Thanks...

      _ Offline
      _ Offline
      _Superman_
      wrote on last edited by
      #2

      You can use PostQuitMessage API to tell the window to close. If you want to force a close you can use TerminateProcess to kill the process. But does not guarantee proper cleanup.

      «_Superman_»

      1 Reply Last reply
      0
      • S Subrat 4708266

        Hi all, I need win32 API to close any window(ex:IE) forcibly.Lets take one scenario. Steps: 1.Install toolbar(Yahoo/Google) 2.Open IE. 3.Close IE.// Here unless until we are closing toolbar popup window we can't close browser window. But I need API to close browser window without interacting with toolbar window. Thanks...

        H Offline
        H Offline
        Hamid Taebi
        wrote on last edited by
        #3

        You can send WM_CLOSE to programs.

        Of one Essence is the human race thus has Creation put the base One Limb impacted is sufficient For all Others to feel the Mace (Saadi )

        S 2 Replies Last reply
        0
        • H Hamid Taebi

          You can send WM_CLOSE to programs.

          Of one Essence is the human race thus has Creation put the base One Limb impacted is sufficient For all Others to feel the Mace (Saadi )

          S Offline
          S Offline
          Subrat 4708266
          wrote on last edited by
          #4

          I have tried with WM_CLOSE, but it is not working.Better if sending the code.

          H 1 Reply Last reply
          0
          • H Hamid Taebi

            You can send WM_CLOSE to programs.

            Of one Essence is the human race thus has Creation put the base One Limb impacted is sufficient For all Others to feel the Mace (Saadi )

            S Offline
            S Offline
            Subrat 4708266
            wrote on last edited by
            #5

            FYI: In widows task manager we are able to 'End Task' any application.I read one article, it was written to use EndTask() API to close any app forcibly. But my compiler is flashing error.I think it doesn't exit in VS2008 express edition.

            H 1 Reply Last reply
            0
            • S Subrat 4708266

              I have tried with WM_CLOSE, but it is not working.Better if sending the code.

              H Offline
              H Offline
              Hamid Taebi
              wrote on last edited by
              #6

              You need to get handle of programs(HWND) and then you can use of SendMessage for close them.

              Of one Essence is the human race thus has Creation put the base One Limb impacted is sufficient For all Others to feel the Mace (Saadi )

              1 Reply Last reply
              0
              • S Subrat 4708266

                FYI: In widows task manager we are able to 'End Task' any application.I read one article, it was written to use EndTask() API to close any app forcibly. But my compiler is flashing error.I think it doesn't exit in VS2008 express edition.

                H Offline
                H Offline
                Hamid Taebi
                wrote on last edited by
                #7

                What was the error?

                Of one Essence is the human race thus has Creation put the base One Limb impacted is sufficient For all Others to feel the Mace (Saadi )

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups