Saving EditBox text

This is a discussion on Saving EditBox text within the C++ Programming forums, part of the General Programming Boards category; Okay, I have this script: Code: HFONT hfDefault; HWND hEdit; hEdit = CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", " ", WS_CHILD | WS_VISIBLE | ...

  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
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    Cross Post of Saving EditBox text

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, 02:50 PM
  3. Removing text between /* */ in a file
    By 0rion in forum C Programming
    Replies: 2
    Last Post: 04-05-2004, 09: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, 10:45 PM
  5. Saving and Importing text files
    By ColdFire in forum Windows Programming
    Replies: 4
    Last Post: 06-17-2002, 09:32 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21