Click here to Skip to main content
15,888,803 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionSpin control , it's possible to know when the control is released? Pin
timbk29-Nov-10 16:05
timbk29-Nov-10 16:05 
AnswerRe: Spin control , it's possible to know when the control is released? Pin
Code-o-mat30-Nov-10 1:56
Code-o-mat30-Nov-10 1:56 
GeneralRe: Spin control , it's possible to know when the control is released? Pin
timbk30-Nov-10 8:33
timbk30-Nov-10 8:33 
GeneralRe: Spin control , it's possible to know when the control is released? Pin
Code-o-mat30-Nov-10 8:43
Code-o-mat30-Nov-10 8:43 
GeneralRe: Spin control , it's possible to know when the control is released? Pin
timbk30-Nov-10 9:29
timbk30-Nov-10 9:29 
GeneralRe: Spin control , it's possible to know when the control is released? Pin
Code-o-mat30-Nov-10 10:10
Code-o-mat30-Nov-10 10:10 
GeneralRe: Spin control , it's possible to know when the control is released? Pin
timbk30-Nov-10 10:18
timbk30-Nov-10 10:18 
GeneralRe: Spin control , it's possible to know when the control is released? Pin
Code-o-mat30-Nov-10 10:33
Code-o-mat30-Nov-10 10:33 
This might be re-inventing the wheel but try this:
class CMySpin: public CSpinButtonCtrl
{
protected:
  DECLARE_MESSAGE_MAP()
  afx_msg void OnCaptureChanged(CWnd *pWnd);
};


and the implementation:
BEGIN_MESSAGE_MAP(CMySpin, CSpinButtonCtrl)
  ON_WM_CAPTURECHANGED()
END_MESSAGE_MAP()

void CMySpin::OnCaptureChanged(CWnd *pWnd)
{
  CSpinButtonCtrl::OnCaptureChanged(pWnd);
  if (pWnd != this) 
  {
    NMHDR NMHdr;
    NMHdr.code      = NM_RELEASEDCAPTURE;
    NMHdr.hwndFrom  = m_hWnd;
    NMHdr.idFrom    = GetDlgCtrlID();
    GetParent()->SendMessage(WM_NOTIFY, NMHdr.idFrom, (LPARAM)&NMHdr);
  }
}

use a CMySpin as a control variable for your spin button in your dialog. (You might need to modify the code to compile under VS6, don't know what has changed since VS6)
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
>Nothing is free in the universe.<

GeneralRe: Spin control , it's possible to know when the control is released? Pin
timbk30-Nov-10 12:04
timbk30-Nov-10 12:04 
AnswerSolved: Spin control , it's possible to know when the control is released? Pin
timbk30-Nov-10 15:16
timbk30-Nov-10 15:16 
GeneralRe: Solved: Spin control , it's possible to know when the control is released? Pin
Code-o-mat30-Nov-10 21:46
Code-o-mat30-Nov-10 21:46 
GeneralRe: Solved: Spin control , it's possible to know when the control is released? Pin
Code-o-mat30-Nov-10 21:46
Code-o-mat30-Nov-10 21:46 
QuestionNew'ing a pointer to an array [Solved] Pin
Skippums29-Nov-10 7:36
Skippums29-Nov-10 7:36 
AnswerRe: New'ing a pointer to an array Pin
«_Superman_»29-Nov-10 7:53
professional«_Superman_»29-Nov-10 7:53 
GeneralRe: New'ing a pointer to an array Pin
Skippums29-Nov-10 8:02
Skippums29-Nov-10 8:02 
GeneralRe: New'ing a pointer to an array [modified] Pin
«_Superman_»29-Nov-10 8:34
professional«_Superman_»29-Nov-10 8:34 
GeneralRe: New'ing a pointer to an array Pin
Skippums29-Nov-10 9:18
Skippums29-Nov-10 9:18 
GeneralRe: New'ing a pointer to an array Pin
«_Superman_»29-Nov-10 9:20
professional«_Superman_»29-Nov-10 9:20 
GeneralRe: New'ing a pointer to an array Pin
Skippums29-Nov-10 9:34
Skippums29-Nov-10 9:34 
GeneralRe: New'ing a pointer to an array Pin
«_Superman_»29-Nov-10 9:36
professional«_Superman_»29-Nov-10 9:36 
QuestionRestrict SDI to Resize Pin
john563229-Nov-10 3:37
john563229-Nov-10 3:37 
AnswerRe: Restrict SDI to Resize Pin
Cedric Moonen29-Nov-10 4:14
Cedric Moonen29-Nov-10 4:14 
GeneralRe: Restrict SDI to Resize Pin
john563229-Nov-10 4:36
john563229-Nov-10 4:36 
GeneralRe: Restrict SDI to Resize Pin
User 74293381-Dec-10 1:07
professionalUser 74293381-Dec-10 1:07 
Question/MT Problem. Pin
gothic_coder29-Nov-10 2:37
gothic_coder29-Nov-10 2:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.