title: C++ Correct Usage of LPDWORD
body: <p>I have an array of hWnds of buttons that I want to monitor for clicks. I also have an array of HWINEVENTHOOKs that I will use to monitor them. GetWindowThreadProcessID gives me an LPDWORD process ID, which is not accepted by SetWinEventHook. I am unclear on whether I am correctly using LPDWORDs in this example. Please could somebody point me in the right direction?</p>
  
  <p>EDIT: Thank you to everyone who contributed, I have posted the corrected code below.</p>
  
  <p>New Code:</p>
  
  <pre><code>int i = 0;
  for (HWND hWnd : hWnds) {
      DWORD processID = 0;
      DWORD threadID = GetWindowThreadProcessId(hWnd, &amp;processID);
      hooks[i] = SetWinEventHook(EVENT_OBJECT_INVOKED, EVENT_OBJECT_INVOKED, 
      NULL,
          WinEventProcCallback, processID, threadID, WINEVENT_OUTOFCONTEXT);
          i++;
  }
  </code></pre>