You can’t globally reserve screen space; you can put up signs, but if somebody ignores the sign you’ll have to decide how to respond


A customer sent the following question with the rather unhelpful subject line Need Help. They're not just looking for help; they're looking for Help with a capital H.

We want to make something like an appbar, but without some of the limitations of appbars. For example, like an appbar, we want applications to avoid using the edge of the screen. The section of the screen the window appears on should be "mine"; nobody else should be permitted to use it. The window should always be on top; nothing should be able to cover it. For example, Internet Explorer in fullscreen (F11) mode should not cover our window; it should go behind.

In other words, you want to create a window that is never covered by any other windows, not even other topmost windows. There are two groups fighting over the same thing. One of them will lose. That loser is you.

Everquest/PowerPoint/Picasa/etc team: "I want to cover the screen."

You: "I want to prevent programs from covering the screen."

Everquest/PowerPoint/Picasa/etc team: "I want to cover the screen, even if there is a program that wants to prevent me from covering the screen."

You: "I want to prevent programs from covering the screen, even if there is a program that is overriding my attempt to prevent them from covering the screen."

Everquest/PowerPoint/Picasa/etc team: "I want to cover the screen, even if there is a program that wants to prevent me from overriding their attempt to prevent me from covering the whole screen."

You: "Infinity!"

Everquest/PowerPoint/Picasa/etc team: "Infinity plus one!"

Creating an appbar says, "If you want to maximize your window, use the part of the screen that I'm not using." But if a program creates a window of size SM_CXVIRTUALSCREEN by SM_CYVIRTUALSCREEN, then it has done it and what are you going to do? You can't prevent them from doing it, but you can make your wishes known and respond intelligently when they choose to ignore you.

You can build a sign that says "no trespassing" but that doesn't prevent people from trespassing. If somebody walks onto your property right past your "no trespassing" sign, then they have done it and now you have to decide what action you're going to take in response.

