Sorry John, I don't understand what's wrong.
Please try this code:
#include <windows.h>
#include <stdio.h>
#include <commctrl.h>
#undef SNDMSG
#define SNDMSG myfunc
BOOL myfunc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
PRECT prc = (PRECT)lParam;
printf("hwnd=%p, msg=%u, prc=%p, left=%d, wParam=%d\n", hwnd, msg, prc, prc ? prc->left : 0, wParam);
return TRUE;
}
void foo(PRECT prc)
{
//Here we don't get 'comparison constant' because prc is defined outside
ListView_GetItemRect(NULL, 10, prc, 20);
}
int main(int argn, char **args)
{
RECT rc;
//Here we got a 'comparison constant' because rc is defined here
ListView_GetItemRect(NULL, 10, &rc, 20);
ListView_GetItemRect(NULL, 10, NULL, 20);
foo(&rc);
return 0;
}
This is a simple test for the list view macros, and as I can see it works.