Click here to Skip to main content
15,894,405 members
Home / Discussions / C#
   

C#

 
GeneralRe: TimeSpan Error?? Pin
Kevin Marois17-Aug-15 5:25
professionalKevin Marois17-Aug-15 5:25 
GeneralRe: TimeSpan Error?? Pin
Ravi Bhavnani17-Aug-15 5:35
professionalRavi Bhavnani17-Aug-15 5:35 
GeneralRe: TimeSpan Error?? Pin
Matt T Heffron17-Aug-15 6:55
professionalMatt T Heffron17-Aug-15 6:55 
GeneralRe: TimeSpan Error?? Pin
Richard Deeming17-Aug-15 7:10
mveRichard Deeming17-Aug-15 7:10 
QuestionWhy don't I see a VSTO template Pin
Gary Huck14-Aug-15 9:47
Gary Huck14-Aug-15 9:47 
AnswerRe: Why don't I see a VSTO template Pin
Richard MacCutchan14-Aug-15 20:49
mveRichard MacCutchan14-Aug-15 20:49 
Question(Solved) How to send a message from a rich text box control to a form Pin
Leif Simon Goodwin14-Aug-15 0:56
Leif Simon Goodwin14-Aug-15 0:56 
AnswerRe: How to send a message from a rich text box control to a form Pin
Arthur V. Ratz14-Aug-15 2:08
professionalArthur V. Ratz14-Aug-15 2:08 
You actually don't need to override WndProc callback in your RichEdit control class. Really, You have to declare and send a notify message as follows:
C++
#define EN_MYMSG1 (WM_USER + 200)
C++
NMHDR nmhdr;
::ZeroMemory((LPVOID)&nmhdr, sizeof(NMHDR));

nmhdr.hwndFrom = hRichEditWnd;
nmhdr.idFrom = IDC_MYRICHEDIT;
nmhdr.code = EN_MYMSG;

::SendMessage(hWndView, WM_NOTIFY, (WPARAM)nmhdr.idFrom, (LPARAM)&nmhdr);
And then, process this message by handling WM_NOTIFY in your parent window class using whatever predefined MFC message map macros or overriding WndProc callback method:
C++
ON_NOTIFY(EN_MYMSG, IDC_MYRICHEDIT, OnMyMessage)
or
C++
ON_NOTIFY_REFLECT(EN_MYMSG, OnMyMessage)

C++
afx_msg void OnMyMessage(NMHDR* pnmhdr , LRESULT* pResult);

C++
void CMyWnd::OnMyMessage(NMHDR* pnmhdr, LRESULT* pResult)
{
   if (pnmhdr->code == EN_MYMSG)
   {
       // Place your message handling code here
   }
   *pResult = 0;
}

C++
LRESULT CALLBACK CMyWnd::WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) 
{    
        switch(message)
        {
              case WM_NOTIFY: 
              NMHDR* pnmhdr = &(NMHDR)message.GetLParam(typeof(NMHDR));
              if (pnmhdr->code == EN_MYMSG)
              {
                  // Place your message handling code here
              }
              break;
              default: break;
        }
        return WndProcDefault(hWnd, uMsg, wParam, lParam);
}

That's all Smile | :)

modified 14-Aug-15 8:19am.

SuggestionRe: How to send a message from a rich text box control to a form Pin
Richard Deeming14-Aug-15 3:18
mveRichard Deeming14-Aug-15 3:18 
GeneralRe: How to send a message from a rich text box control to a form Pin
Leif Simon Goodwin14-Aug-15 3:27
Leif Simon Goodwin14-Aug-15 3:27 
GeneralRe: How to send a message from a rich text box control to a form Pin
Arthur V. Ratz14-Aug-15 3:36
professionalArthur V. Ratz14-Aug-15 3:36 
GeneralRe: How to send a message from a rich text box control to a form Pin
Arthur V. Ratz14-Aug-15 3:30
professionalArthur V. Ratz14-Aug-15 3:30 
GeneralRe: How to send a message from a rich text box control to a form Pin
Leif Simon Goodwin14-Aug-15 3:43
Leif Simon Goodwin14-Aug-15 3:43 
GeneralRe: How to send a message from a rich text box control to a form Pin
Arthur V. Ratz14-Aug-15 3:59
professionalArthur V. Ratz14-Aug-15 3:59 
GeneralRe: How to send a message from a rich text box control to a form Pin
Arthur V. Ratz14-Aug-15 6:30
professionalArthur V. Ratz14-Aug-15 6:30 
GeneralRe: How to send a message from a rich text box control to a form Pin
Member 1144608014-Aug-15 18:24
Member 1144608014-Aug-15 18:24 
QuestionRuntime Form Designer Pin
Member 1144608014-Aug-15 0:00
Member 1144608014-Aug-15 0:00 
QuestionGo to Next Items of List box using timer in C# Pin
Member 1190306213-Aug-15 20:55
Member 1190306213-Aug-15 20:55 
AnswerRe: Go to Next Items of List box using timer in C# Pin
Wendelius13-Aug-15 21:01
mentorWendelius13-Aug-15 21:01 
AnswerRe: Go to Next Items of List box using timer in C# Pin
OriginalGriff13-Aug-15 22:04
mveOriginalGriff13-Aug-15 22:04 
GeneralRe: Go to Next Items of List box using timer in C# Pin
Member 1190306214-Aug-15 0:04
Member 1190306214-Aug-15 0:04 
GeneralRe: Go to Next Items of List box using timer in C# Pin
OriginalGriff14-Aug-15 0:28
mveOriginalGriff14-Aug-15 0:28 
GeneralRe: Go to Next Items of List box using timer in C# Pin
Member 1190306214-Aug-15 2:06
Member 1190306214-Aug-15 2:06 
GeneralRe: Go to Next Items of List box using timer in C# Pin
OriginalGriff14-Aug-15 2:27
mveOriginalGriff14-Aug-15 2:27 
GeneralRe: Go to Next Items of List box using timer in C# Pin
Member 1144608014-Aug-15 18:28
Member 1144608014-Aug-15 18:28 

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.