Resize desktop in c#.net?



  • Thought this would be a good place to ask:



    I'm writing an rss ticker in c#.net, and want to know how I can resize
    the desktop area that's "usable" by other windows. For example, if you
    autohide the start-bar, then the usable desktop area expands, and
    maximsed windows take up the space where the task bar already was. Is
    there a way of altering this so that I can put a thin window that's
    docked to some part of the screen, and no window will maximize over
    this?



    Thanks :)



  • To keep other windows from maximizing over your window, take your
    parent form and set the AlwaysOnTop property to true. As far as forcing
    other windows to conform to some size constraint that you specify, I
    don't think it's possible short of changing the resolution of the
    desktop, but that's not really what you want, is it?






  • @growse said:

    Thought this would be a good place to ask:



    I'm writing an rss ticker in c#.net, and want to know how I can resize
    the desktop area that's "usable" by other windows. For example, if you
    autohide the start-bar, then the usable desktop area expands, and
    maximsed windows take up the space where the task bar already was. Is
    there a way of altering this so that I can put a thin window that's
    docked to some part of the screen, and no window will maximize over
    this?



    Thanks :)




    You need to revert to the Win32 API function SHAppBarMessage (this is
    how the task bar works). Also, for using the Win32 API from C#, see the
    .NET docs on PInvoke().



    Ken


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.