Menu

(winapi) copy from one edit field to other

2003-01-10
2012-09-26
  • Nobody/Anonymous

    Is there any way to copy the content of a edit field to another edit field without using GETTEXT, SETTEXT and a var to hold the value?
    Maybe theres wome smart api way to do it?

    Thank you!

     
    • upcase

      upcase - 2003-01-11

      Not sure since I skipped to wxWindows, but I can't think of any. Using MFC it's just like a = b; but with pure win32 I on't think there is another way. Maybe one of the API Gurus knows a solution... :)

       
    • Nobody/Anonymous

      // Copy contents of control nID1 to control nID2...
      void CopyEditField(HWND hDialog, int nID1, int nID2)
      {
      // Variables...
      char szBuffer[1024] = {0};

      // Copy text from one and paste into another...
      GetDlgItemText(hDialog, nID1, pszBuffer, sizeof(pszBuffer));
      SetDlgItemText(hDialog, nID2, pszBuffer);
      }

      =)

      Kip

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.