Path: csiph.com!aioe.org!news.mixmin.net!news.unit0.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Karl-Heinz" Newsgroups: comp.lang.clipper.visual-objects Subject: Re: Month selector Date: Mon, 19 Dec 2016 08:58:16 +0100 Lines: 63 Message-ID: References: <5caec2e2-9b90-44d4-954e-fc4bfe7e8b68@googlegroups.com> <925b3451-498a-427e-b5ec-d923f868891e@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="utf-8"; reply-type=original Content-Transfer-Encoding: 8bit X-Trace: individual.net Dm/xnEncF7e22/W6+4FEQglZQJzkd8qOxK2uiSa3asz2a9zRM= Cancel-Lock: sha1:veAPnYUeLnPYef5md+cAodtSJ5I= In-Reply-To: <925b3451-498a-427e-b5ec-d923f868891e@googlegroups.com> X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 16.4.3564.1216 X-MimeOLE: Produced By Microsoft MimeOLE V16.4.3564.1216 Xref: csiph.com comp.lang.clipper.visual-objects:10084 Hi Sebastian, > > One last question, is there is any way to know if the user click on < >, > the year, or a month? > I have no idea why you need that, but here“s a quick shot ... BTW. The result shown in the owner caption should be one of the MCHT_xxx constants described here: https://msdn.microsoft.com/en-us/library/windows/desktop/bb760927(v=vs.85).aspx ------------- METHOD Dispatch(oEvent) CLASS BaseDateTimepicker LOCAL pnMHDR AS _winNMHDR LOCAL hMonthControl AS PTR LOCAL struMCHitTest IS _winMCHITTESTINFO LOCAL struPoint IS _winPoint DO CASE CASE oEvent:Message == WM_NOTIFY pnMHDR := PTR ( _CAST , oEvent:lParam ) IF pnMHDR._code == MCN_VIEWCHANGE .OR. pnMHDR._code == MCN_SELCHANGE hMonthControl := SendMessage(SELF:Handle() , DTM_GETMONTHCAL , 0 , 0L ) GetCursorPos ( @struPoint ) ScreenToClient (hMonthControl , @struPoint ) struMCHitTest.cbSize := _SIZEOF ( _winMCHITTESTINFO ) struMCHitTest.pt := struPoint SendMessage ( hMonthControl , MCM_HITTEST , 0 , LONG ( _CAST , @struMCHitTest ) ) SELF:owner:caption := NTrim ( struMCHitTest.uHit ) ENDIF ENDCASE RETURN SUPER:Dispatch(oEvent) ---------- regards Karl-Heinz