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. Problem with wndTopMost in Vista

Problem with wndTopMost in Vista

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.
  • C Offline
    C Offline
    creatman
    wrote on last edited by
    #1

    Hi! I have a problem with TopMost window on Windows Vista. In Dialog's OnInitDialog method I try to set position by the following code int cx, cy; HDC dc = ::GetDC(NULL); cx = GetDeviceCaps(dc,HORZRES) + GetSystemMetrics(SM_CXBORDER); cy = GetDeviceCaps(dc,VERTRES) + GetSystemMetrics(SM_CYBORDER); ::ReleaseDC(0,dc); //Put window on top and expand it to fill screen SetWindowPos(&wndTopMost, -(GetSystemMetrics(SM_CXBORDER) + 2), -(GetSystemMetrics(SM_CYBORDER) + 2), cx+5,cy+5, 0); that works fine in XP - dialog is realy top most, but on Vista sometimes it is not - some active windows like Firefox can be above of my dialog. I can't understand where is the problem here and how can it be fixed?

    R 1 Reply Last reply
    0
    • C creatman

      Hi! I have a problem with TopMost window on Windows Vista. In Dialog's OnInitDialog method I try to set position by the following code int cx, cy; HDC dc = ::GetDC(NULL); cx = GetDeviceCaps(dc,HORZRES) + GetSystemMetrics(SM_CXBORDER); cy = GetDeviceCaps(dc,VERTRES) + GetSystemMetrics(SM_CYBORDER); ::ReleaseDC(0,dc); //Put window on top and expand it to fill screen SetWindowPos(&wndTopMost, -(GetSystemMetrics(SM_CXBORDER) + 2), -(GetSystemMetrics(SM_CYBORDER) + 2), cx+5,cy+5, 0); that works fine in XP - dialog is realy top most, but on Vista sometimes it is not - some active windows like Firefox can be above of my dialog. I can't understand where is the problem here and how can it be fixed?

      R Offline
      R Offline
      rowdy_vc
      wrote on last edited by
      #2

      hi i need some extra explains from u .. 1. What's the error u get it from Windows vista? 2. Which type of compiler u used like VS2005 r some thing..? give the answer for above questions.. and also try install service pack for windows vista and then u compile it i think it's may be working fine . Actually windows vista is one of the poor OS in this world ..but we ll try our level best!!

      *****THANKS N ADVANCE**** Mathen.K (I WILL TRY MY LEVEL BEST )

      C 1 Reply Last reply
      0
      • R rowdy_vc

        hi i need some extra explains from u .. 1. What's the error u get it from Windows vista? 2. Which type of compiler u used like VS2005 r some thing..? give the answer for above questions.. and also try install service pack for windows vista and then u compile it i think it's may be working fine . Actually windows vista is one of the poor OS in this world ..but we ll try our level best!!

        *****THANKS N ADVANCE**** Mathen.K (I WILL TRY MY LEVEL BEST )

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

        hi, thanks for answer. 1. I did not get any visual errors, I've got only strange behavior of the windows on screen. I set for my window TOPMOST order, but in OS it actually appears under any current active window on the screen. 2. I use VC2005. I found some interesting topic on this problem: http://groups.google.com/group/microsoft.public.vc.mfc/browse_thread/thread/8c9333777d461126/c5ee093565701048[^]

        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