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. When does a window appear?

When does a window appear?

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++graphicshelp
5 Posts 4 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.
  • T Offline
    T Offline
    Themis
    wrote on last edited by
    #1

    Hi, I 'd like to ask an MFC related question. I have an SDI application and I want to show a modal dialog just when my main frame appears on screen. Which event of my CMainFrm should I register for that? I've tried ON_WM_CREATE and ON_WM_SHOWWINDOW but the first is called before any drawing has been done and the latter doesn't get invoked at all! Could you help me plz? Themis

    C B J 3 Replies Last reply
    0
    • T Themis

      Hi, I 'd like to ask an MFC related question. I have an SDI application and I want to show a modal dialog just when my main frame appears on screen. Which event of my CMainFrm should I register for that? I've tried ON_WM_CREATE and ON_WM_SHOWWINDOW but the first is called before any drawing has been done and the latter doesn't get invoked at all! Could you help me plz? Themis

      C Offline
      C Offline
      Cool Ju
      wrote on last edited by
      #2

      Hi, Create a timer in Mainframe with 1 as timer interval. Add handler to WM_TIMER message and domodal the dialog in it. Dont forger to kill the Timer before u show the dialog. Bye, Cool Ju:cool:

      1 Reply Last reply
      0
      • T Themis

        Hi, I 'd like to ask an MFC related question. I have an SDI application and I want to show a modal dialog just when my main frame appears on screen. Which event of my CMainFrm should I register for that? I've tried ON_WM_CREATE and ON_WM_SHOWWINDOW but the first is called before any drawing has been done and the latter doesn't get invoked at all! Could you help me plz? Themis

        B Offline
        B Offline
        Bob Stanneveld
        wrote on last edited by
        #3

        When exactly do you want your dialog to appear? Just before or just after the mainframe appears on screen? Behind every great black man...             ... is the police. - Conspiracy brother Blog[^]

        T 1 Reply Last reply
        0
        • B Bob Stanneveld

          When exactly do you want your dialog to appear? Just before or just after the mainframe appears on screen? Behind every great black man...             ... is the police. - Conspiracy brother Blog[^]

          T Offline
          T Offline
          Themis
          wrote on last edited by
          #4

          Just after the mainframe appears. To Cool Jul: I don't think the timer is a good idea, because the initilization in a slow machine may take more time than in mine pc. Thanks though! Themis

          1 Reply Last reply
          0
          • T Themis

            Hi, I 'd like to ask an MFC related question. I have an SDI application and I want to show a modal dialog just when my main frame appears on screen. Which event of my CMainFrm should I register for that? I've tried ON_WM_CREATE and ON_WM_SHOWWINDOW but the first is called before any drawing has been done and the latter doesn't get invoked at all! Could you help me plz? Themis

            J Offline
            J Offline
            John R Shaw
            wrote on last edited by
            #5

            Here's a thought: 1) Create a user defined message, that you can post to display the dialog. 2) In the main frames OnSetFocus(), just post the message (post not send). If there is already a command that allows the user to display the dialog then you can skip step 1 and just post that messge. INTP "The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes." Andrew W. Troelsen

            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