Click here to Skip to main content
15,036,363 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Printer Control Pin
Richard MacCutchan4-Sep-16 22:40
mveRichard MacCutchan4-Sep-16 22:40 
QuestionCustom Slider control messages cannot be caught Pin
AlbertB25-Aug-16 2:54
MemberAlbertB25-Aug-16 2:54 
AnswerRe: Custom Slider control messages cannot be caught Pin
Richard MacCutchan25-Aug-16 3:47
mveRichard MacCutchan25-Aug-16 3:47 
GeneralRe: Custom Slider control messages cannot be caught Pin
AlbertB25-Aug-16 4:39
MemberAlbertB25-Aug-16 4:39 
GeneralRe: Custom Slider control messages cannot be caught Pin
Richard MacCutchan25-Aug-16 4:59
mveRichard MacCutchan25-Aug-16 4:59 
GeneralRe: Custom Slider control messages cannot be caught Pin
AlbertB25-Aug-16 5:54
MemberAlbertB25-Aug-16 5:54 
GeneralRe: Custom Slider control messages cannot be caught Pin
Bram van Kampen27-Aug-16 16:23
MemberBram van Kampen27-Aug-16 16:23 
GeneralRe: Custom Slider control messages cannot be caught Pin
AlbertB27-Aug-16 17:30
MemberAlbertB27-Aug-16 17:30 
In stdafx.h:
#define IDM_SLIDER_CHANGE WM_USER+8


In the derived CRotarySlider class at a relevant point in my positioning calculation:
int iID = ::GetDlgCtrlID(::GetFocus());
GetParent()->SendMessage(IDM_SLIDER_CHANGE, iID, nPos);


In the Dialog class that the control is used in:

Added to the message map:
ON_MESSAGE(IDM_SLIDER_CHANGE, OnSliderChange)


And handler function:
LRESULT CGm36NewPatchDlg::OnSliderChange(WPARAM wParam, LPARAM lParam)
{
	switch (wParam)
	{

		case IDC_VOLUME:
		{
//			DO WHAT IS NEEDED
			break;
		}
		case IDC_GAIN:
		{
//			DO WHAT IS NEEDED
			break;
		}

//		ADD MORE AS REQUIRED

	}

	LRESULT lr = 0;
	return lr;
}


There are still aspects to tidy up which may not be best coding practice but that works at the moment.
GeneralRe: Custom Slider control messages cannot be caught Pin
leon de boer28-Aug-16 22:27
Memberleon de boer28-Aug-16 22:27 
GeneralRe: Custom Slider control messages cannot be caught Pin
AlbertB29-Aug-16 3:17
MemberAlbertB29-Aug-16 3:17 
GeneralRe: Custom Slider control messages cannot be caught Pin
leon de boer29-Aug-16 5:34
Memberleon de boer29-Aug-16 5:34 
AnswerRe: Custom Slider control messages cannot be caught Pin
Stephen Hewitt25-Aug-16 6:33
MemberStephen Hewitt25-Aug-16 6:33 
GeneralRe: Custom Slider control messages cannot be caught Pin
Bram van Kampen27-Aug-16 16:10
MemberBram van Kampen27-Aug-16 16:10 
GeneralRe: Custom Slider control messages cannot be caught Pin
Bram van Kampen27-Aug-16 16:15
MemberBram van Kampen27-Aug-16 16:15 
QuestionCEdit::SetHighlight Pin
AlecJames25-Aug-16 0:48
MemberAlecJames25-Aug-16 0:48 
QuestionRe: CEdit::SetHighlight Pin
Richard MacCutchan25-Aug-16 0:59
mveRichard MacCutchan25-Aug-16 0:59 
AnswerRe: CEdit::SetHighlight Pin
AlecJames25-Aug-16 3:49
MemberAlecJames25-Aug-16 3:49 
AnswerRe: CEdit::SetHighlight Pin
Jochen Arndt25-Aug-16 2:01
professionalJochen Arndt25-Aug-16 2:01 
GeneralRe: CEdit::SetHighlight Pin
Richard MacCutchan25-Aug-16 2:41
mveRichard MacCutchan25-Aug-16 2:41 
GeneralRe: CEdit::SetHighlight Pin
leon de boer25-Aug-16 3:15
Memberleon de boer25-Aug-16 3:15 
GeneralRe: CEdit::SetHighlight Pin
AlecJames25-Aug-16 3:54
MemberAlecJames25-Aug-16 3:54 
GeneralRe: CEdit::SetHighlight Pin
Jochen Arndt25-Aug-16 5:14
professionalJochen Arndt25-Aug-16 5:14 
GeneralRe: CEdit::SetHighlight Pin
leon de boer25-Aug-16 15:36
Memberleon de boer25-Aug-16 15:36 
GeneralRe: CEdit::SetHighlight Pin
AlecJames26-Aug-16 0:10
MemberAlecJames26-Aug-16 0:10 
QuestionHow to test a synchronization object for lock? Pin
Krishnakumartg18-Aug-16 19:02
MemberKrishnakumartg18-Aug-16 19:02 

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.