title: C - make #define 'return' a value
body: <p>Lets say I have define like this:</p>
  
  <pre><code>#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);\
  }
  </code></pre>
  
  <p>Now in my code I'd like to use variable 'thw'.
  Using just</p>
  
  <pre><code>CrWinDef(...);
  </code></pre>
  
  <p>works.</p>
  
  <p>However if add return thw; to my define and try to use same value in code it won't compile.</p>
  
  <pre><code>#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;\
      }
  </code></pre>
  
  <p>And in code</p>
  
  <pre><code> HWND hwnd = CrWinDef(...);
  </code></pre>