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
helptutorialquestion
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.
  • N Offline
    N Offline
    Nick Armstrong
    wrote on last edited by
    #1

    I have an application that shows a splash screen for 5 seconds, the splash screen is deleted and a dialog box should be shown. The problem I had was that the dialog box would be behind everything else (the edit box inside the dialog would still have focus, which is correct). To solve this, in the OnInitDialog of the dialog I set the window position and size etc and set the first parameter to wndTopMost. This worked up to a point. The dialog is now on top and the cursor is flashing in the edit box where it should, BUT the box itself still doesn't have focus and you have to click on it before you can type in the edit box. Any ideas how to rectify this? Thanks in advance for any help, Nick

    T 1 Reply Last reply
    0
    • N Nick Armstrong

      I have an application that shows a splash screen for 5 seconds, the splash screen is deleted and a dialog box should be shown. The problem I had was that the dialog box would be behind everything else (the edit box inside the dialog would still have focus, which is correct). To solve this, in the OnInitDialog of the dialog I set the window position and size etc and set the first parameter to wndTopMost. This worked up to a point. The dialog is now on top and the cursor is flashing in the edit box where it should, BUT the box itself still doesn't have focus and you have to click on it before you can type in the edit box. Any ideas how to rectify this? Thanks in advance for any help, Nick

      T Offline
      T Offline
      Tomasz Sowinski
      wrote on last edited by
      #2

      This is probably a problem with splash screen which is disabling your dialog window. Check if splash calls EnableWindow. Tomasz Sowinski -- http://www.shooltz.com

      N 1 Reply Last reply
      0
      • T Tomasz Sowinski

        This is probably a problem with splash screen which is disabling your dialog window. Check if splash calls EnableWindow. Tomasz Sowinski -- http://www.shooltz.com

        N Offline
        N Offline
        Nick Armstrong
        wrote on last edited by
        #3

        I was actually using the splash class wrongly and putting a line of code in the wrong place (doh), thanks for the help though, Nick :)

        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