1 2 3 4 5 6 7 8 9 10
|
HANDLE File = CreateFile((LPWSTR)buf, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
char cBufferText[] = "TTTTESTTTT";
WCHAR writtenStr[128];
DWORD HH;
SetFilePointer(File, 0, 0, FILE_BEGIN);
ReadFile(File, writtenStr, 128, &HH, NULL);
MessageBox(hWnd, writtenStr, L"текст", MB_OK);
WriteFile(File, &cBufferText, sizeof(&cBufferText)* 2 + 1, &HH, NULL);
SetEndOfFile(File);
CloseHandle(File);
|