title: How to copy the text from editbox into a string array?
body: <p>I am making a win32 api window application project on visual studio 2012.I use a LPWSTR type variable to store my strings described as follow.</p>
  
  <pre><code>LPWSTR MyStringList[3]={L"apple",L"orange",L"watermelon"};
  </code></pre>
  
  <p>I expect to copy the text from an editbox to one of the strings in MyStringList. Therefore,I made a simple editbox and button.</p>
  
  <p>Here is the definition of editbox and button.</p>
  
  <pre><code>case WM_CREATE:
      hEdit = CreateWindow(L"EDIT", 
              L"", 
              WS_CHILD | WS_VISIBLE | WS_BORDER | ES_AUTOHSCROLL, 
              10, 10, 200, 25, 
              hWnd, 
              (HMENU)ID_EDIT, 
              GetModuleHandle(NULL), 
              NULL);
      hBtn = CreateWindow(L"BUTTON", 
              L"", 
              WS_CHILD | WS_VISIBLE, 
              250, 10, 50, 30, 
              hWnd, 
              (HMENU)ID_BUTTON, 
              GetModuleHandle(NULL), 
              NULL);
  </code></pre>
  
  <p>Here is the action when the button is pushed.The two messagebox are used to see if the string has been changed after function GetWindowText is called.</p>
  
  <pre><code>case WM_COMMAND:
      wmId    = LOWORD(wParam);
      wmEvent = HIWORD(wParam);
      switch (wmId)
      {
      case ID_BUTTON:
  
          MessageBox(hWnd,MystringList[1],L"Before_Pusing",MB_OK);
  
          GetWindowText(hEdit,MystringList[1],sizeof(MystringList[1]));
  
          MessageBox(hWnd,MystringList[1],L"After_Pushing",MB_OK);
  
          InvalidateRect(hWnd,NULL,TRUE);
          break;
  </code></pre>
  
  <p>Now I tried to push the button after typing "banana" into the editbox. The second string "orange" should be replaced with "banana". However,it turned out that nothing changed .The second messagebox displayed "orange" as the first messagebox did. What's wrong with my code? Please help! Thanks a lot!</p>