Article View: comp.os.ms-windows.programmer.misc
Article #1626Re: Clock applet
From: Matthew Squires
Date: Thu, 15 Oct 1992 17:55
Date: Thu, 15 Oct 1992 17:55
27 lines
1698 bytes
1698 bytes
In article <1992Oct15.053454.8491@engage.pko.dec.com> marshall@tfh.enet.dec.com (Hunting the Snark) writes: >I would like to imitate an interesting property of the Clock applet in Windows >3.1 (I don't remember now if the one in 3.0 did this). When you select the "No >Title" setting, holding the left mouse button down in the clock window puts it >into the move mode the same as in the caption of of a normal window. How does >it do that? Is there an easy way (some undocumented windows fuction) or do they >do it "the hard way" (LbuttonDown, SetCapture, GetDC, MouseMove, etc.) Is it >significant that it only does this when there is no title bar? Yes, it's true! There is another undocumented windows function called "ImplementCoolClockBehaviorOnlyForMSApplications" that only we know about. Seriously, look up the WM_NCHITTEST message. If the user is clicking on your client area (found by calling DefWindowProc and noting its return value) then you would want to return HTCAPTION - i.e. windows should treat this click as if it happened on the title bar. There are other issues like handling double-clicks and you probably don't want to let the user move your window if it is maximized, but this should be enough to get you started. Matt "not a spokesbeing for microsoft" Squires mattsq@microsoft.com
Technical Details
Message-ID:
<1992Oct15.175501.22407@microsoft.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!microsoft!wingnut!mattsqReferences:
<1992Oct15.053454.8491@engage.pko.dec.com>Show Full Headers
Complete Article Headers
Newsgroups: comp.os.ms-windows.programmer.misc Path: arc1-ca.pugleaf.net!sparky!uunet!microsoft!wingnut!mattsq From: mattsq@microsoft.com (Matthew Squires) Subject: Re: Clock applet Message-ID: <1992Oct15.175501.22407@microsoft.com> Date: 15 Oct 92 17:55:01 GMT Organization: Microsoft Corporation References: <1992Oct15.053454.8491@engage.pko.dec.com> Lines: 27