Lets say I have define like this:
#define CrWinDef(a,b,c,d,e,f,g,h,i,j,k,l)\
{\
HWND thw=CreateWindowEx(a,b,c,d,e,f,g,h,i,j,k,l);\
SendMessage(thw, WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT), (LPARAM)true);\
}
Now in my code I'd like to use variable 'thw'. Using just
CrWinDef(...);
works.
However if add return thw; to my define and try to use same value in code it won't compile.
#define CrWinDef(a,b,c,d,e,f,g,h,i,j,k,l)\
{\
HWND thw=CreateWindowEx(a,b,c,d,e,f,g,h,i,j,k,l);\
SendMessage(thw, WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT), (LPARAM)true);\
return thw;\
}
And in code
HWND hwnd = CrWinDef(...);