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. Restore after HIDE?

Restore after HIDE?

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 Posts 5 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.
  • R Offline
    R Offline
    ROWALI
    wrote on last edited by
    #1

    ShowWindow(SW_HIDE) will hide the window and in my case , make the windows of other applications to the foreground and activate them. How can I restore it programatically when my application is not having focus.. Does my application have to be a service..in which case any short cut key will make it active again? row

    R L E S 4 Replies Last reply
    0
    • R ROWALI

      ShowWindow(SW_HIDE) will hide the window and in my case , make the windows of other applications to the foreground and activate them. How can I restore it programatically when my application is not having focus.. Does my application have to be a service..in which case any short cut key will make it active again? row

      R Offline
      R Offline
      Rage
      wrote on last edited by
      #2

      ROWALI wrote:

      How can I restore it programatically when my application is not having focus

      You need a handle or a pointer on your window, and then use ShowWindow(SW_SHOW). BUT the question is : what is the reason for your window to be showed again ? According to the answer, you'll find the method to bring the window back (e.g. do it from another app -- a hook, or from within your app). ~RaGE();

      I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus

      1 Reply Last reply
      0
      • R ROWALI

        ShowWindow(SW_HIDE) will hide the window and in my case , make the windows of other applications to the foreground and activate them. How can I restore it programatically when my application is not having focus.. Does my application have to be a service..in which case any short cut key will make it active again? row

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Just an idea... You could always use RegisterHotKey() and set a hotkey activation. Then in your dialog, you would need to handle the WM_HOTKEY message, and do ShowWindow(SW_SHOW) and make your dialog visible again. or You could add a system tray icon, and have the user click the tray icon to show the dialog again. I would suggest searching codeproject, there are many samples of both. -Randor

        1 Reply Last reply
        0
        • R ROWALI

          ShowWindow(SW_HIDE) will hide the window and in my case , make the windows of other applications to the foreground and activate them. How can I restore it programatically when my application is not having focus.. Does my application have to be a service..in which case any short cut key will make it active again? row

          E Offline
          E Offline
          Eytukan
          wrote on last edited by
          #4

          After you ShowWindow(SW_NORMAL)Use SetWindowPos with HWND_NOTOPMOST for the "insert after" parameter. byebye..


          --[:jig:]-- [My Current Status]

          1 Reply Last reply
          0
          • R ROWALI

            ShowWindow(SW_HIDE) will hide the window and in my case , make the windows of other applications to the foreground and activate them. How can I restore it programatically when my application is not having focus.. Does my application have to be a service..in which case any short cut key will make it active again? row

            S Offline
            S Offline
            Sarath C
            wrote on last edited by
            #5

            Try CWnd::OnSetFocus and CWnd::OnActivateApp SaRath.
            "Do Next Thing..." Understanding State Pattern in C++

            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