Announcement

Collapse
No announcement yet.

Closing a Folder Window instead of Task

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Closing a Folder Window instead of Task

    I've noticed that while sending %WM_CLOSE or %WM_QUIT
    messages using the API SendMessage closes applications,
    it does not appear to close windows that are merely open
    folders (directories).

    The syntax I'm using is

    SendMessage sHandle, %WM_CLOSE, 0, 0
    SendMessage sHandle, %WM_QUIT, 0, 0

    where of course, sHandle is the handle of the window I want to close.

    As I mentioned, this works fine if sHandle is a running task, but does not
    seem to do anything if sHandle is an open folder.
    Anyone know what I'm doing wrong, or more specifically, does
    anyone know what one needs to do to close windows that are
    open folders, rather than executing programs?

    NB: This behavior does not seem to be consistant across the Windows
    platforms I've tested.

    Will close a Folder in Win 95 OSR2

    Will NOT close a Folder in Win 98SE, Win ME or Win2K


    [This message has been edited by Michael Burns (edited November 07, 2000).]
    Michael Burns

  • #2
    After further tests, I seem to have this result

    Close a folder window by sending a %WM_CLOSE or %WM_QUIT?
    Code:
               Folder Window Close Method           Task Close Method
    OS            SendMessage    PostMessage    SendMessage    PostMessage
    Win 95 OSR2       Yes            No             Yes            Yes
    Win 98SE           No            Yes            Yes            Yes
    Win ME             No            Yes            Yes            Yes
    Win2K              No            Yes            Yes            Yes

    While having to determine the OS before closing the Window is not
    difficult, I'd sure like to understand why Win 95 OSR2 behaves differently.
    Also, I noticed that closing a MS-DOS window with nothing running in it gives
    unstable results.




    [This message has been edited by Michael Burns (edited November 08, 2000).]
    Michael Burns

    Comment

    Working...
    X