Comments (41)
  1. John says:

    "You can build a sign that says "no trespassing" but that doesn’t prevent people from trespassing. If somebody walks onto your property right past your "no trespassing" sign, then they have done it and now you have to decide what action you’re going to take in response."

    That’s easy; I’m going to shoot that person in the face (assuming I live in Texas).

  2. someone else says:

    So we should shoot programs that trespass on our screen space? (In the USA, of course. Elsewhere, we just call the screen police like a civilized person.)

  3. Someone You Know says:

    "Elsewhere, we just call the screen police like a civilized person."

    Screen police? You mean the MPAA?

  4. Karellen says:

    "We want to make something like an appbar, but without some of the limitations of appbars.

    The section of the screen the window appears on should be "mine"; The window should always be on top;"

    My first response to this would be "Why? What are you doing that cannot accomodate appbars’ limitations?"

    The whole question gives me the heebie jeebies. It makes me think of nightmarish adware or nagware that actively tries to get in the users way, and in a variety of sneaky ways resists being closed, shutdown, killed or uninstalled.

    Better that the authors writing such software get as little help as possible, IMHO.

  5. tgrand says:

    C’mon, you know it was another team within MS. :)

  6. for Karellen says:

    Or it is a team of internal corporate software who has thousands legitimate reasons to do it.

  7. tekumse says:

    John, I hope you didn’t buy you ammunition from Steel Hawk (http://www.theonion.com/content/video/manufacturer_recalls_hollow_point)

  8. Xepol says:

    There are no software scenarios where this request results in something considered "good" by the end user.

    When someone wants to reserve screen realestate, it is almost always used for displaying banner ads no one wants to see.

    Sure, it might be used for something as useful as to sponser something like free dialup internet, but still, no one really WANTS to loose part of their screen for that.  

    Actually, a local company did exactly that for a while.  I believe they died since the only people willing to suffer the experience were those who could not afford internet for 20$ a month themselves.  Sooner or later you either have to admit to your advertizers that their target market is broke, or they figure it out themselves.  Either way, the end result is the same – no advertizers paying the bills.

    The other use of screen hogging is invasive malware just out to make your life suck worse than having to read endless advertizing banners.

  9. Joseph Koss says:

    Screen hogging can be productive..

    Accessibility features are a good candidate (the XP magnifier comes to mind)

  10. Leo Petr says:

    If this is to do with kiosk design, there’s a better solution.

    Create a virtual machine that can only run a web browser. Create a kiosk machine that can only run the screen bar and the virtual machine. Voila! You have a screen bar that can never be overridden.

  11. CoMargo says:

    Isn’t it possible to do such ugly things using Window Hooks?

    (I don’t have MSDN in front of me, also I’m getting my dinner right now, so I’m lazy to search the information right now)

  12. bob says:

    What about letting the user decide? Force an app to register permission for use of full app space, or register permission to be top-most. When the app starts for the first time the user is prompted whether they want to allow this app the requested permission. Similar to how firewalls ask users whether they want a particular app to communicate the first time it is attempted.

  13. Alexandre Grigoriev says:

    Leo Petr,

    Kiosk if by definition a controlled environment. You don’t need any ugly kludges to make your program interoperate with limited number of possible peers.

  14. William says:

    Re: bob

    What about letting the user decide? Force an app to register permission for use of full app space, or register permission to be top-most.

    Then you have to store that somewhere (probably the registry) and you face the problem discussed many times before — how do you stop a program running as the user from mucking around without permission? The answer is you can’t so it’s better not to have the option/configuration.

  15. MarkKB says:

    Shouldn’t he just use set the working area to not cover his appbar (i.e. SystemParametersInfo with SPI_SETWORKAREA)? That sounds like basically what he wants.

  16. steveshe says:

    First, the real police are just as helpful as the screen police. They don’t do anything to prevent or stop crimes, they simply document the crime so that action can be taken against the transgressor later. Unfortunately in this case your screen real estate has already been violated and ther is nothing to be done. Kind of like when the guy break into your house and rapes your wife, a police report documenting the event is little comfort in those circustances. This is why it’s handy to be able to shoot people under certain circumstances.

    Second, even in Texas there are rules for shooting people. It’s generally inadvisable to shoot people outside your property, in the daylight or when they do not represent a direct threat to you. However, you’d be wise not to bank to heavily on those rules lest you run into someone Like Joe Horn:

    http://en.wikipedia.org/wiki/Joe_Horn_shooting_controversy

    IMHO, good on Joe and death to criminals.

  17. MS says:

    With a subject line like "Need Help," I expect it to be something dire enough to warrant it.  It should be something like: "Need help; I am on fire" or "Need help; stuck on desert island" or "Need help; BEES!"

    @steveshe, sure, because the value of human life is miniscule when you’re a libertarian

  18. Simon Cooke says:

    Sure you can reserve the screenspace.

    Write a driver shim that sits between Windows and the actual video drive.

    (A company in Seattle was doing this at one point. Fortunately they went out of business. Their idea was to steal a chunk of your screen real-estate and ship with OEMs; they’d show advertising, and you (the end user) would be unable to uninstall it).

    Pure evil. Don’t do it.

  19. someone else says:

    “With a subject line like "Need Help," I expect it to be something dire enough to warrant it.  It should be something like: "Need help; I am on fire" or "Need help; stuck on desert island" or "Need help; BEES!"”

    It was! Someone was trespassing on their screen space!

  20. MadQ says:

    @John: Federal Aviation Regulations supersede ALL other laws. The FARs make it very clear that any unpowered aircraft may legally land wherever it happen to land. So if I jump out of a plane and land my parachute on your lawn, it’s not trespassing, and shooting me would be murder. Even in Texas. In ya face infinity!!!1!!

  21. another texan says:

    Scary.  I had the same thought as first responder John, even before I read any of the comments!  FWIW, my response was going to be something like: "That’s easy.  Here in Texas, we just shoot them."

  22. Duke of New York says:

    In the next chapter of the story, this developer’s company reports Microsoft to the EC antitrust authorities. Obviously by not allowing a program to designate itself "the most important program in the universe," Microsoft is restraining competition and limiting consumer choice.

  23. Igor Levicki says:

    I would so like to get rid of both groups in a very violent manner.

  24. Duke of New York says:

    "When the app starts for the first time the user is prompted whether they want to allow this app the requested permission."

    Program: "Give me this region of the screen!"

    Windows: "The user has refused permission."

    Program: "I’m important! Prompt the user again!"

    Windows: "The user has chosen to auto-refuse the permission."

    Program: "I’m important! Override and prompt the user again!"

    Besides, haven’t we learned what customers think of being prompted all the time about mundane actions?

  25. Maurits says:

    Frankly I don’t see the problem.  It seems perfectly reasonable to create a concept of heirarchical topmost-ness, and even a set of guidelines as to which part of the heirarchy to consider yourself in.

    // dwIndex is a measure of how urgently the HWND wants to be topmost (or bottom-most)

    // windows have a meta-Z-order of 0 by default

    // "top-most" windows have order 1 or greater

    // "bottom-most" windows have order -1 or greater

    //

    // full-screen games are recommended to use order 50

    // on-screen displays are recommended to use order 100

    // advertisements are recommended to use order -32767

    HRESULT SetMetaZOrder(HWND hWnd, INT32 dwIndex);

  26. configurator says:

    Maurits: If it’s an INT32, why -32767? That seems arbitrary.

  27. Duke of New York says:

    You would have to be incredibly naive to think that developers will follow such things as "guidelines" and "recommendations" when it is in their immediate interest to ignore them.

    "Then Microsoft can just disable the applications caught breaking the rules!"

    No, because developers would report that as a bug in Windows and a possible basis for an antitrust complaint.

  28. Guest says:

    I wonder if there is an internal fight within Microsoft between managers who think that every customer wish should be satisfied and those who think that doing such evil things shouldn’t be allowed…

  29. The Imp says:

    Er, doesn’t the most recent window to ask to be on-top become the one that is topmost among the always-on-tops?

    If so, then wouldn’t the obvious solution be to just have a loop where you instantly un-set and re-set the always-on-top window status every second or so?

    A very bad idea, I’ll agree. But hardly a difficult problem (unless I’m quite wrong).

  30. The Imp says:

    @Guest

    There is no such argument, I’ll bet; but rather, there are two sets of managers who each think that every customer wish should be satisfied.

    But the disagreement would be: who are our customers; the developers or the end-users?

    (In actual fact, it seems more likely that there are more than two such types of managers, most of which would be moderates of various degrees in either direction.)

  31. bla says:

    @The Imp

    If so, then wouldn’t the obvious solution be to just have a loop where you instantly un-set and re-set the always-on-top window status every second or so?

    Very bad idea indeed.

    It would be hilarious or cringe worthy to see 2 applications do that.

  32. Larry Lard says:

    @MadQ: I wouldn’t like to be the one using Federal regulations to make my case in Texas…

  33. MadQ says:

    I never claimed it would be very wise. I was just showing off that I know my FARs. Although I really  only care about FAR part 105 (which covers the jumping-out-of-a-plane stuff.)

  34. Michael G says:

    When someone wants to reserve screen realestate, it is almost always used for displaying banner ads no one wants to see.

    That was my thought too.

    So once upon a time, a friend had a FreePC that came with software that displayed ads on the right hand of the screen. He just adjusted the analog monitor settings to stretch and move the screen so the ads were off the edge.

    I guess that doesn’t work so well in the world of LCD monitors, but just try to stop my DIY construction-paper ad blocker. :)

  35. A number of commenters seem to have missed what I think is the fundamental point of Raymond’s post [no change there, then], which seems to me to be obvious by dint of Raymond’s choice of example applications competing with the dodgy application: Everquest, PowerPoint and Picasa.

    Everquest: the user wants it to take up the whole screen because it’s a game.

    PowerPoint: the user wants it to take up the whole screen because they’re giving a presentation.

    Picasa: the user wants it to take up the whole screen because they’re looking at a slideshow.

    All the responses suggesting strategy X or rationale Y or user-configurable option Z for achieving that goal which the original customer sought seem to be missing the point: if the user wants an application to run full-screen, full-screen it is – indeed, full-screen it must be.

    The circumstances under which a user would want to show a PowerPoint presentation, for example, whilst a component from a completely unrelated application consumed part of the display, must be so uncommon as to not be worth considering.

  36. bob says:

    Indeed, but obviously it could be done. Some of the responses to my post missed the point.

    The application would not be able to continuously force the prompt. Once the user has answered the prompt the chosen setting would be fixed and used in future.

    Think of firewall rule popups that appear when an application attempts to connect to a remote host for the first time.

    If the user has chosen “No I don’t want this application to have fullscreen access” or “No I don’t want this application to sit on top”  then it won’t be allowed to and the user will not be prompted again.

    I agree there is little use of this re Nick’s point, but in principle it would work much like a UAC prompt.

    [The program wouldn’t bother with the prompt. At install time, it would write “FullScreenAccess=TRUE” to the registry in the same place the prompt would have written it. In the same way programs can add firewall exceptions without prompting the user. -Raymond]
  37. Random Commenter 432167 says:

    At my place of employment, the de facto standard is to use title-case for email subjects. The most prominent competing standard is the everything-lowercase approach.

    This is apparently contrary to Raymond’s experience.

  38. bob says:

    Or in the same way an application could write UACAccess=TRUE to the registry.

  39. Duke of New York says:

    "The application would not be able to continuously force the prompt."

    If the application couldn’t force the prompt, then some developer making the Most Important Program in the Universe would ask how to force it or bypass it, and we’d be right back where this started.

    In the obscure case where a user really wants to let two Very Important Programs share the screen, the user can set one of them to frame mode and resize it accordingly.

  40. Random Commenter 432167 says:

    Sorry Raymond. In retrospect, you probably meant that purely as humor. It just struck me odd for some reason.

    *sits down to reflect*

Comments are closed.