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. plz help me out

plz help me out

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
3 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.
  • W Offline
    W Offline
    whizano
    wrote on last edited by
    #1

    hi..,:-D a happy n prosperous new year.., my app makes use of ShellExecuteEx to run an initializing process(on OnInitInstance). It takes some 5 to 7 seconds to finish, so i spawn a thread which has a progressbar which steps for 7 secs. my app WaitForSingleInstance till the Delay(Progress)Dlg PostQuitMessage. Then it doModals the main dlg. Its all workin fine but when my main dlg is shown, it loses focus. I've tried setActivewnd, setforegrndwnd, setfocus, etc. on the InitInstance of my main dlg. i wanna kno how i can bring da dlg to the foregrnd. also on enter/esc key press the app exits, its the OnOK() OnCancel(), nope? can i prevent this by a do nothin override? thanks, -- ano

    O 1 Reply Last reply
    0
    • W whizano

      hi..,:-D a happy n prosperous new year.., my app makes use of ShellExecuteEx to run an initializing process(on OnInitInstance). It takes some 5 to 7 seconds to finish, so i spawn a thread which has a progressbar which steps for 7 secs. my app WaitForSingleInstance till the Delay(Progress)Dlg PostQuitMessage. Then it doModals the main dlg. Its all workin fine but when my main dlg is shown, it loses focus. I've tried setActivewnd, setforegrndwnd, setfocus, etc. on the InitInstance of my main dlg. i wanna kno how i can bring da dlg to the foregrnd. also on enter/esc key press the app exits, its the OnOK() OnCancel(), nope? can i prevent this by a do nothin override? thanks, -- ano

      O Offline
      O Offline
      Owner drawn
      wrote on last edited by
      #2

      whizano wrote:

      so i spawn a thread

      I think this is the reason. The main thread does not own the dialog. I think so. Since you are popping up the dialog from this thread.

      whizano wrote:

      Then it doModals

      How can you call all those functions when you have called DoModal()... Coz unless the dialog closes nothing will work. Calling before won't work too.

      Jesus Loves You and Me :)

      --Owner Drawn --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord

      W 1 Reply Last reply
      0
      • O Owner drawn

        whizano wrote:

        so i spawn a thread

        I think this is the reason. The main thread does not own the dialog. I think so. Since you are popping up the dialog from this thread.

        whizano wrote:

        Then it doModals

        How can you call all those functions when you have called DoModal()... Coz unless the dialog closes nothing will work. Calling before won't work too.

        Jesus Loves You and Me :)

        --Owner Drawn --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord

        W Offline
        W Offline
        whizano
        wrote on last edited by
        #3

        its al in OnInitInstance --i spawn a new thread XX which shows a dlg --shellexecute --waifrosingleobject(thread XX) --maindlg.domodal thanks, -- ano

        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