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. Regarding Modeless dialog

Regarding Modeless dialog

Scheduled Pinned Locked Moved C / C++ / MFC
help
4 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.
  • B Offline
    B Offline
    balajeedurai
    wrote on last edited by
    #1

    Hai frens.. . I have created a modeless dialog. . .I am creating the modeless dialog with their parent as desktop, in order to send dialog behind the parent window once the parent is clicked. Now i have a prblm that once the modeless dialog is closed the parent is not getting activated. . Only if i click on it its getting active.Could any one help me to over come this prblm. . Tanx bye

    S 1 Reply Last reply
    0
    • B balajeedurai

      Hai frens.. . I have created a modeless dialog. . .I am creating the modeless dialog with their parent as desktop, in order to send dialog behind the parent window once the parent is clicked. Now i have a prblm that once the modeless dialog is closed the parent is not getting activated. . Only if i click on it its getting active.Could any one help me to over come this prblm. . Tanx bye

      S Offline
      S Offline
      Sujan Christo
      wrote on last edited by
      #2

      Hi, you can use the function SetForegroundWindow() using the window address to make it active Sujan

      B 1 Reply Last reply
      0
      • S Sujan Christo

        Hi, you can use the function SetForegroundWindow() using the window address to make it active Sujan

        B Offline
        B Offline
        balajeedurai
        wrote on last edited by
        #3

        I tried using that fnction its not working. . . my application is an form based SDI. I tried to bring parent to fore ground on the close of child. but its not working. Do any boby have some other solution. Tanx bye

        B 1 Reply Last reply
        0
        • B balajeedurai

          I tried using that fnction its not working. . . my application is an form based SDI. I tried to bring parent to fore ground on the close of child. but its not working. Do any boby have some other solution. Tanx bye

          B Offline
          B Offline
          BlackDice
          wrote on last edited by
          #4

          here is a code snippet I found on this site a few weeks ago. I think the title of the article is something like "Dialog box tips & tricks". I haven't tried it yet, but I thought it may come in handy, so I put it in my Code Librarian:

          //Attach foreground window thread
          //to our thread
          AttachThreadInput(
              GetWindowThreadProcessId(
                  ::GetForegroundWindow(),NULL),
              GetCurrentThreadId(),TRUE);
          
          //Do our stuff here ;-)
          SetForegroundWindow();
          SetFocus(); //Just playing safe
          
          //Detach the attached thread
          AttachThreadInput(
              GetWindowThreadProcessId(
                  ::GetForegroundWindow(),NULL),
              GetCurrentThreadId(),FALSE);
          

          Who are all these people and what are they doing in my house?...Me in 30 years, inside a grocery store bdiamond :zzz:

          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