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. Activate window in Win2000

Activate window in Win2000

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
5 Posts 3 Posters 1 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.
  • M Offline
    M Offline
    Mike Melnikov
    wrote on last edited by
    #1

    I want to maximise window from SystemTray. after calling DrawAnimatedRects for my window I tried to use SetActiveWindow(); SetForegroundWindow(); and even ModifyStyleEx(0,WS_EX_TOPMOST) and it works in WinNT but not Win2000 can anybody help me? Mike.:confused:

    A M 2 Replies Last reply
    0
    • M Mike Melnikov

      I want to maximise window from SystemTray. after calling DrawAnimatedRects for my window I tried to use SetActiveWindow(); SetForegroundWindow(); and even ModifyStyleEx(0,WS_EX_TOPMOST) and it works in WinNT but not Win2000 can anybody help me? Mike.:confused:

      A Offline
      A Offline
      AlexMarbus
      wrote on last edited by
      #2

      Does GetLastError() give any valueable information? Are you sure this is caused by DrawAnimatedRects()? Have you considered commenting out the DrawAnimatedRects-call and see what happens? From what function do you call DrawAnimatedRects()? -- Alex Marbus

      M 1 Reply Last reply
      0
      • M Mike Melnikov

        I want to maximise window from SystemTray. after calling DrawAnimatedRects for my window I tried to use SetActiveWindow(); SetForegroundWindow(); and even ModifyStyleEx(0,WS_EX_TOPMOST) and it works in WinNT but not Win2000 can anybody help me? Mike.:confused:

        M Offline
        M Offline
        Michael Dunn
        wrote on last edited by
        #3

        Win 2K (and 98) restrict when SetForegroundWindow() can be used. Read the docs page for SetForegroundWindow() - it has all the details. --Mike-- http://home.inreach.com/mdunn/ Is history an illusion caused by the passage of time, or is time an illusion caused by the passage of history?

        M 1 Reply Last reply
        0
        • A AlexMarbus

          Does GetLastError() give any valueable information? Are you sure this is caused by DrawAnimatedRects()? Have you considered commenting out the DrawAnimatedRects-call and see what happens? From what function do you call DrawAnimatedRects()? -- Alex Marbus

          M Offline
          M Offline
          Mike Melnikov
          wrote on last edited by
          #4

          thank you for response. GetLastError() tell me that all OK. really problem doesn't caused by DrawAnimatedRects() I tried to prevent restricting for SetForegroundWindow (as MSDN tells) but I can't do it :-( If it is interesting for you, I solved my problem, using SetWindowPos(&CWnd::wndTopMost...); and then SetWindowPos(&CWnd::wndNoTopMost...); Mike. :-)

          1 Reply Last reply
          0
          • M Michael Dunn

            Win 2K (and 98) restrict when SetForegroundWindow() can be used. Read the docs page for SetForegroundWindow() - it has all the details. --Mike-- http://home.inreach.com/mdunn/ Is history an illusion caused by the passage of time, or is time an illusion caused by the passage of history?

            M Offline
            M Offline
            Mike Melnikov
            wrote on last edited by
            #5

            thank you for response. I tried to prevent restricting for SetForegroundWindow (as MSDN tells) but I can't do it :-( If it is interesting for you, I solved my problem, using SetWindowPos(&CWnd::wndTopMost...); and then SetWindowPos(&CWnd::wndNoTopMost...); Mike. :-)

            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