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. Problems with SetWindowPos function

Problems with SetWindowPos function

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

    I'm using on VC6 the SetWindowPos function to set to wndTopMost style for a dialog, but not get the focus. In Win2k it works well, but on Win9x the dialog get the focus. Anyone know how solve this problem ? Thanks, Cristiano ...

    J 1 Reply Last reply
    0
    • C Cris

      I'm using on VC6 the SetWindowPos function to set to wndTopMost style for a dialog, but not get the focus. In Win2k it works well, but on Win9x the dialog get the focus. Anyone know how solve this problem ? Thanks, Cristiano ...

      J Offline
      J Offline
      jafrazee
      wrote on last edited by
      #2

      i had a similar problem. i am not sure way it did not work but seem bto be the way the dialog was created. my work around was to shift the x,y pos 1 pixel. this allowed the setwindowpos to work and setfocus.

      C 1 Reply Last reply
      0
      • J jafrazee

        i had a similar problem. i am not sure way it did not work but seem bto be the way the dialog was created. my work around was to shift the x,y pos 1 pixel. this allowed the setwindowpos to work and setfocus.

        C Offline
        C Offline
        Cris
        wrote on last edited by
        #3

        Explaining better: I'm using SetWindowPos setting the position too. And is not wished that the dialog get the focus, I want set to TOPMOST style. []'s Cristiano

        J 1 Reply Last reply
        0
        • C Cris

          Explaining better: I'm using SetWindowPos setting the position too. And is not wished that the dialog get the focus, I want set to TOPMOST style. []'s Cristiano

          J Offline
          J Offline
          jafrazee
          wrote on last edited by
          #4

          if i understand correctly you wish to bring a child dialog to the top without setting focus to the child. to do this you could use the SWP_NOACTIVATE flag. or you could use a comination of different flags to get the exact settings you require. SWP_ASYNCWINDOWPOS SWP_DEFERERASE SWP_DRAWFRAME SWP_FRAMECHANGED SWP_HIDEWINDOW SWP_NOACTIVATE SWP_NOMOVE SWP_NOOWNERZORDER SWP_NOREDRAW SWP_NOREPOSITION SWP_NOSENDCHANGING SWP_NOSIZE SWP_NOZORDER SWP_SHOWWINDOW

          C 1 Reply Last reply
          0
          • J jafrazee

            if i understand correctly you wish to bring a child dialog to the top without setting focus to the child. to do this you could use the SWP_NOACTIVATE flag. or you could use a comination of different flags to get the exact settings you require. SWP_ASYNCWINDOWPOS SWP_DEFERERASE SWP_DRAWFRAME SWP_FRAMECHANGED SWP_HIDEWINDOW SWP_NOACTIVATE SWP_NOMOVE SWP_NOOWNERZORDER SWP_NOREDRAW SWP_NOREPOSITION SWP_NOSENDCHANGING SWP_NOSIZE SWP_NOZORDER SWP_SHOWWINDOW

            C Offline
            C Offline
            Cris
            wrote on last edited by
            #5

            The have tried this ... but no sucess. The problem persist. Any others solutions ? []'s

            J 1 Reply Last reply
            0
            • C Cris

              The have tried this ... but no sucess. The problem persist. Any others solutions ? []'s

              J Offline
              J Offline
              jafrazee
              wrote on last edited by
              #6

              not really, but is the dialog modeless. if it is modal you would only have access to the new top level dialog. sorry thats all i have.

              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