Thread: Saving EditBox text

  1. #1
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342

    Exclamation Saving EditBox text

    Okay, I have this script:
    Code:
    HFONT hfDefault;
    HWND hEdit; 
    hEdit = CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", " ", 
    WS_CHILD | WS_VISIBLE | WS_VSCROLL | ES_MULTILINE | ES_AUTOVSCROLL, 2, 2, 285, 196, hwnd, (HMENU)IDC_MAIN_EDIT, GetModuleHandle(NULL), NULL);
    if(hEdit == NULL)
    MessageBox(hwnd, "EditBox Creation Failed.", "Error", MB_OK | MB_ICONERROR);
    And this:
    Code:
     HANDLE hFile1=CreateFile("data.txt", GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
    DWORD dwBytes1;
    if (hFile1!=INVALID_HANDLE_VALUE)
    {
    WriteFile(hFile1, "blabla", 6, &dwBytes1, NULL);
    CloseHandle(hFile1);
    }
    else {
    MessageBox(NULL, "File Saveing Failed.", "Title", MB_OK | MB_ICONERROR); }
    Is there a way that can use these scripts to save the data that a user typed in the EditBox to data.txt file?

    Thanks, August

  2. #2

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Highlighting text in an EditBox
    By @nthony in forum Windows Programming
    Replies: 5
    Last Post: 01-17-2007, 10:16 PM
  2. Replies: 3
    Last Post: 05-25-2005, 01:50 PM
  3. Removing text between /* */ in a file
    By 0rion in forum C Programming
    Replies: 2
    Last Post: 04-05-2004, 08:54 AM
  4. Ok, Structs, I need help I am not familiar with them
    By incognito in forum C++ Programming
    Replies: 7
    Last Post: 06-29-2002, 09:45 PM
  5. Saving and Importing text files
    By ColdFire in forum Windows Programming
    Replies: 4
    Last Post: 06-17-2002, 08:32 AM