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. Focus problem!

Focus problem!

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestion
2 Posts 2 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
    rohit dhamija 0
    wrote on last edited by
    #1

    Dear All, I am developing an applicaton in windows2000 using MFC VC++6.0 Can you suggest a way out in the following matter: I have a dialog application A which calls another dialog application B on click of the button. Once the dialog window of B is created the application b is activated ,but I want to bring back the focus on the previous application window.(i want to activate the app a once the b is created) i.e MFC App A ----> Click of button --CALLS---> Another MFC App B (Both are in running state, but the focus gets shifted to application B) Do let me know if you need futher clarification of the question. Regards, Rohit

    A 1 Reply Last reply
    0
    • R rohit dhamija 0

      Dear All, I am developing an applicaton in windows2000 using MFC VC++6.0 Can you suggest a way out in the following matter: I have a dialog application A which calls another dialog application B on click of the button. Once the dialog window of B is created the application b is activated ,but I want to bring back the focus on the previous application window.(i want to activate the app a once the b is created) i.e MFC App A ----> Click of button --CALLS---> Another MFC App B (Both are in running state, but the focus gets shifted to application B) Do let me know if you need futher clarification of the question. Regards, Rohit

      A Offline
      A Offline
      Antti Keskinen
      wrote on last edited by
      #2

      Use WM_SETFOCUS Windows message. Send it from app B's window to app A's window. Unfortunately, as you use two seperate applications, they cannot converse by regular pointer-means. You need to search for the dialog window and grant it focus. You could, alternatively, start the app B as minimized. This can be specified by the STARTUPINFO structure of the CreateProcess call. If it is started up as minimized, it doesn't get the focus. Then, you can create a seperate function into app A that will show and activate B's window as needed. See CreateProcess in MSDN for more information. -Antti Keskinen ---------------------------------------------- The definition of impossible is strictly dependant on what we think is possible.

      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