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. Query Related to Setting position of a my window above Taskbar in Vista

Query Related to Setting position of a my window above Taskbar in Vista

Scheduled Pinned Locked Moved C / C++ / MFC
database
6 Posts 3 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.
  • R Offline
    R Offline
    Rahul Vaishnav
    wrote on last edited by
    #1

    Hi all, I want to set position of my window on top of Taskbar window also.. I have used

    ::SetWindowPos(hwnd, HWND_TOPMOST, X, Y, cx, cy, SWP_NOSIZE | SWP_SHOWWINDOW | SWP_DRAWFRAME);

    this is working fine in case of XP but in vista my window gets overlapped by the TaskBar. Note: In both XP & Vista I have enabled "Keep the Taskbar on top of all other windows" property of Taskbar. I want my window tobe work like Task Manager Window. Please provide some solution to me. Thanks in advance.

    J I 2 Replies Last reply
    0
    • R Rahul Vaishnav

      Hi all, I want to set position of my window on top of Taskbar window also.. I have used

      ::SetWindowPos(hwnd, HWND_TOPMOST, X, Y, cx, cy, SWP_NOSIZE | SWP_SHOWWINDOW | SWP_DRAWFRAME);

      this is working fine in case of XP but in vista my window gets overlapped by the TaskBar. Note: In both XP & Vista I have enabled "Keep the Taskbar on top of all other windows" property of Taskbar. I want my window tobe work like Task Manager Window. Please provide some solution to me. Thanks in advance.

      I Offline
      I Offline
      Iain Clarke Warrior Programmer
      wrote on last edited by
      #2

      It took me a bit of digging, as some terminology can be a bit odd... But you might want to let explorer do most of the work for you, by writing your program as a "Desk Band". Have a look at the following msdn article, and scroll down aways until you get to the desk band section. http://msdn.microsoft.com/en-us/library/cc144099(VS.85).aspx[^] I'd also look at Michael Dunn's shell programming articles - possibly the best articles since "How to slice bread using only your debugger". Iain.

      1 Reply Last reply
      0
      • R Rahul Vaishnav

        Hi all, I want to set position of my window on top of Taskbar window also.. I have used

        ::SetWindowPos(hwnd, HWND_TOPMOST, X, Y, cx, cy, SWP_NOSIZE | SWP_SHOWWINDOW | SWP_DRAWFRAME);

        this is working fine in case of XP but in vista my window gets overlapped by the TaskBar. Note: In both XP & Vista I have enabled "Keep the Taskbar on top of all other windows" property of Taskbar. I want my window tobe work like Task Manager Window. Please provide some solution to me. Thanks in advance.

        J Offline
        J Offline
        Jijo Raj
        wrote on last edited by
        #3

        Try disabling "Always on top" feature of taskbar when your application starts and restore it when your application exits. Check this article[^] about how to do it. Open the article and search for "Taskbar always on top". Hope it will help. Regards, Jijo.

        _____________________________________________________ http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.

        R 1 Reply Last reply
        0
        • J Jijo Raj

          Try disabling "Always on top" feature of taskbar when your application starts and restore it when your application exits. Check this article[^] about how to do it. Open the article and search for "Taskbar always on top". Hope it will help. Regards, Jijo.

          _____________________________________________________ http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.

          R Offline
          R Offline
          Rahul Vaishnav
          wrote on last edited by
          #4

          Thanks for your reply, I have tried this

          static HWND hShellWnd = ::FindWindow(_T("Shell_TrayWnd"), NULL);
          if(hShellWnd != NULL)
          {
          // Set taskbar always on top off
          ::SendMessage(hShellWnd, 0x2b1, 8, 0);
          ::SendMessage(hShellWnd, 0x581/*WM_USER+385*/, 1, 0);
          ::SendMessage(hShellWnd, 0x550/*WM_USER+336*/, 0, 10001);
          ::SendMessage(hShellWnd, 0x579/*WM_USER+377*/, 0, 0);
          }

          ::SetWindowPos(hwnd, HWND_TOPMOST, X, Y, cx, cy, SWP_NOSIZE|SWP_SHOWWINDOW|SWP_DRAWFRAME);

          but it won't work,actually I think that "always on top off" code is not working..

          I 1 Reply Last reply
          0
          • R Rahul Vaishnav

            Thanks for your reply, I have tried this

            static HWND hShellWnd = ::FindWindow(_T("Shell_TrayWnd"), NULL);
            if(hShellWnd != NULL)
            {
            // Set taskbar always on top off
            ::SendMessage(hShellWnd, 0x2b1, 8, 0);
            ::SendMessage(hShellWnd, 0x581/*WM_USER+385*/, 1, 0);
            ::SendMessage(hShellWnd, 0x550/*WM_USER+336*/, 0, 10001);
            ::SendMessage(hShellWnd, 0x579/*WM_USER+377*/, 0, 0);
            }

            ::SetWindowPos(hwnd, HWND_TOPMOST, X, Y, cx, cy, SWP_NOSIZE|SWP_SHOWWINDOW|SWP_DRAWFRAME);

            but it won't work,actually I think that "always on top off" code is not working..

            I Offline
            I Offline
            Iain Clarke Warrior Programmer
            wrote on last edited by
            #5

            This is a bad idea... To quote Raymond Chen. "What if another program does this?" When they close, it will put back the taskbar how it found it, and you'd mysteriously stop working. Or worse, you'd close first, and mess *their* program up. Naughty programmer! Iain.

            R 1 Reply Last reply
            0
            • I Iain Clarke Warrior Programmer

              This is a bad idea... To quote Raymond Chen. "What if another program does this?" When they close, it will put back the taskbar how it found it, and you'd mysteriously stop working. Or worse, you'd close first, and mess *their* program up. Naughty programmer! Iain.

              R Offline
              R Offline
              Rahul Vaishnav
              wrote on last edited by
              #6

              I aggree with you, ;P but I have just tried weather it works or not.. I am also going through the link which you have provided but couldn't find any solution yet. :(

              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