Okay I somewhat figured this out by digging deeper into the MSDN archives there. Now the code is as follows (so far):
Code:
case WM_NOTIFY:
if( sizeof(*(lParam)) == sizeof(NMMOUSE) )
{
pnmm = (NMMOUSE *)(LPARAM)lParam;
if( pnmm->hdr.code == NM_CLICK )
{
ZeroMemory(&tcHitTest, sizeof(TCHITTESTINFO));
tcHitTest.pt.x = pnmm->pt.x;
tcHitTest.pt.y = pnmm->pt.y;
tab = TabCtrl_HitTest(hTC_Wnd, &tcHitTest);
}
}
else
{
pnmh = (NMHDR *)(LPARAM)lParam;
if( pnmh->code == NM_CLICK )
{
ZeroMemory(&tcHitTest, sizeof(TCHITTESTINFO));
tcHitTest.pt.x = ; // TODO: determine how to get this value
tcHitTest.pt.y = ; // TODO: determine how to get this value
tab = TabCtrl_HitTest(hTC_Wnd, &tcHitTest);
}
}
// check to see which tab (if any) were clicked
if( tab != -1 )
{
if( tab == 0 )
MessageBox(NULL, "EzBooks tab was hit.", "HitTest", MB_OK);
else if( tab == 1 )
MessageBox(NULL, "Income tab was hit.", "HitTest", MB_OK);
else if( tab == 2 )
MessageBox(NULL, "Expenses tab was hit.", "HitTest", MB_OK);
else if( tab == 3 )
MessageBox(NULL, "Payroll tab was hit.", "HitTest", MB_OK);
else if( tab == 4 )
MessageBox(NULL, "Assets tab was hit.", "HitTest", MB_OK);
else if( tab == 5 )
MessageBox(NULL, "Reports tab was hit.", "HitTest", MB_OK);
else
MessageBox(NULL, "Unknown tab was hit.", "HitTest Unknown", MB_OK);
}
break;
Now it's still not giving me any message boxes (the last if statement). Am I even on the right track, or am I completely off? Please let me know. (I determined that as per the specs on the NM_CLICK notification, that since lParam could infact be a larger structure then NMHDR struct, this larger struct would have an NMHDR struct as the first param of the larger struct... thus the NMMOUSE struct was a logic choice considering that it involves mouse clicks as well as has an NMHDR struct as it's first param. Thus why I check to see the size of the struct first, now I was never the best on pointers so please correct me if my comparison between the two is incorrect sizeof(*(lParam)) == sizeof(NMMOUSE)?
Thanks for any help,
Tyouk