Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //---------------------------------------------------------------------------
- #include <vcl.h>
- #pragma hdrstop
- #include "Unit1.h"
- //---------------------------------------------------------------------------
- #pragma package(smart_init)
- #pragma resource "*.dfm"
- TForm1 *Form1;
- int z = 0;
- int c;
- void zastosuj()
- {
- if (z==1)
- {
- for(;;)
- {
- if (GetAsyncKeyState(VK_MBUTTON))
- {
- mouse_event(MOUSEEVENTF_LEFTDOWN, 0,0,0,0);
- mouse_event(MOUSEEVENTF_LEFTUP, 0,0,0,0);
- Sleep(c);
- Application->ProcessMessages();
- }
- }
- z=0;
- }
- }
- void anuluj()
- {
- if (GetAsyncKeyState(VK_LBUTTON))
- {
- return;
- }
- }
- //---------------------------------------------------------------------------
- __fastcall TForm1::TForm1(TComponent* Owner)
- : TForm(Owner)
- {
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::FormCreate(TObject *Sender)
- {
- //
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::CzasChange(TObject *Sender)
- {
- c = String(Czas -> Text).ToInt();
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::ZastosujClick(TObject *Sender)
- {
- z=1;
- zastosuj();
- anuluj();
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::CzasClick(TObject *Sender)
- {
- for(;;)
- if (GetAsyncKeyState(VK_LBUTTON))
- {
- return;
- }
- }
- //---------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement