- #include <windows.h>
-
- char *szfile = "D:\\bnMaths.txt"; // ici tu changes
-
- int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, PSTR, int)
- {
- DWORD val, myBit;
- HANDLE hfl;
- hfl = CreateFile(szfile, GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, 0);
- if(hfl == INVALID_HANDLE_VALUE) return 0;
- SetFilePointer(hfl, 8, 0, FILE_BEGIN); // 8 est offset debut, changer
- myBit = 0x41; // a mettre maxi 255, ici est 'A'
- WriteFile(hfl, &myBit, 1, &val, 0);
- CloseHandle(hfl);
- return 0;
- }
#include <windows.h>
char *szfile = "D:\\bnMaths.txt"; // ici tu changes
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, PSTR, int)
{
DWORD val, myBit;
HANDLE hfl;
hfl = CreateFile(szfile, GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, 0);
if(hfl == INVALID_HANDLE_VALUE) return 0;
SetFilePointer(hfl, 8, 0, FILE_BEGIN); // 8 est offset debut, changer
myBit = 0x41; // a mettre maxi 255, ici est 'A'
WriteFile(hfl, &myBit, 1, &val, 0);
CloseHandle(hfl);
return 0;
}