1. #1

    Join Date
    Feb 2012
    Posts
    2,094
    Blog Entries
    7

    An interesting glitch restores timedate.cpl window when it's minimized

    A friend pointed this out to me yesterday.
    It seems to work in all versions of Windows (we tested it on Vista, 7, 8, 8.1, and 10)

    Open up several programs.
    Open up timedate.cpl (you can do this by right clicking on the clock in the lower right corner and select "Adjust date/time"
    Minimize all windows (I click on the thing to the right of the clock to minimize everything.
    Click on one of the active icons in the task bar (to restore that program's window).
    The timedate.cpl window will also be restored. AFAIK, it doesn't happen with any other window(s).

    Can't figure out why this would be by design.
    Any thoughts on why it's happening?


    • Ad Bot

      advertising
      Beep.

        
       

  2. #2
    niemiro's Avatar
    Join Date
    Mar 2012
    Location
    District 12
    Posts
    7,993

    Re: An interesting glitch restores timedate.cpl window when it's minimized

    I'll have to get back to you on this (on phone so can't check), but I'm 99% sure this is completely by design and won't occur with just timedate.cpl but all modal dialogs. It's also because you are using the minimise all button - the same won't happen if you minimise everything individually.
    usasma says thanks for this.

  3. #3

    Join Date
    Feb 2012
    Posts
    2,094
    Blog Entries
    7

    Re: An interesting glitch restores timedate.cpl window when it's minimized

    Thanks Richard! I'm uncertain what modal Windows are, but we've tried it with other things in the taskbar and didn't get similar results.
    Did not try with other .cpl windows tho' - may try that at work today.
    Haven't tried with minimizing individually, but again - may be able to try it at work today.

  4. #4
    niemiro's Avatar
    Join Date
    Mar 2012
    Location
    District 12
    Posts
    7,993

    Re: An interesting glitch restores timedate.cpl window when it's minimized

    Quote Originally Posted by usasma View Post
    Thanks Richard! I'm uncertain what modal Windows are, but we've tried it with other things in the taskbar and didn't get similar results.
    Did not try with other .cpl windows tho' - may try that at work today.
    Haven't tried with minimizing individually, but again - may be able to try it at work today.
    Here's a little test case for you:

    Close all of your current windows (actually, this is technically not necessary but may make things easier to see if you can) and do the following:

    Open a new notepad window. Type a few random characters, then open a second notepad window.
    Use the minimise all button to bottom right hand corner of screen, then use the taskbar to reopen the second notepad window. You should see just the second notepad window reappear.

    Now close both windows and try again - open a first notepad window, type a few random characters, then click the red x to close it. Leave the Save/Don't Save/Cancel prompt on screen.
    Now open a second notepad window, then use the minimise all button to minimise all windows. Then use the taskbar to reopen the second window, and you should find that both reappear.


    This is because the first window now has a modal dialog in front of it. The Save/Don't Save/Cancel window forces interaction with it before you can return to the main window. In other words, if you try to click on File in the first window with the Save/Don't Save dialog still open, it'll just flash at you. That's a modal dialog.


    One of the advantages with this setup is that if you ever lose a modal dialog somewhere underneath a million and one other windows, and the window you're currently trying to interact with just keeps on flashing, you can get out of this situation by minimising all, then opening and re-minimising any random window from your taskbar. This will now leave on your screen only modal dialog windows - and you can then clear the message and return to work.

    Now, I have yet to fully figure out why timedate.cpl is acting as though modal. It's running under process rundll32.exe and in essence it's progmatically modal only. As far as I can see there is no physical graphical window (not even the task bar/explorer.exe/dwm.exe/anything) which physically flashes. However, as a programmer I know that the formal definition of a parent window has absolutely nothing to do with what's displayed on screen. It's very possible to create windows which aren't ever displayed. So - and I have yet to figure out the precise details of how - rundll32.exe seems to be invoking timedate.cpl in such a way that it is a modal dialog of a non-physical parent window.


    As an aside, I once saw a really, really excellent description of why it is that modal windows are designed like this. Someone on Stack Overflow had a fantastic explanation for why it is we can't be allowed to interact with a main window underneath a modal one. Something about the message queue getting out of horribly out of sync unless a certain vital optimisation was taken out. Hence the parent window can't allow interaction, no matter how backwards that may seem. Or something like that. I'll see if I can find it sometime.

    On similar lines, Windows Internals explains why modal dialog window functions often become inactive after initiating and then cancelling a shutdown operation.

    Richard
    usasma and Go The Power say thanks for this.

  5. #5

    Join Date
    Feb 2012
    Posts
    2,094
    Blog Entries
    7

    Re: An interesting glitch restores timedate.cpl window when it's minimized

    Haven't had a chance to check this out yet, but I do have a question.

    If I understand correctly, the modal window can be invisible?

    I'll have a look in Windows Internals to see about modal dialogs - I haven't re-read it recently.

    Thanks for taking the time to explain this.

  6. #6
    niemiro's Avatar
    Join Date
    Mar 2012
    Location
    District 12
    Posts
    7,993

    Re: An interesting glitch restores timedate.cpl window when it's minimized

    Quote Originally Posted by usasma View Post
    Haven't had a chance to check this out yet, but I do have a question.

    If I understand correctly, the modal window can be invisible?

    I'll have a look in Windows Internals to see about modal dialogs - I haven't re-read it recently.

    Thanks for taking the time to explain this.
    I'm sort of doing this off the top of my head - haven't had a chance to check yet either, but I don't think the modal window can be, but I think that a modal window's parent can be.
    usasma says thanks for this.

Similar Threads

  1. Window 7 64-bit Window Update error 80070002
    By urban1937 in forum Windows Update
    Replies: 9
    Last Post: 02-04-2014, 04:46 AM
  2. [SOLVED] [Java] Simple Count Glitch
    By AoN in forum Programming
    Replies: 9
    Last Post: 07-11-2013, 10:06 AM
  3. Replies: 0
    Last Post: 09-21-2012, 11:07 PM
  4. Microsoft restores Xbox Live service
    By zigzag3143 in forum News You Can Use
    Replies: 0
    Last Post: 07-08-2012, 06:59 AM

Log in

Log in