title: Dereferencing pointer C++
body: <p>I just managed to write a global CBT hook in c++, usable with c#.
  It may sound stupid but my knowledge of pointers and dereferencing of those is very bad due to my work with c#.</p>
  
  <p>I'm not able to dereference a pointer inside a struct pointed to by the lParam.</p>
  
  <p>It looks like this: the lParam is a long Pointer to a CBT_CREATEWND struct, which in turn holds a member "lpcs", and a pointer to a CREATESTRUCT. This struct contains a member "x", which I want to read. I tried the following, but I get invalid values for x:</p>
  
  <pre><code>CREATESTRUCT str = *(LPCREATESTRUCT)(((LPCBT_CREATEWND)lParam)-&gt;lpcs);
  int normal = str.x;
  PostMessage(FindWindow(NULL, L"Process Watcher Window"), RegisterWindowMessage(L"ALEXX_SEINE_WNDMESSAGE_C"), wParam, normal);
  </code></pre>
  
  <p>could someone please help me?</p>