Nice one daddy
Making an autorefresher that displays times refresh in console.
edit:sorry for the akward whitespacing
Includes
[PHP]#include <windows.h>
#include <iostream>
using namespace std;[/PHP]
To display times pressed
[PHP]DWORD timesPressed = 0;[/PHP]
Main function, entry point.
[PHP]int main()
{[/PHP]
starts infinate lewp.
[PHP]while(true)
{[/PHP]
i use goto because its easy to exit nested loops
meat of program.
[PHP]startLoop:[/PHP]
when numpad0 is pressed, starts new nested loop, if end is pressed go to before the loops started
[PHP]Sleep(100);
if(GetAsyncKeyState(VK_NUMPAD0))
{
while(true)
{
if(GetAsyncKeyState(VK_END))
{
cout << "Stopped. Press 'Numpad 0' to start again.\n";
goto startLoop;
}[/PHP]
when numpad0 was pressed refresh, increment the counter, and display times pressed.
[PHP]Sleep(12500);
timesPressed++;
keybd_event(VK_F5,0x74,KEYEVENTF_EXTENDEDKEY | 0,0);
cout << "Times pressed: " << timesPressed << '\n';
[/PHP]
Rest.
[PHP] }
}
}
}[/PHP]
i'm out.
未来が見えなくて怖いから
未来が見えてしまって悲しいから
目を閉じて優しい思い出に浸ってしまう