title: CreateWindow() [Win32 API] :  Only parent window gets
body: <p><a href="https://stackoverflow.com/questions/1708258/win32-wndproc-and-parent-child-windows">I asked a question</a>, and some people commented that my question wasn't clear, 
  So here is a new one.</p>
  
  <p>I'm trying to create an application with multiple windows using the WIN32 API. 
  I created two windows, one is a child of the parent. Then i have a message loop, 
  But unfortunately only the parent WndProc gets message, while the child does not. - that
  is the wndProc is being called only once instead of twice. ( is that the expected behaviour? )</p>
  
  <p>I also tried creating another WndProcChild Function for the child window, and registering its own class, but still to no avail. </p>
  
  <p>Below is a code extract ( only the declaration of the child window, and the message loop )</p>
  
  <p>I'm a Win32 newbie, so be gentle...
  Thanks, Dan</p>
  
  <pre><code>wcEdit.lpfnWndProc   = WndProcChild;  
  wcEdit.style         = CS_HREDRAW | CS_VREDRAW;  
  wcEdit.cbClsExtra    = 0;  
  wcEdit.cbWndExtra    = 0;  
  wcEdit.hInstance     = hInstance;;  
  wcEdit.hCursor       = 0;  
  wcEdit.lpszMenuName  = 0;  
  wcEdit.lpszClassName = L"child";  
  RegisterClass(&amp;wcEdit);  
  edit_hwnd = CreateWindow(L"child",  L"child_title", NULL,    
       0, 0, 0, 0, ParentWindow,    
       NULL, global_instance, NULL);    
  
  UpdateWindow(edit_hwnd);
  while (GetMessage(&amp;msg, NULL, 0, 0))  
  {  
       TranslateMessage(&amp;msg);  
       DispatchMessage(&amp;msg);  
  }  
  </code></pre>
  
  <hr>
  
  <p>Just to explain again what i want to achieve - i want to handle a WM_KEYDOWN message twice - once in the parent window and once in the child window. I actually don't need them to be parent-child, just thought that would save me creating two different wndProcs</p>