title: TB_GETBUTTONINFO fails on Windows 7
body: <p>I have some code like this:</p>
  
  <pre><code>TBBUTTONINFO mtbbi;
  HWND hwnd;
  HANDLE hProc;
  DWORD dwProcessID;
  void* lpData;
  </code></pre>
  
  <p>.....</p>
  
  <pre><code>GetWindowThreadProcessId(hwnd, &amp;dwProcessID);
  hProc = OpenProcess(PROCESS_ALL_ACCESS, 0, dwProcessID);
  lpData = VirtualAllocEx(hProc , 0, sizeof(TBBUTTONINFO), MEM_COMMIT, PAGE_READWRITE);
  memset(&amp;mtbbi,0,sizeof(mtbbi));
  mtbbi.cbSize=sizeof(TBBUTTONINFO);
  mtbbi.dwMask=TBIF_BYINDEX|TBIF_LPARAM;  
  WriteProcessMemory(hProc,lpData,&amp;mtbbi,sizeof(TBBUTTONINFO),&amp;dwBytesRead);
  SendMessage(hwnd, TB_GETBUTTONINFO, 0, (LPARAM)lpData);
  ReadProcessMemory(hProc, lpData, &amp;mtbbi, sizeof(TBBUTTONINFO), &amp;dwBytesRead);
  </code></pre>
  
  <p>where <code>hwnd</code> - is a toolbar handle. This handle is correct, other messages(like <code>TB_BUTTONCOUNT</code> or <code>TB_GETBUTTON</code>) work fine.
  So, this code is working correctly under Windows XP, but when I try to execute it under Windows 7 x64 <code>SendMessage</code> returns -1, which means an error. I tried to use <code>GETBUTTONINFOA</code> instead of <code>GETBUTTONINFO</code>, but result is the same.</p>
  
  <p>What am I doing wrong?</p>