Please l need help on how i can send message to WM_NOTIFY case in my program. l want when a button is clicked(as in the case WM_CoMMAND below), the SendMessage function activates case WM_NOTIFY so that the codes inside the WM_NOTIFY case will run.
l had tried my best but l only get unhandled exception error messages.
snippet below;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
case WM_COMMAND:
wmId = LOWORD(wParam);
wmEvent = HIWORD(wParam);
// Parse the menu selections:
switch (wmId)
{
case IDC_NEXTBTN:
QueNo++;
SendMessage(hWnd,WM_NOTIFY,(int)IDC_NEXTBTN,(NMHDR)lParam);//here l cast wparam to int and wparam to (NMHDR) according to msdn for WM_NOTIFY
break;
case IDC_PREVBTN:
QueNo--;
SendMessage(hWnd,WM_NOTIFY,wParam,lParam);
break;
......
while in WM_NOTIFY, i have
1 2 3 4 5 6
case WM_NOTIFY:
{
if(lpnmhdr->code==TCN_SELCHANGE||lpnmhdr->hwndFrom==NextBtn||lpnmhdr->hwndFrom==PrevBtn){
.....
Yes when you receive a WM_NOTIFY message. This type of message is send from the child control to the parent. For example: when you have a listbox on your main windows and click on it it will send the WM_NOTIFY to its parent - in this case the main window.