From: William on 16 May 2007 09:27 Env: WindowsXP, VC+6.00, MFC I need to add some processing just when up/down arrow is clicked. From ClassWazard, the only message I can use is UDN_DELTAPOS. Inside OnDeltaposSpin(), I need to know which button between up or down arrow is clicked because I have to get the position after up or down arrow is clicked(NOT the current position of a spin button control. But I don't know how. Please help. TIA William
From: David Ching on 16 May 2007 09:40 "William" <port(a)mx15.freecom.ne.jp> wrote in message news:%23kn$837lHHA.4848(a)TK2MSFTNGP05.phx.gbl... > Env: WindowsXP, VC+6.00, MFC > > I need to add some processing just when up/down arrow is clicked. > From ClassWazard, the only message I can use is UDN_DELTAPOS. > > Inside OnDeltaposSpin(), I need to know which button between up or down > arrow is clicked because I have to get the position after up or down arrow > is clicked(NOT the current position of a spin button control. > How about: void CTrimWaveDlg::OnSpinDeltaPos(NMHDR* pNMHDR, LRESULT* pResult) { NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR; if (pNMUpDown->iDelta > 0) { // Up button clicked } else { // Down button clicked } } Note that due to the funky way Up/Down is defined, the logic above might need to be reversed (some spin controls have up arrow increasing, and others have it decreasing). -- David
From: William on 16 May 2007 10:20 Thanks David. William > How about: > > void CTrimWaveDlg::OnSpinDeltaPos(NMHDR* pNMHDR, LRESULT* pResult) > { > NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR; > > if (pNMUpDown->iDelta > 0) > { > // Up button clicked > } > else > { > // Down button clicked > } > } > > > Note that due to the funky way Up/Down is defined, the logic above might > need to be reversed (some spin controls have up arrow increasing, and > others have it decreasing). > > -- David > >
|
Pages: 1 Prev: CMap and struct Next: Assert in afxwinforms.inl @ line 188 |