Advertisement
Guest User

Untitled

a guest
Jul 21st, 2013
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 74.80 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using System.Runtime.InteropServices;
  10. using System.Diagnostics;
  11. using System.IO;
  12.  
  13. namespace SAMPBinder
  14. {
  15. public partial class Form1 : Form
  16. {
  17.  
  18. #region userdll
  19. #region asynckey
  20. [DllImport("user32.dll")]
  21. static extern short GetAsyncKeyState(System.Windows.Forms.Keys vKey);
  22. public bool pressed(Keys key)
  23. {
  24. if (GetAsyncKeyState(key) == 0)
  25. return false;
  26. else
  27. return true;
  28. }
  29. #endregion
  30. [DllImport("user32.dll")]
  31. private static extern IntPtr GetForegroundWindow();
  32.  
  33. [DllImport("user32.dll", SetLastError = true)]
  34. static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
  35. [DllImport("user32", SetLastError = true)]
  36. [return: MarshalAs(UnmanagedType.Bool)]
  37. public static extern bool RegisterHotKey(IntPtr hwnd, int id, uint fsModifiers, uint vk);
  38. [DllImport("user32", SetLastError = true)]
  39. [return: MarshalAs(UnmanagedType.Bool)]
  40. public static extern bool UnregisterHotKey(IntPtr hwnd, int id);
  41. public static uint nimic = 0x0;
  42.  
  43. public static int WM_HOTKEY = 0x312;
  44. public static uint MOD_SHIFT = 0x4;
  45. public static uint MOD_CONTROL = 0x2;
  46. #endregion
  47.  
  48.  
  49. public Form1()
  50. {
  51. InitializeComponent();
  52. }
  53.  
  54. private void Form1_Load(object sender, EventArgs e)
  55. {
  56. update.Start();
  57. incarca_setari();
  58. }
  59. #region declaratii variabile
  60. bool tastaESC = false;
  61. bool tastaENTER = false;
  62. bool chat_inchis = true;
  63. bool on = true;
  64. bool TT = false;
  65. bool smoth = true; // daca se misca frumos in jos/sus
  66. bool doar_gta = true;
  67. int ind = 5; // indexul
  68. int[] taste = new int[21]; // tastele
  69. #region binduri
  70. bool bind1 = false;
  71. bool bind2 = false;
  72. bool bind3 = false;
  73. bool bind4 = false;
  74. bool bind5 = false;
  75. bool bind6 = false;
  76. bool bind7 = false;
  77. bool bind8 = false;
  78. bool bind9 = false;
  79. bool bind10 = false;
  80. bool bind11 = false;
  81. bool bind12 = false;
  82. bool bind13 = false;
  83. bool bind14 = false;
  84. bool bind15 = false;
  85. bool bind16 = false;
  86. bool bind17 = false;
  87. bool bind18 = false;
  88. bool bind19 = false;
  89. bool bind20 = false;
  90. #endregion
  91.  
  92. #endregion
  93. #region functii
  94. void caz(string text)
  95. {
  96. try
  97. {
  98. string mes = text;
  99. mes = mes.Replace("(","{(}");
  100. mes = mes.Replace(")", "{)}");
  101. mes = mes.Replace("~", "{~}");
  102.  
  103. SendKeys.Send(mes);
  104. }
  105. catch (Exception ex)
  106. {
  107. MessageBox.Show(ex.Message.ToString(), "Error");
  108. }
  109. }
  110. void regkeys(int i, int tasta, bool bind)
  111. {
  112. bool ok = false;
  113. IntPtr a = GetForegroundWindow();
  114. IntPtr b = FindWindow(null, "GTA:SA:MP");
  115. if (a == b)
  116. ok = true;
  117.  
  118. if (doar_gta)
  119. if (bind && ok && on &&chat_inchis)
  120. {
  121.  
  122. RegisterHotKey(this.Handle, i, nimic, (uint)((Keys)tasta));
  123. }
  124. else
  125. UnregisterHotKey(this.Handle, i);
  126. else
  127. if (bind && on)
  128. {
  129.  
  130. RegisterHotKey(this.Handle, i, nimic, (uint)((Keys)tasta));
  131. }
  132. else
  133. UnregisterHotKey(this.Handle, i);
  134.  
  135.  
  136. } // inregistreaza / sterge bind
  137. bool diferit(string a, string b)
  138. {
  139. if (a != "" && b != "None(0)")
  140. return true;
  141. else
  142. return false;
  143. }
  144.  
  145. void update_v_taste()
  146. {
  147. taste[1] = Properties.Settings.Default.tasta1;
  148. taste[2] = Properties.Settings.Default.tasta2;
  149. taste[3] = Properties.Settings.Default.tasta3;
  150. taste[4] = Properties.Settings.Default.tasta4;
  151. taste[5] = Properties.Settings.Default.tasta5;
  152. taste[6] = Properties.Settings.Default.tasta6;
  153. taste[7] = Properties.Settings.Default.tasta7;
  154. taste[8] = Properties.Settings.Default.tasta8;
  155. taste[9] = Properties.Settings.Default.tasta9;
  156. taste[10] = Properties.Settings.Default.tasta10;
  157. taste[11] = Properties.Settings.Default.tasta11;
  158. taste[12] = Properties.Settings.Default.tasta12;
  159. taste[13] = Properties.Settings.Default.tasta13;
  160. taste[14] = Properties.Settings.Default.tasta14;
  161. taste[15] = Properties.Settings.Default.tasta15;
  162. taste[16] = Properties.Settings.Default.tasta16;
  163. taste[17] = Properties.Settings.Default.tasta17;
  164. taste[18] = Properties.Settings.Default.tasta18;
  165. taste[19] = Properties.Settings.Default.tasta19;
  166. taste[20] = Properties.Settings.Default.tasta20;
  167.  
  168. } // updatezi tastele
  169. void update_ind()
  170. {
  171. Properties.Settings.Default.index = ind;
  172. Properties.Settings.Default.Save();
  173. } // updatezi indexul ( nr de binduri)
  174. void in_jos()
  175. {
  176. timer2.Stop();
  177. if (ind ==1)
  178. {
  179.  
  180. if (this.Size.Height < 179)
  181. {
  182. this.Size = new Size(this.Size.Width, this.Size.Height + 1);
  183. }
  184. else
  185. {
  186.  
  187. ind++;update_ind();
  188. timer1.Stop();
  189. }
  190. }
  191. if (ind ==2)
  192. {
  193.  
  194. if (this.Size.Height < 224)
  195. {
  196. this.Size = new Size(this.Size.Width, this.Size.Height + 1);
  197. }
  198. else
  199. {
  200.  
  201. ind++;update_ind();
  202. timer1.Stop();
  203. }
  204. }
  205. if (ind == 3)
  206. {
  207.  
  208. if (this.Size.Height < 264)
  209. {
  210. this.Size = new Size(this.Size.Width, this.Size.Height + 1);
  211. }
  212. else
  213. {
  214.  
  215. ind++;update_ind();
  216. timer1.Stop();
  217. }
  218. }
  219.  
  220. if (ind == 4)
  221. {
  222.  
  223. if (this.Size.Height < 304)
  224. {
  225. this.Size = new Size(this.Size.Width, this.Size.Height + 1);
  226. }
  227. else
  228. {
  229.  
  230. ind++;update_ind();
  231. timer1.Stop();
  232. }
  233. }
  234.  
  235. if (ind == 5)
  236. {
  237.  
  238. if (this.Size.Height < 346)
  239. {
  240. this.Size = new Size(this.Size.Width, this.Size.Height + 1);
  241. }
  242. else
  243. {
  244.  
  245. ind++;update_ind();
  246. timer1.Stop();
  247. }
  248. }
  249.  
  250. if (ind == 6)
  251. {
  252.  
  253. if (this.Size.Height < 392)
  254. {
  255. this.Size = new Size(this.Size.Width, this.Size.Height + 1);
  256. }
  257. else
  258. {
  259. ind++;update_ind();
  260. timer1.Stop();
  261. }
  262. }
  263.  
  264. if (ind == 7)
  265. {
  266.  
  267. if (this.Size.Height < 432)
  268. {
  269. this.Size = new Size(this.Size.Width, this.Size.Height + 1);
  270. }
  271. else
  272. {
  273. ind++;update_ind();
  274. timer1.Stop();
  275. }
  276. }
  277. if (ind == 8)
  278. {
  279.  
  280. if (this.Size.Height < 467)
  281. {
  282. this.Size = new Size(this.Size.Width, this.Size.Height + 1);
  283. }
  284. else
  285. {
  286. ind++;update_ind();
  287. timer1.Stop();
  288. }
  289. }
  290. if (ind == 9)
  291. {
  292.  
  293. if (this.Size.Height < 512)
  294. {
  295. this.Size = new Size(this.Size.Width, this.Size.Height + 1);
  296. }
  297. else
  298. {
  299. ind++;update_ind();
  300. timer1.Stop();
  301. }
  302. }
  303.  
  304. } // miscarea in jos nr de binduri
  305. void in_sus()
  306. {
  307. timer1.Stop();
  308. if (ind == 10)
  309. {
  310.  
  311. if (this.Size.Height > 467)
  312. {
  313. this.Size = new Size(this.Size.Width, this.Size.Height - 1);
  314. }
  315. else
  316. {
  317. ind--;update_ind();
  318. timer2.Stop();
  319. }
  320.  
  321. }
  322. if (ind == 9)
  323. {
  324. if (this.Size.Height > 432)
  325. {
  326. this.Size = new Size(this.Size.Width, this.Size.Height - 1);
  327. }
  328. else
  329. {
  330. ind--;update_ind();
  331. timer2.Stop();
  332. }
  333.  
  334. }
  335. if (ind == 8)
  336. {
  337. if (this.Size.Height > 392)
  338. {
  339. this.Size = new Size(this.Size.Width, this.Size.Height - 1);
  340. }
  341. else
  342. {
  343. ind--;update_ind();
  344. timer2.Stop();
  345. }
  346.  
  347. }
  348. if (ind == 7)
  349. {
  350. if (this.Size.Height > 346)
  351. {
  352. this.Size = new Size(this.Size.Width, this.Size.Height - 1);
  353. }
  354. else
  355. {
  356. ind--;update_ind();
  357. timer2.Stop();
  358. }
  359.  
  360. }
  361. if (ind == 6)
  362. {
  363. if (this.Size.Height > 304)
  364. {
  365. this.Size = new Size(this.Size.Width, this.Size.Height - 1);
  366. }
  367. else
  368. {
  369. ind--;update_ind();
  370. timer2.Stop();
  371. }
  372.  
  373. }
  374. if (ind == 5)
  375. {
  376. if (this.Size.Height > 264)
  377. {
  378. this.Size = new Size(this.Size.Width, this.Size.Height - 1);
  379. }
  380. else
  381. {
  382. ind--;update_ind();
  383. timer2.Stop();
  384. }
  385.  
  386. }
  387. if (ind == 4)
  388. {
  389. if (this.Size.Height > 224)
  390. {
  391. this.Size = new Size(this.Size.Width, this.Size.Height - 1);
  392. }
  393. else
  394. {
  395. ind--;update_ind();
  396. timer2.Stop();
  397. }
  398.  
  399. }
  400. if (ind == 3)
  401. {
  402. if (this.Size.Height > 179)
  403. {
  404. this.Size = new Size(this.Size.Width, this.Size.Height - 1);
  405. }
  406. else
  407. {
  408. ind--;update_ind();
  409. timer2.Stop();
  410. }
  411.  
  412. }
  413. if (ind == 2)
  414. {
  415. if (this.Size.Height > 134)
  416. {
  417. this.Size = new Size(this.Size.Width, this.Size.Height - 1);
  418. }
  419. else
  420. {
  421. ind--;update_ind();
  422. timer2.Stop();
  423. }
  424.  
  425. }
  426. } // miscarea in sus nr de binduri
  427. void incarca_setari()
  428. {
  429. #region r only
  430.  
  431. enab = Properties.Settings.Default.enab;
  432. if (!enab)
  433. {
  434. toolStripStatusLabel5.Text = "Disable Read Only";
  435. hk1.Enabled = false;
  436. hk2.Enabled = false;
  437. hk3.Enabled = false;
  438. hk4.Enabled = false;
  439. hk5.Enabled = false;
  440. hk6.Enabled = false;
  441. hk7.Enabled = false;
  442. hk8.Enabled = false;
  443. hk9.Enabled = false;
  444. hk10.Enabled = false;
  445. hk11.Enabled = false;
  446. hk12.Enabled = false;
  447. hk13.Enabled = false;
  448. hk14.Enabled = false;
  449. hk15.Enabled = false;
  450. hk16.Enabled = false;
  451. hk17.Enabled = false;
  452. hk18.Enabled = false;
  453. hk19.Enabled = false;
  454. hk20.Enabled = false;
  455. text1.Enabled = false;
  456. text2.Enabled = false;
  457. text3.Enabled = false;
  458. text4.Enabled = false;
  459. text5.Enabled = false;
  460. text6.Enabled = false;
  461. text7.Enabled = false;
  462. text8.Enabled = false;
  463. text9.Enabled = false;
  464. text10.Enabled = false;
  465. text11.Enabled = false;
  466. text12.Enabled = false;
  467. text13.Enabled = false;
  468. text14.Enabled = false;
  469. text15.Enabled = false;
  470. text16.Enabled = false;
  471. text17.Enabled = false;
  472. text18.Enabled = false;
  473. text19.Enabled = false;
  474. text20.Enabled = false;
  475.  
  476. }
  477. else
  478. {
  479. toolStripStatusLabel5.Text = "Enable Read Only";
  480. hk1.Enabled = true;
  481. hk2.Enabled = true;
  482. hk3.Enabled = true;
  483. hk4.Enabled = true;
  484. hk5.Enabled = true;
  485. hk6.Enabled = true;
  486. hk7.Enabled = true;
  487. hk8.Enabled = true;
  488. hk9.Enabled = true;
  489. hk10.Enabled = true;
  490. hk11.Enabled = true;
  491. hk12.Enabled = true;
  492. hk13.Enabled = true;
  493. hk14.Enabled = true;
  494. hk15.Enabled = true;
  495. hk16.Enabled = true;
  496. hk17.Enabled = true;
  497. hk18.Enabled = true;
  498. hk19.Enabled = true;
  499. hk20.Enabled = true;
  500. text1.Enabled = true;
  501. text2.Enabled = true;
  502. text3.Enabled = true;
  503. text4.Enabled = true;
  504. text5.Enabled = true;
  505. text6.Enabled = true;
  506. text7.Enabled = true;
  507. text8.Enabled = true;
  508. text9.Enabled = true;
  509. text10.Enabled = true;
  510. text11.Enabled = true;
  511. text12.Enabled = true;
  512. text13.Enabled = true;
  513. text14.Enabled = true;
  514. text15.Enabled = true;
  515. text16.Enabled = true;
  516. text17.Enabled = true;
  517. text18.Enabled = true;
  518. text19.Enabled = true;
  519. text20.Enabled = true;
  520.  
  521. }
  522. #endregion
  523. #region creare fisier readme
  524. string s = Environment.NewLine;
  525. /* string mesaj = "";
  526. mesaj += "********* Universal KeyBinder v1.0 ********" + s;
  527. mesaj += "********* This is a freeware. ********" + s;
  528. mesaj += s+s+s+s+"What you need to know:" + s;
  529. mesaj += " - if you want to disable a bind press press Delete when choosing the hotkey " + s;
  530. mesaj += " - if you want to disable all binds press disable binds" + s;
  531. mesaj += s+s+s+s+"Features:" + s;
  532. mesaj += " - you can bind up to 20 keys" + s;
  533. mesaj += " - you can choose the hotkey very eazy by pressing it" + s;
  534. mesaj += " - you can use this as a SA:MP Keybinder or as an universal keybinder " + s;
  535. mesaj += " - if you are using this as a SA:MP Keybinder if the chat is open the keys won't be send " + s;
  536. mesaj += " - if you don't like to see that many binds you can hide them, this automaticaly disables them" + s;
  537. mesaj += " - every bind will be saved, and alo the hotkey" + s;
  538. mesaj += " - all the setings you make will be saved" + s;
  539. mesaj += s+s+s+s+"Info: " + s;
  540. mesaj += " -this program was made using Visual C# " + s;
  541. mesaj += " -for the hotkey I used the RegisterHotkey function from user32.dll " + s;
  542. mesaj += " -to find out if the current window is GTA I used GetForegroundWindow and FindWindow, also from user32.dll " + s;
  543. mesaj += s+s+s+"Enjoy it!";*/
  544. try
  545. {
  546.  
  547. string nume = "WhyYUNoReadMe.txt";
  548. string mesaj = Properties.Resources.WhyYUNOReadMez;
  549. if (!File.Exists(nume))
  550. {
  551. StreamWriter sr = new StreamWriter(nume);
  552. sr.Write(mesaj);
  553. sr.Close();
  554. }
  555. }
  556. catch (Exception ex)
  557. {
  558.  
  559. }
  560. #endregion
  561. #region smoth/rapid
  562. smoth = Properties.Settings.Default.smoth;
  563. if (smoth)
  564. {
  565. directlyToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Unchecked;
  566. smoothToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
  567. }
  568. else
  569. {
  570. directlyToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
  571. smoothToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Unchecked;
  572. }
  573. #endregion
  574. #region gta/anywin
  575. doar_gta = Properties.Settings.Default.doargta;
  576. if (doar_gta)
  577. {
  578. justgta.CheckState = System.Windows.Forms.CheckState.Checked;
  579. anywin.CheckState = System.Windows.Forms.CheckState.Unchecked;
  580. }
  581. else
  582. {
  583. anywin.CheckState = System.Windows.Forms.CheckState.Checked;
  584. justgta.CheckState = System.Windows.Forms.CheckState.Unchecked;
  585. }
  586. #endregion
  587. #region index
  588. ind = Properties.Settings.Default.index;
  589. if (ind == 1)
  590. this.Size = new Size(this.Size.Width, 134);
  591. if (ind == 2)
  592. this.Size = new Size(this.Size.Width, 179);
  593. if (ind == 3)
  594. this.Size = new Size(this.Size.Width, 224);
  595. if (ind == 4)
  596. this.Size = new Size(this.Size.Width, 264);
  597. if (ind == 5)
  598. this.Size = new Size(this.Size.Width, 304);
  599. if (ind == 6)
  600. this.Size = new Size(this.Size.Width, 346);
  601. if (ind == 7)
  602. this.Size = new Size(this.Size.Width, 392);
  603. if (ind == 8)
  604. this.Size = new Size(this.Size.Width, 432);
  605. if (ind == 9)
  606. this.Size = new Size(this.Size.Width, 467);
  607. if (ind == 10)
  608. this.Size = new Size(this.Size.Width, 506);
  609. #endregion
  610. #region taste
  611. int i; string ii;
  612. i = Properties.Settings.Default.tasta1;
  613. ii = ((Keys)i).ToString();
  614. hk1.Text = ii + "(" + i + ")";
  615. i = Properties.Settings.Default.tasta2;
  616. ii = ((Keys)i).ToString();
  617. hk2.Text = ii + "(" + i + ")";
  618.  
  619.  
  620. i = Properties.Settings.Default.tasta3;
  621. ii = ((Keys)i).ToString();
  622. hk3.Text = ii + "(" + i + ")";
  623. i = Properties.Settings.Default.tasta4;
  624. ii = ((Keys)i).ToString();
  625. hk4.Text = ii + "(" + i + ")";
  626.  
  627.  
  628. i = Properties.Settings.Default.tasta5;
  629. ii = ((Keys)i).ToString();
  630. hk5.Text = ii + "(" + i + ")";
  631. i = Properties.Settings.Default.tasta6;
  632. ii = ((Keys)i).ToString();
  633. hk6.Text = ii + "(" + i + ")";
  634.  
  635. i = Properties.Settings.Default.tasta7;
  636. ii = ((Keys)i).ToString();
  637. hk7.Text = ii + "(" + i + ")";
  638. i = Properties.Settings.Default.tasta8;
  639. ii = ((Keys)i).ToString();
  640. hk8.Text = ii + "(" + i + ")";
  641.  
  642. i = Properties.Settings.Default.tasta9;
  643. ii = ((Keys)i).ToString();
  644. hk9.Text = ii + "(" + i + ")";
  645. i = Properties.Settings.Default.tasta10;
  646. ii = ((Keys)i).ToString();
  647. hk10.Text = ii + "(" + i + ")";
  648.  
  649. i = Properties.Settings.Default.tasta11;
  650. ii = ((Keys)i).ToString();
  651. hk11.Text = ii + "(" + i + ")";
  652. i = Properties.Settings.Default.tasta12;
  653. ii = ((Keys)i).ToString();
  654. hk12.Text = ii + "(" + i + ")";
  655.  
  656. i = Properties.Settings.Default.tasta13;
  657. ii = ((Keys)i).ToString();
  658. hk13.Text = ii + "(" + i + ")";
  659. i = Properties.Settings.Default.tasta14;
  660. ii = ((Keys)i).ToString();
  661. hk14.Text = ii + "(" + i + ")";
  662.  
  663. i = Properties.Settings.Default.tasta15;
  664. ii = ((Keys)i).ToString();
  665. hk15.Text = ii + "(" + i + ")";
  666. i = Properties.Settings.Default.tasta16;
  667. ii = ((Keys)i).ToString();
  668. hk16.Text = ii + "(" + i + ")";
  669.  
  670. i = Properties.Settings.Default.tasta17;
  671. ii = ((Keys)i).ToString();
  672. hk17.Text = ii + "(" + i + ")";
  673. i = Properties.Settings.Default.tasta18;
  674. ii = ((Keys)i).ToString();
  675. hk18.Text = ii + "(" + i + ")";
  676.  
  677. i = Properties.Settings.Default.tasta19;
  678. ii = ((Keys)i).ToString();
  679. hk19.Text = ii + "(" + i + ")";
  680. i = Properties.Settings.Default.tasta20;
  681. ii = ((Keys)i).ToString();
  682. hk20.Text = ii + "(" + i + ")";
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689. #endregion
  690. #region text
  691. text1.Text = Properties.Settings.Default.text1;
  692. text2.Text = Properties.Settings.Default.text2;
  693. text3.Text = Properties.Settings.Default.text3;
  694. text4.Text = Properties.Settings.Default.text4;
  695. text5.Text = Properties.Settings.Default.text5;
  696. text6.Text = Properties.Settings.Default.text6;
  697. text7.Text = Properties.Settings.Default.text7;
  698. text8.Text = Properties.Settings.Default.text8;
  699. text9.Text = Properties.Settings.Default.text9;
  700. text10.Text = Properties.Settings.Default.text10;
  701. text11.Text = Properties.Settings.Default.text11;
  702. text12.Text = Properties.Settings.Default.text12;
  703. text13.Text = Properties.Settings.Default.text13;
  704. text14.Text = Properties.Settings.Default.text14;
  705. text15.Text = Properties.Settings.Default.text15;
  706. text16.Text = Properties.Settings.Default.text16;
  707. text17.Text = Properties.Settings.Default.text17;
  708. text18.Text = Properties.Settings.Default.text18;
  709. text19.Text = Properties.Settings.Default.text19;
  710. text20.Text = Properties.Settings.Default.text20;
  711.  
  712. #endregion;
  713.  
  714. }
  715. #endregion
  716. #region eventuri sus+jos
  717.  
  718. private void timer1_Tick(object sender, EventArgs e)
  719. {
  720. in_jos();
  721.  
  722.  
  723. }
  724.  
  725.  
  726.  
  727. private void toolStripStatusLabel1_Click(object sender, EventArgs e)
  728. {
  729. if (smoth)
  730. {
  731. timer1.Stop();
  732. timer2.Stop();
  733. timer1.Start();
  734. }
  735. else
  736. {
  737. timer1.Stop();
  738. timer2.Stop();
  739.  
  740. if (ind == 1)
  741. {
  742. this.Size = new Size(this.Size.Width, 179);
  743. ind++;update_ind();
  744. return;
  745. }
  746. if (ind == 2)
  747. {
  748. this.Size = new Size(this.Size.Width, 224);
  749. ind++;update_ind(); return;
  750. }
  751. if (ind == 3)
  752. {
  753. this.Size = new Size(this.Size.Width, 264);
  754. ind++;update_ind(); return;
  755. }
  756. if (ind == 4)
  757. {
  758. this.Size = new Size(this.Size.Width, 304);
  759. ind++;update_ind(); return;
  760. }
  761. if (ind == 5)
  762. {
  763. this.Size = new Size(this.Size.Width, 346);
  764. ind++;update_ind(); return;
  765. }
  766. if (ind == 6)
  767. {
  768. this.Size = new Size(this.Size.Width, 392);
  769. ind++;update_ind(); return;
  770. }
  771. if (ind == 7)
  772. {
  773. this.Size = new Size(this.Size.Width, 432);
  774. ind++;update_ind(); return;
  775. }
  776. if (ind == 8)
  777. {
  778. this.Size = new Size(this.Size.Width, 467);
  779. ind++;update_ind(); return;
  780. }
  781. if (ind == 9)
  782. {
  783. this.Size = new Size(this.Size.Width, 512);
  784. ind++;update_ind(); return;
  785. }
  786.  
  787. }
  788.  
  789. }
  790.  
  791.  
  792.  
  793. private void textjos2_Click(object sender, EventArgs e)
  794. {
  795. if (smoth)
  796. {
  797. timer1.Stop();
  798. timer2.Stop();
  799. timer2.Start();
  800. }
  801. else
  802. {
  803. timer1.Stop();
  804. timer2.Stop();
  805.  
  806. if (ind == 10)
  807. {
  808. this.Size = new Size(this.Size.Width, 467);
  809. ind--;update_ind();
  810. return;
  811. }
  812. if (ind == 9)
  813. {
  814. this.Size = new Size(this.Size.Width, 432);
  815. ind--;update_ind();
  816. return;
  817. }
  818. if (ind == 8)
  819. {
  820. this.Size = new Size(this.Size.Width, 392);
  821. ind--;update_ind();
  822. return;
  823. }
  824. if (ind == 7)
  825. {
  826. this.Size = new Size(this.Size.Width, 346);
  827. ind--;update_ind();
  828. return;
  829. }
  830. if (ind == 6)
  831. {
  832. this.Size = new Size(this.Size.Width, 304);
  833. ind--;update_ind();
  834. return;
  835. }
  836. if (ind == 5)
  837. {
  838. this.Size = new Size(this.Size.Width, 264);
  839. ind--;update_ind();
  840. return;
  841. }
  842. if (ind == 4)
  843. {
  844. this.Size = new Size(this.Size.Width, 224);
  845. ind--;update_ind();
  846. return;
  847. }
  848. if (ind == 3)
  849. {
  850. this.Size = new Size(this.Size.Width, 179);
  851. ind--;update_ind();
  852. return;
  853. }
  854. if (ind == 2)
  855. {
  856. this.Size = new Size(this.Size.Width, 134);
  857. ind--;update_ind();
  858. return;
  859. }
  860. }
  861. }
  862.  
  863. private void timer2_Tick(object sender, EventArgs e)
  864. {
  865. in_sus();
  866. }
  867.  
  868. #endregion
  869. #region eventuri intrare, iesire maus jos
  870. private void textjos_MouseEnter(object sender, EventArgs e)
  871. {
  872. this.Cursor = System.Windows.Forms.Cursors.Hand;
  873.  
  874. }
  875. private void toolStripStatusLabel3_Click(object sender, EventArgs e)
  876. {
  877. if (on == true)
  878. {
  879. toolStripStatusLabel3.Text = "Enable binds";
  880. on = false;
  881. }
  882. else
  883. {
  884. toolStripStatusLabel3.Text = "Disable binds";
  885. on = true;
  886. }
  887.  
  888.  
  889. }
  890. private void textjos_MouseLeave(object sender, EventArgs e)
  891. {
  892. this.Cursor = System.Windows.Forms.Cursors.Default;
  893. }
  894.  
  895. private void textjos2_MouseEnter(object sender, EventArgs e)
  896. {
  897. this.Cursor = System.Windows.Forms.Cursors.Hand;
  898. }
  899.  
  900. private void textjos2_MouseLeave(object sender, EventArgs e)
  901. {
  902. this.Cursor = System.Windows.Forms.Cursors.Default;
  903. }
  904. private void toolStripStatusLabel3_MouseEnter(object sender, EventArgs e)
  905. {
  906. this.Cursor = System.Windows.Forms.Cursors.Hand;
  907. }
  908.  
  909. private void toolStripStatusLabel3_MouseLeave(object sender, EventArgs e)
  910. {
  911. this.Cursor = System.Windows.Forms.Cursors.Default;
  912. }
  913.  
  914. #endregion
  915. #region functii smooth / rapid
  916. private void directlyToolStripMenuItem_Click(object sender, EventArgs e)
  917. {
  918. smoth = false;
  919. Properties.Settings.Default.smoth = false;
  920. Properties.Settings.Default.Save();
  921. smoothToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Unchecked ;
  922. directlyToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
  923. }
  924.  
  925. private void smoothToolStripMenuItem_Click(object sender, EventArgs e)
  926. {
  927. smoth = true;
  928. Properties.Settings.Default.smoth = true;
  929. Properties.Settings.Default.Save();
  930. directlyToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Unchecked;
  931. smoothToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
  932. }
  933. #endregion
  934. #region salvare
  935. #region salvare taste
  936. private void textBox30_KeyDown(object sender, KeyEventArgs e)
  937. {
  938. if (e.KeyValue != 13 && e.KeyValue != 16 && e.KeyValue != 17 && e.KeyValue != 18 && e.KeyValue != 27)
  939. {
  940. hk1.Text = e.KeyData.ToString() + "(" + e.KeyValue + ")";
  941. Properties.Settings.Default.tasta1 = e.KeyValue;
  942. if (e.KeyValue == 46)
  943. {
  944. Properties.Settings.Default.tasta1 = 0;
  945. hk1.Text = "None(0)";
  946. }
  947. Properties.Settings.Default.Save();
  948.  
  949. }
  950.  
  951.  
  952. }
  953. private void textBox40_KeyDown(object sender, KeyEventArgs e)
  954. {
  955. if (e.KeyValue != 13 && e.KeyValue != 16 && e.KeyValue != 17 && e.KeyValue != 18 && e.KeyValue != 27)
  956. {
  957. hk2.Text = e.KeyData.ToString() + "(" + e.KeyValue + ")";
  958.  
  959. Properties.Settings.Default.tasta2 = e.KeyValue;
  960. if (e.KeyValue == 46)
  961. {
  962. Properties.Settings.Default.tasta2 = 0; hk2.Text = "None(0)";
  963. }
  964. Properties.Settings.Default.Save();
  965. }
  966. }
  967. private void textBox29_KeyDown(object sender, KeyEventArgs e)
  968. {
  969. if (e.KeyValue != 13 && e.KeyValue != 16 && e.KeyValue != 17 && e.KeyValue != 18 && e.KeyValue != 27)
  970. {
  971. hk3.Text = e.KeyData.ToString() + "(" + e.KeyValue + ")";
  972. Properties.Settings.Default.tasta3 = e.KeyValue;
  973. if (e.KeyValue == 46)
  974. {
  975. Properties.Settings.Default.tasta3 = 0;
  976. hk3.Text = "None(0)";
  977. } Properties.Settings.Default.Save();
  978. }
  979. }
  980. private void textBox39_KeyDown(object sender, KeyEventArgs e)
  981. {
  982. if (e.KeyValue != 13 && e.KeyValue != 16 && e.KeyValue != 17 && e.KeyValue != 18 && e.KeyValue != 27)
  983. {
  984. hk4.Text = e.KeyData.ToString() + "(" + e.KeyValue + ")";
  985. Properties.Settings.Default.tasta4 = e.KeyValue;
  986. if (e.KeyValue == 46)
  987. {
  988. Properties.Settings.Default.tasta4 = 0;
  989. hk4.Text = "None(0)";
  990. }
  991. Properties.Settings.Default.Save();
  992. }
  993. }
  994. private void textBox28_KeyDown(object sender, KeyEventArgs e)
  995. {
  996. if (e.KeyValue != 13 && e.KeyValue != 16 && e.KeyValue != 17 && e.KeyValue != 18 && e.KeyValue != 27)
  997. {
  998. hk5.Text = e.KeyData.ToString() + "(" + e.KeyValue + ")";
  999. Properties.Settings.Default.tasta5 = e.KeyValue;
  1000. if (e.KeyValue == 46)
  1001. {
  1002. Properties.Settings.Default.tasta5 = 0;
  1003. hk5.Text = "None(0)";
  1004. }
  1005. Properties.Settings.Default.Save();
  1006. }
  1007. }
  1008. private void textBox38_KeyDown(object sender, KeyEventArgs e)
  1009. {
  1010. if (e.KeyValue != 13 && e.KeyValue != 16 && e.KeyValue != 17 && e.KeyValue != 18 && e.KeyValue != 27)
  1011. {
  1012. hk6.Text = e.KeyData.ToString() + "(" + e.KeyValue + ")";
  1013. Properties.Settings.Default.tasta6 = e.KeyValue;
  1014. if (e.KeyValue == 46) { Properties.Settings.Default.tasta6 = 0; hk6.Text = "None(0)"; }
  1015. Properties.Settings.Default.Save();
  1016. }
  1017. }
  1018. private void textBox27_KeyDown(object sender, KeyEventArgs e)
  1019. {
  1020. if (e.KeyValue != 13 && e.KeyValue != 16 && e.KeyValue != 17 && e.KeyValue != 18 && e.KeyValue != 27)
  1021. {
  1022. hk7.Text = e.KeyData.ToString() + "(" + e.KeyValue + ")";
  1023. Properties.Settings.Default.tasta7 = e.KeyValue;
  1024. if (e.KeyValue == 46) { Properties.Settings.Default.tasta7 = 0; hk7.Text = "None(0)"; } Properties.Settings.Default.Save();
  1025. }
  1026. }
  1027. private void textBox37_KeyDown(object sender, KeyEventArgs e)
  1028. {
  1029. if (e.KeyValue != 13 && e.KeyValue != 16 && e.KeyValue != 17 && e.KeyValue != 18 && e.KeyValue != 27)
  1030. {
  1031. hk8.Text = e.KeyData.ToString() + "(" + e.KeyValue + ")";
  1032. Properties.Settings.Default.tasta8 = e.KeyValue;
  1033. if (e.KeyValue == 46) { Properties.Settings.Default.tasta8 = 0; hk8.Text = "None(0)"; } Properties.Settings.Default.Save();
  1034. }
  1035. }
  1036. private void textBox26_KeyDown(object sender, KeyEventArgs e)
  1037. {
  1038. if (e.KeyValue != 13 && e.KeyValue != 16 && e.KeyValue != 17 && e.KeyValue != 18 && e.KeyValue != 27)
  1039. {
  1040. hk9.Text = e.KeyData.ToString() + "(" + e.KeyValue + ")";
  1041. Properties.Settings.Default.tasta9 = e.KeyValue;
  1042. if (e.KeyValue == 46) { Properties.Settings.Default.tasta9 = 0; hk9.Text = "None(0)"; } Properties.Settings.Default.Save();
  1043. }
  1044. }
  1045. private void textBox36_KeyDown(object sender, KeyEventArgs e)
  1046. {
  1047. if (e.KeyValue != 13 && e.KeyValue != 16 && e.KeyValue != 17 && e.KeyValue != 18 && e.KeyValue != 27)
  1048. {
  1049. hk10.Text = e.KeyData.ToString() + "(" + e.KeyValue + ")";
  1050. Properties.Settings.Default.tasta10 = e.KeyValue;
  1051. if (e.KeyValue == 46) { Properties.Settings.Default.tasta10 = 0; hk10.Text = "None(0)"; } Properties.Settings.Default.Save();
  1052. }
  1053. }
  1054. private void textBox25_KeyDown(object sender, KeyEventArgs e)
  1055. {
  1056. if (e.KeyValue != 13 && e.KeyValue != 16 && e.KeyValue != 17 && e.KeyValue != 18 && e.KeyValue != 27)
  1057. {
  1058. hk11.Text = e.KeyData.ToString() + "(" + e.KeyValue + ")";
  1059. Properties.Settings.Default.tasta11 = e.KeyValue;
  1060. if (e.KeyValue == 46) { Properties.Settings.Default.tasta11 = 0; hk11.Text = "None(0)"; } Properties.Settings.Default.Save();
  1061. }
  1062. }
  1063. private void textBox35_KeyDown(object sender, KeyEventArgs e)
  1064. {
  1065. if (e.KeyValue != 13 && e.KeyValue != 16 && e.KeyValue != 17 && e.KeyValue != 18 && e.KeyValue != 27)
  1066. {
  1067. hk12.Text = e.KeyData.ToString() + "(" + e.KeyValue + ")";
  1068. Properties.Settings.Default.tasta12 = e.KeyValue;
  1069. if (e.KeyValue == 46) { Properties.Settings.Default.tasta12 = 0; hk12.Text = "None(0)"; } Properties.Settings.Default.Save();
  1070. }
  1071. }
  1072. private void textBox24_KeyDown(object sender, KeyEventArgs e)
  1073. {
  1074. if (e.KeyValue != 13 && e.KeyValue != 16 && e.KeyValue != 17 && e.KeyValue != 18 && e.KeyValue != 27)
  1075. {
  1076. hk13.Text = e.KeyData.ToString() + "(" + e.KeyValue + ")";
  1077. Properties.Settings.Default.tasta13 = e.KeyValue;
  1078. if (e.KeyValue == 46) { Properties.Settings.Default.tasta13 = 0; hk13.Text = "None(0)"; } Properties.Settings.Default.Save();
  1079. }
  1080. }
  1081. private void textBox34_KeyDown(object sender, KeyEventArgs e)
  1082. {
  1083. if (e.KeyValue != 13 && e.KeyValue != 16 && e.KeyValue != 17 && e.KeyValue != 18 && e.KeyValue != 27)
  1084. {
  1085. hk14.Text = e.KeyData.ToString() + "(" + e.KeyValue + ")";
  1086. Properties.Settings.Default.tasta14 = e.KeyValue;
  1087. if (e.KeyValue == 46) { Properties.Settings.Default.tasta14 = 0; hk14.Text = "None(0)"; } Properties.Settings.Default.Save();
  1088. }
  1089. }
  1090. private void textBox23_KeyDown(object sender, KeyEventArgs e)
  1091. {
  1092. if (e.KeyValue != 13 && e.KeyValue != 16 && e.KeyValue != 17 && e.KeyValue != 18 && e.KeyValue != 27)
  1093. {
  1094. hk15.Text = e.KeyData.ToString() + "(" + e.KeyValue + ")";
  1095. Properties.Settings.Default.tasta15 = e.KeyValue;
  1096. if (e.KeyValue == 46) { Properties.Settings.Default.tasta15 = 0; hk15.Text = "None(0)"; } Properties.Settings.Default.Save();
  1097. }
  1098. }
  1099. private void textBox33_KeyDown(object sender, KeyEventArgs e)
  1100. {
  1101. if (e.KeyValue != 13 && e.KeyValue != 16 && e.KeyValue != 17 && e.KeyValue != 18 && e.KeyValue != 27)
  1102. {
  1103. hk16.Text = e.KeyData.ToString() + "(" + e.KeyValue + ")";
  1104. Properties.Settings.Default.tasta16 = e.KeyValue;
  1105. if (e.KeyValue == 46) { hk16.Text = "None(0)"; Properties.Settings.Default.tasta16 = 0; } Properties.Settings.Default.Save();
  1106. }
  1107. }
  1108. private void textBox22_KeyDown(object sender, KeyEventArgs e)
  1109. {
  1110. if (e.KeyValue != 13 && e.KeyValue != 16 && e.KeyValue != 17 && e.KeyValue != 18 && e.KeyValue != 27)
  1111. {
  1112. hk17.Text = e.KeyData.ToString() + "(" + e.KeyValue + ")";
  1113. Properties.Settings.Default.tasta17 = e.KeyValue;
  1114. if (e.KeyValue == 46) { hk17.Text = "None(0)"; Properties.Settings.Default.tasta17 = 0; } Properties.Settings.Default.Save();
  1115. }
  1116. }
  1117. private void textBox32_KeyDown(object sender, KeyEventArgs e)
  1118. {
  1119. if (e.KeyValue != 13 && e.KeyValue != 16 && e.KeyValue != 17 && e.KeyValue != 18 && e.KeyValue != 27)
  1120. {
  1121. hk18.Text = e.KeyData.ToString() + "(" + e.KeyValue + ")";
  1122. Properties.Settings.Default.tasta18 = e.KeyValue;
  1123. if (e.KeyValue == 46) { hk18.Text = "None(0)"; Properties.Settings.Default.tasta18 = 0; } Properties.Settings.Default.Save();
  1124. }
  1125. }
  1126. private void textBox21_KeyDown(object sender, KeyEventArgs e)
  1127. {
  1128. if (e.KeyValue != 13 && e.KeyValue != 16 && e.KeyValue != 17 && e.KeyValue != 18 && e.KeyValue != 27)
  1129. {
  1130. hk19.Text = e.KeyData.ToString() + "(" + e.KeyValue + ")";
  1131. Properties.Settings.Default.tasta19 = e.KeyValue;
  1132. if (e.KeyValue == 46) { hk19.Text = "None(0)"; Properties.Settings.Default.tasta19 = 0; } Properties.Settings.Default.Save();
  1133. }
  1134. }
  1135. private void textBox31_KeyDown(object sender, KeyEventArgs e)
  1136. {
  1137. if (e.KeyValue != 13 && e.KeyValue != 16 && e.KeyValue != 17 && e.KeyValue != 18 && e.KeyValue != 27)
  1138. {
  1139. hk20.Text = e.KeyData.ToString() + "(" + e.KeyValue + ")";
  1140. Properties.Settings.Default.tasta20 = e.KeyValue;
  1141. if (e.KeyValue == 46) { hk20.Text = "None(0)"; Properties.Settings.Default.tasta20 = 0; } Properties.Settings.Default.Save();
  1142. }
  1143. }
  1144.  
  1145. #endregion
  1146. #region salvare text
  1147. private void textBox1_TextChanged(object sender, EventArgs e)
  1148. {
  1149. Properties.Settings.Default.text1 = text1.Text;
  1150. Properties.Settings.Default.Save();
  1151. }
  1152. private void textBox11_TextChanged(object sender, EventArgs e)
  1153. {
  1154. Properties.Settings.Default.text2 = text2.Text;
  1155. Properties.Settings.Default.Save();
  1156. }
  1157. private void textBox2_TextChanged(object sender, EventArgs e)
  1158. {
  1159. Properties.Settings.Default.text3 = text3.Text;
  1160. Properties.Settings.Default.Save();
  1161. }
  1162. private void textBox12_TextChanged(object sender, EventArgs e)
  1163. {
  1164. Properties.Settings.Default.text4 = text4.Text;
  1165. Properties.Settings.Default.Save();
  1166. }
  1167. private void textBox3_TextChanged(object sender, EventArgs e)
  1168. {
  1169. Properties.Settings.Default.text5 = text5.Text;
  1170. Properties.Settings.Default.Save();
  1171. }
  1172. private void textBox13_TextChanged(object sender, EventArgs e)
  1173. {
  1174. Properties.Settings.Default.text6 = text6.Text;
  1175. Properties.Settings.Default.Save();
  1176. }
  1177. private void textBox4_TextChanged(object sender, EventArgs e)
  1178. {
  1179. Properties.Settings.Default.text7 = text7.Text;
  1180. Properties.Settings.Default.Save();
  1181. }
  1182. private void textBox14_TextChanged(object sender, EventArgs e)
  1183. {
  1184. Properties.Settings.Default.text8 = text8.Text;
  1185. Properties.Settings.Default.Save();
  1186. }
  1187. private void textBox5_TextChanged(object sender, EventArgs e)
  1188. {
  1189. Properties.Settings.Default.text9 = text9.Text;
  1190. Properties.Settings.Default.Save();
  1191. }
  1192. private void textBox15_TextChanged(object sender, EventArgs e)
  1193. {
  1194. Properties.Settings.Default.text10 = text10.Text;
  1195. Properties.Settings.Default.Save();
  1196. }
  1197. private void textBox6_TextChanged(object sender, EventArgs e)
  1198. {
  1199. Properties.Settings.Default.text11 = text11.Text;
  1200. Properties.Settings.Default.Save();
  1201. }
  1202. private void textBox16_TextChanged(object sender, EventArgs e)
  1203. {
  1204. Properties.Settings.Default.text12 = text12.Text;
  1205. Properties.Settings.Default.Save();
  1206. }
  1207. private void textBox7_TextChanged(object sender, EventArgs e)
  1208. {
  1209. Properties.Settings.Default.text13 = text13.Text;
  1210. Properties.Settings.Default.Save();
  1211. }
  1212. private void textBox17_TextChanged(object sender, EventArgs e)
  1213. {
  1214. Properties.Settings.Default.text14 = text14.Text;
  1215. Properties.Settings.Default.Save();
  1216. }
  1217. private void textBox8_TextChanged(object sender, EventArgs e)
  1218. {
  1219. Properties.Settings.Default.text15 = text15.Text;
  1220. Properties.Settings.Default.Save();
  1221. }
  1222. private void textBox18_TextChanged(object sender, EventArgs e)
  1223. {
  1224. Properties.Settings.Default.text16= text16.Text;
  1225. Properties.Settings.Default.Save();
  1226. }
  1227. private void textBox9_TextChanged(object sender, EventArgs e)
  1228. {
  1229. Properties.Settings.Default.text17 = text17.Text;
  1230. Properties.Settings.Default.Save();
  1231. }
  1232. private void textBox19_TextChanged(object sender, EventArgs e)
  1233. {
  1234. Properties.Settings.Default.text18 = text18.Text;
  1235. Properties.Settings.Default.Save();
  1236. }
  1237. private void textBox10_TextChanged(object sender, EventArgs e)
  1238. {
  1239. Properties.Settings.Default.text19 = text19.Text;
  1240. Properties.Settings.Default.Save();
  1241. }
  1242. private void textBox20_TextChanged(object sender, EventArgs e)
  1243. {
  1244. Properties.Settings.Default.text20 = text20.Text;
  1245. Properties.Settings.Default.Save();
  1246. }
  1247. #endregion
  1248. #endregion
  1249. #region functii gta/anywin
  1250. private void anyWindowToolStripMenuItem_Click(object sender, EventArgs e)
  1251. {
  1252. doar_gta = true;
  1253. Properties.Settings.Default.doargta = true;
  1254. Properties.Settings.Default.Save();
  1255. justgta.CheckState = System.Windows.Forms.CheckState.Checked;
  1256. anywin.CheckState = System.Windows.Forms.CheckState.Unchecked;
  1257. }
  1258.  
  1259. private void anyWindowToolStripMenuItem1_Click(object sender, EventArgs e)
  1260. {
  1261. doar_gta = false;
  1262. Properties.Settings.Default.doargta = false;
  1263. Properties.Settings.Default.Save();
  1264. anywin.CheckState = System.Windows.Forms.CheckState.Checked;
  1265. justgta.CheckState = System.Windows.Forms.CheckState.Unchecked;
  1266. }
  1267. #endregion
  1268.  
  1269.  
  1270. private void update_Tick(object sender, EventArgs e)
  1271. {
  1272. #region Chat Deschis / Inchis
  1273. IntPtr a = GetForegroundWindow();
  1274. IntPtr b = FindWindow(null, "GTA:SA:MP");
  1275. if (a == b)
  1276. {
  1277.  
  1278.  
  1279. if (TT == false)
  1280. if (pressed(Keys.T))
  1281. {
  1282. TT = true;
  1283. }
  1284. if (TT)
  1285. if (!pressed(Keys.T))
  1286. {
  1287. TT = false; chat_inchis = false;
  1288. }
  1289. if (tastaESC == false)
  1290. if (pressed(Keys.Escape))
  1291. {
  1292. tastaESC = true;
  1293. }
  1294. if (tastaESC)
  1295. if (!pressed(Keys.Escape))
  1296. {
  1297. tastaESC = false; chat_inchis = true;
  1298. }
  1299.  
  1300. if (tastaENTER == false)
  1301. if (pressed(Keys.Return))
  1302. {
  1303. tastaENTER = true;
  1304. }
  1305. if (tastaENTER)
  1306. if (!pressed(Keys.Return))
  1307. {
  1308. tastaENTER = false; chat_inchis = true;
  1309. }
  1310.  
  1311. }
  1312. else
  1313. chat_inchis = true;
  1314. #endregion
  1315. #region regkeys
  1316. regkeys(1, Properties.Settings.Default.tasta1, bind1);
  1317. regkeys(2, Properties.Settings.Default.tasta2, bind2);
  1318. regkeys(3, Properties.Settings.Default.tasta3, bind3);
  1319. regkeys(4, Properties.Settings.Default.tasta4, bind4);
  1320. regkeys(5, Properties.Settings.Default.tasta5, bind5);
  1321. regkeys(6, Properties.Settings.Default.tasta6, bind6);
  1322. regkeys(7, Properties.Settings.Default.tasta7, bind7);
  1323. regkeys(8, Properties.Settings.Default.tasta8, bind8);
  1324. regkeys(9, Properties.Settings.Default.tasta9, bind9);
  1325. regkeys(10, Properties.Settings.Default.tasta10, bind10);
  1326. regkeys(11, Properties.Settings.Default.tasta11, bind11);
  1327. regkeys(12, Properties.Settings.Default.tasta12, bind12);
  1328. regkeys(13, Properties.Settings.Default.tasta13, bind13);
  1329. regkeys(14, Properties.Settings.Default.tasta14, bind14);
  1330. regkeys(15, Properties.Settings.Default.tasta15, bind15);
  1331. regkeys(16, Properties.Settings.Default.tasta16, bind16);
  1332. regkeys(17, Properties.Settings.Default.tasta17, bind17);
  1333. regkeys(18, Properties.Settings.Default.tasta18, bind18);
  1334. regkeys(19, Properties.Settings.Default.tasta19, bind19);
  1335. regkeys(20, Properties.Settings.Default.tasta20, bind20);
  1336. #endregion
  1337. #region true /false
  1338. if (Properties.Settings.Default.tasta1 != 0)
  1339. bind1 = true;
  1340. else bind1 = false;
  1341. if (Properties.Settings.Default.tasta2 != 0)
  1342. bind2 = true;
  1343. else bind2 = false;
  1344. if (Properties.Settings.Default.tasta3 != 0 && ind>=2)
  1345. bind3 = true;
  1346. else bind3 = false;
  1347. if (Properties.Settings.Default.tasta4 != 0 && ind >= 2)
  1348. bind4 = true;
  1349. else bind4 = false;
  1350. if (Properties.Settings.Default.tasta5 != 0 && ind >= 3)
  1351. bind5 = true;
  1352. else bind5 = false;
  1353. if (Properties.Settings.Default.tasta6 != 0 && ind >= 3)
  1354. bind6 = true;
  1355. else bind6 = false;
  1356. if (Properties.Settings.Default.tasta7 != 0 && ind >= 4)
  1357. bind7 = true;
  1358. else bind7 = false;
  1359. if (Properties.Settings.Default.tasta8 != 0 && ind >= 4)
  1360. bind8 = true;
  1361. else bind8 = false;
  1362. if (Properties.Settings.Default.tasta9 != 0 && ind >= 5)
  1363. bind9 = true;
  1364. else bind9 = false;
  1365. if (Properties.Settings.Default.tasta10 != 0 && ind >= 5)
  1366. bind10 = true;
  1367. else bind10 = false;
  1368. if (Properties.Settings.Default.tasta11 != 0 && ind >= 6)
  1369. bind11 = true;
  1370. else bind11 = false;
  1371. if (Properties.Settings.Default.tasta12 != 0 && ind >= 6)
  1372. bind12 = true;
  1373. else bind12 = false;
  1374. if (Properties.Settings.Default.tasta13 != 0 && ind >= 7)
  1375. bind13 = true;
  1376. else bind13 = false;
  1377. if (Properties.Settings.Default.tasta14 != 0 && ind >= 7)
  1378. bind14 = true;
  1379. else bind14 = false;
  1380. if (Properties.Settings.Default.tasta15 != 0 && ind >= 8)
  1381. bind15 = true;
  1382. else bind15 = false;
  1383. if (Properties.Settings.Default.tasta16 != 0 && ind >= 8)
  1384. bind16 = true;
  1385. else bind16 = false;
  1386. if (Properties.Settings.Default.tasta17 != 0 && ind >= 9)
  1387. bind17 = true;
  1388. else bind17 = false;
  1389. if (Properties.Settings.Default.tasta18 != 0 && ind >= 9)
  1390. bind18 = true;
  1391. else bind18 = false;
  1392. if (Properties.Settings.Default.tasta19 != 0 && ind >= 10)
  1393. bind19 = true;
  1394. else bind19 = false;
  1395. if (Properties.Settings.Default.tasta20 != 0 && ind >= 10)
  1396. bind20 = true;
  1397. else bind20 = false;
  1398. #endregion
  1399. #region old,useless
  1400. /*
  1401. bool ok = false;
  1402. IntPtr a = GetForegroundWindow();
  1403. IntPtr b = FindWindow(null, "Untitled - Notepad");
  1404. if (a == b)
  1405. ok = true;
  1406.  
  1407. if(doar_gta)
  1408. if (bind1 && ok)
  1409. {
  1410.  
  1411. RegisterHotKey(this.Handle, 1, nimic, (uint)((Keys)Properties.Settings.Default.tasta1));
  1412. }
  1413. else
  1414. UnregisterHotKey(this.Handle, 1);
  1415. else
  1416. if (bind1)
  1417. {
  1418.  
  1419. RegisterHotKey(this.Handle, 1, nimic, (uint)((Keys)Properties.Settings.Default.tasta1));
  1420. }
  1421. else
  1422. UnregisterHotKey(this.Handle, 1);
  1423. * */
  1424. #endregion
  1425.  
  1426.  
  1427. }
  1428. protected override void WndProc(ref Message m)
  1429. {
  1430. base.WndProc(ref m);
  1431. if (m.Msg == WM_HOTKEY)
  1432. {
  1433. switch ((short)m.WParam)
  1434. {
  1435. #region cazurile (20, 20 textbox-uri)
  1436. case 1: caz(text1.Text); break;
  1437. case 2: caz(text2.Text); break;
  1438. case 3: caz(text3.Text); break;
  1439. case 4: caz(text4.Text); break;
  1440. case 5: caz(text5.Text); break;
  1441. case 6: caz(text6.Text); break;
  1442. case 7: caz(text7.Text); break;
  1443. case 8: caz(text8.Text); break;
  1444. case 9: caz(text9.Text); break;
  1445. case 10: caz(text10.Text); break;
  1446. case 11: caz(text11.Text); break;
  1447. case 12: caz(text12.Text); break;
  1448. case 13: caz(text13.Text); break;
  1449. case 14: caz(text14.Text); break;
  1450. case 15: caz(text15.Text); break;
  1451. case 16: caz(text16.Text); break;
  1452. case 17: caz(text17.Text); break;
  1453. case 18: caz(text18.Text); break;
  1454. case 19: caz(text19.Text); break;
  1455. case 20: caz(text20.Text); break;
  1456.  
  1457. #endregion
  1458.  
  1459. }
  1460. }
  1461. }
  1462.  
  1463.  
  1464. #region file
  1465. private void saveCurentBindsToolStripMenuItem_Click(object sender, EventArgs e)
  1466. {
  1467. string t = "";
  1468. string s = Environment.NewLine;
  1469. t += text1.Text + s;
  1470. t += Properties.Settings.Default.tasta1.ToString()+s;
  1471. t += text2.Text + s;
  1472. t += Properties.Settings.Default.tasta2.ToString() + s;
  1473. t += text3.Text + s;
  1474. t += Properties.Settings.Default.tasta3.ToString() + s;
  1475. t += text4.Text + s;
  1476. t += Properties.Settings.Default.tasta4.ToString() + s;
  1477. t += text5.Text + s;
  1478. t += Properties.Settings.Default.tasta5.ToString() + s;
  1479. t += text6.Text + s;
  1480. t += Properties.Settings.Default.tasta6.ToString() + s;
  1481. t += text7.Text + s;
  1482. t += Properties.Settings.Default.tasta7.ToString() + s;
  1483. t += text8.Text + s;
  1484. t += Properties.Settings.Default.tasta8.ToString() + s;
  1485. t += text9.Text + s;
  1486. t += Properties.Settings.Default.tasta9.ToString() + s;
  1487. t += text10.Text + s;
  1488. t += Properties.Settings.Default.tasta10.ToString() + s;
  1489. t += text11.Text + s;
  1490. t += Properties.Settings.Default.tasta11.ToString() + s;
  1491. t += text12.Text + s;
  1492. t += Properties.Settings.Default.tasta12.ToString() + s;
  1493. t += text13.Text + s;
  1494. t += Properties.Settings.Default.tasta13.ToString() + s;
  1495. t += text14.Text + s;
  1496. t += Properties.Settings.Default.tasta14.ToString() + s;
  1497. t += text15.Text + s;
  1498. t += Properties.Settings.Default.tasta15.ToString() + s;
  1499. t += text16.Text + s;
  1500. t += Properties.Settings.Default.tasta16.ToString() + s;
  1501. t += text17.Text + s;
  1502. t += Properties.Settings.Default.tasta17.ToString() + s;
  1503. t += text18.Text + s;
  1504. t += Properties.Settings.Default.tasta18.ToString() + s;
  1505. t += text19.Text + s;
  1506. t += Properties.Settings.Default.tasta19.ToString() + s;
  1507. t += text20.Text + s;
  1508. t += Properties.Settings.Default.tasta20.ToString() + s;
  1509. save.ShowDialog();
  1510. try
  1511. {
  1512. if (save.FileName != "")
  1513. {
  1514. StreamWriter sr = new StreamWriter(save.FileName);
  1515. sr.Write(t);
  1516. sr.Close();
  1517. }
  1518. }
  1519. catch (Exception ex)
  1520. {
  1521. MessageBox.Show("We couldn't save the binds", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
  1522.  
  1523. }
  1524.  
  1525. }
  1526.  
  1527. private void exitToolStripMenuItem_Click(object sender, EventArgs e)
  1528. {
  1529. this.Close();
  1530. }
  1531.  
  1532.  
  1533. private void openSavedBindsToolStripMenuItem_Click(object sender, EventArgs e)
  1534. {
  1535. open.ShowDialog();
  1536.  
  1537.  
  1538.  
  1539.  
  1540.  
  1541. }
  1542.  
  1543. #endregion
  1544.  
  1545. private void label1_Click(object sender, EventArgs e)
  1546. {
  1547.  
  1548. }
  1549.  
  1550. private void label2_Click(object sender, EventArgs e)
  1551. {
  1552.  
  1553. }
  1554.  
  1555. private void label4_Click(object sender, EventArgs e)
  1556. {
  1557.  
  1558. }
  1559.  
  1560. private void label3_Click(object sender, EventArgs e)
  1561. {
  1562.  
  1563. }
  1564. #region t enter
  1565. private void label5_Click(object sender, EventArgs e)
  1566. {
  1567. if (!text1.Text.ToUpper().Contains("{ENTER}"))
  1568.  
  1569. text1.Text += "{ENTER}";
  1570. if (text1.Text != "")
  1571. if (text1.Text[0].ToString() != "t")
  1572. text1.Text = "t"+text1.Text;
  1573.  
  1574.  
  1575. }
  1576.  
  1577. private void label6_Click(object sender, EventArgs e)
  1578. {
  1579. if (!text3.Text.ToUpper().Contains("{ENTER}"))
  1580.  
  1581. text3.Text += "{ENTER}";
  1582. if (text3.Text != "")
  1583. if (text3.Text[0].ToString() != "t")
  1584. text3.Text = "t" + text3.Text;
  1585.  
  1586.  
  1587. }
  1588.  
  1589. private void label8_Click(object sender, EventArgs e)
  1590. {
  1591. if (!text5.Text.ToUpper().Contains("{ENTER}"))
  1592.  
  1593. text5.Text += "{ENTER}";
  1594. if (text5.Text != "")
  1595. if (text5.Text[0].ToString() != "t")
  1596. text5.Text = "t" + text5.Text;
  1597.  
  1598.  
  1599. }
  1600.  
  1601. private void label7_Click(object sender, EventArgs e)
  1602. {
  1603. if (!text7.Text.ToUpper().Contains("{ENTER}"))
  1604.  
  1605. text7.Text += "{ENTER}";
  1606. if (text7.Text != "")
  1607. if (text7.Text[0].ToString() != "t")
  1608. text7.Text = "t" + text7.Text;
  1609.  
  1610.  
  1611. }
  1612.  
  1613. private void label12_Click(object sender, EventArgs e)
  1614. {
  1615. if (!text9.Text.ToUpper().Contains("{ENTER}"))
  1616.  
  1617. text9.Text += "{ENTER}";
  1618.  
  1619.  
  1620. if (text9.Text != "")
  1621. if (text9.Text[0].ToString() != "t")
  1622. text9.Text = "t" + text9.Text;
  1623.  
  1624. }
  1625.  
  1626. private void label11_Click(object sender, EventArgs e)
  1627. {
  1628.  
  1629.  
  1630.  
  1631. if (!text11.Text.ToUpper().Contains("{ENTER}"))
  1632.  
  1633. text11.Text += "{ENTER}";
  1634. if (text11.Text != "")
  1635. if (text11.Text[0].ToString() != "t")
  1636. text11.Text = "t" + text11.Text;
  1637. }
  1638.  
  1639. private void label10_Click(object sender, EventArgs e)
  1640. {
  1641.  
  1642.  
  1643.  
  1644. if (!text13.Text.ToUpper().Contains("{ENTER}"))
  1645.  
  1646. text13.Text += "{ENTER}";
  1647. if (text13.Text != "")
  1648. if (text13.Text[0].ToString() != "t")
  1649. text13.Text = "t" + text13.Text;
  1650. }
  1651.  
  1652. private void label9_Click(object sender, EventArgs e)
  1653. {
  1654.  
  1655.  
  1656.  
  1657. if (!text15.Text.ToUpper().Contains("{ENTER}"))
  1658.  
  1659. text15.Text += "{ENTER}";
  1660. if (text15.Text != "")
  1661. if (text15.Text[0].ToString() != "t")
  1662. text15.Text = "t" + text15.Text;
  1663. }
  1664.  
  1665. private void label14_Click(object sender, EventArgs e)
  1666. {
  1667. if (!text17.Text.ToUpper().Contains("{ENTER}"))
  1668.  
  1669. text17.Text += "{ENTER}";
  1670. if (text17.Text != "")
  1671. if (text17.Text[0].ToString() != "t")
  1672. text17.Text = "t" + text17.Text;
  1673. }
  1674.  
  1675. private void label13_Click(object sender, EventArgs e)
  1676. {
  1677. if (!text19.Text.ToUpper().Contains("{ENTER}"))
  1678.  
  1679. text19.Text += "{ENTER}";
  1680. if (text19.Text != "")
  1681. if (text19.Text[0].ToString() != "t")
  1682. text19.Text = "t" + text19.Text;
  1683. }
  1684.  
  1685. private void label24_Click(object sender, EventArgs e)
  1686. {
  1687. if (!text2.Text.ToUpper().Contains("{ENTER}"))
  1688.  
  1689. text2.Text += "{ENTER}";
  1690. if (text2.Text != "")
  1691. if (text2.Text[0].ToString() != "t")
  1692. text2.Text = "t" + text2.Text;
  1693. }
  1694.  
  1695. private void label23_Click(object sender, EventArgs e)
  1696. {
  1697. if (!text4.Text.ToUpper().Contains("{ENTER}"))
  1698.  
  1699. text4.Text += "{ENTER}";
  1700. if (text4.Text != "")
  1701. if (text4.Text[0].ToString() != "t")
  1702. text4.Text = "t" + text4.Text;
  1703. }
  1704.  
  1705. private void label22_Click(object sender, EventArgs e)
  1706. {
  1707. if (!text6.Text.ToUpper().Contains("{ENTER}"))
  1708.  
  1709. text6.Text += "{ENTER}";
  1710. if (text6.Text != "")
  1711. if (text6.Text[0].ToString() != "t")
  1712. text6.Text = "t" + text6.Text;
  1713. }
  1714.  
  1715. private void label21_Click(object sender, EventArgs e)
  1716. {
  1717. if (!text8.Text.ToUpper().Contains("{ENTER}"))
  1718.  
  1719. text8.Text += "{ENTER}";
  1720. if (text8.Text != "")
  1721. if (text8.Text[0].ToString() != "t")
  1722. text8.Text = "t" + text8.Text;
  1723. }
  1724.  
  1725. private void label20_Click(object sender, EventArgs e)
  1726. {
  1727. if (!text10.Text.ToUpper().Contains("{ENTER}"))
  1728.  
  1729. text10.Text += "{ENTER}";
  1730. if (text10.Text != "")
  1731. if (text10.Text[0].ToString() != "t")
  1732. text10.Text = "t" + text10.Text;
  1733. }
  1734.  
  1735. private void label19_Click(object sender, EventArgs e)
  1736. {
  1737. if (!text12.Text.ToUpper().Contains("{ENTER}"))
  1738.  
  1739. text12.Text += "{ENTER}";
  1740. if (text12.Text != "")
  1741. if (text12.Text[0].ToString() != "t")
  1742. text12.Text = "t" + text12.Text;
  1743. }
  1744.  
  1745. private void label18_Click(object sender, EventArgs e)
  1746. {
  1747. if (!text14.Text.ToUpper().Contains("{ENTER}"))
  1748.  
  1749. text14.Text += "{ENTER}";
  1750. if (text14.Text != "")
  1751. if (text14.Text[0].ToString() != "t")
  1752. text14.Text = "t" + text14.Text;
  1753. }
  1754.  
  1755. private void label17_Click(object sender, EventArgs e)
  1756. {
  1757. if (!text16.Text.ToUpper().Contains("{ENTER}"))
  1758.  
  1759. text16.Text += "{ENTER}";
  1760. if (text16.Text != "")
  1761. if (text16.Text[0].ToString() != "t")
  1762. text16.Text = "t" + text16.Text;
  1763. }
  1764.  
  1765. private void label16_Click(object sender, EventArgs e)
  1766. {
  1767. if (!text18.Text.ToUpper().Contains("{ENTER}"))
  1768.  
  1769. text18.Text += "{ENTER}";
  1770. if (text18.Text != "")
  1771. if (text18.Text[0].ToString() != "t")
  1772. text18.Text = "t" + text18.Text;
  1773. }
  1774.  
  1775. private void label15_Click(object sender, EventArgs e)
  1776. {
  1777. if (!text20.Text.ToUpper().Contains("{ENTER}"))
  1778.  
  1779. text20.Text += "{ENTER}";
  1780. if (text20.Text != "")
  1781. if (text20.Text[0].ToString() != "t")
  1782. text20.Text = "t" + text20.Text;
  1783. }
  1784. #endregion
  1785.  
  1786. private void save_FileOk(object sender, CancelEventArgs e)
  1787. {
  1788.  
  1789. }
  1790.  
  1791. private void open_FileOk(object sender, CancelEventArgs e)
  1792. {
  1793. try
  1794. {
  1795. int i;
  1796. string ii;
  1797. StreamReader sr = new StreamReader(open.FileName);
  1798. text1.Text = sr.ReadLine();
  1799. i = Convert.ToInt32(sr.ReadLine());
  1800. ii = ((Keys)i).ToString();
  1801. hk1.Text = ii + "(" + i + ")";
  1802. Properties.Settings.Default.tasta1 = i;
  1803. Properties.Settings.Default.Save();
  1804. text2.Text = sr.ReadLine();
  1805. i = Convert.ToInt32(sr.ReadLine());
  1806. ii = ((Keys)i).ToString();
  1807. hk2.Text = ii + "(" + i + ")";
  1808. Properties.Settings.Default.tasta2 = i;
  1809. Properties.Settings.Default.Save();
  1810. text3.Text = sr.ReadLine();
  1811. i = Convert.ToInt32(sr.ReadLine());
  1812. ii = ((Keys)i).ToString();
  1813. hk3.Text = ii + "(" + i + ")";
  1814. Properties.Settings.Default.tasta3 = i;
  1815. Properties.Settings.Default.Save();
  1816. text4.Text = sr.ReadLine();
  1817. i = Convert.ToInt32(sr.ReadLine());
  1818. ii = ((Keys)i).ToString();
  1819. hk4.Text = ii + "(" + i + ")";
  1820. Properties.Settings.Default.tasta4 = i;
  1821. Properties.Settings.Default.Save();
  1822. text5.Text = sr.ReadLine();
  1823. i = Convert.ToInt32(sr.ReadLine());
  1824. ii = ((Keys)i).ToString();
  1825. hk5.Text = ii + "(" + i + ")";
  1826. Properties.Settings.Default.tasta5 = i;
  1827. Properties.Settings.Default.Save();
  1828. text6.Text = sr.ReadLine();
  1829. i = Convert.ToInt32(sr.ReadLine());
  1830. ii = ((Keys)i).ToString();
  1831. hk6.Text = ii + "(" + i + ")";
  1832. Properties.Settings.Default.tasta6 = i;
  1833. Properties.Settings.Default.Save();
  1834. text7.Text = sr.ReadLine();
  1835. i = Convert.ToInt32(sr.ReadLine());
  1836. ii = ((Keys)i).ToString();
  1837. hk7.Text = ii + "(" + i + ")";
  1838. Properties.Settings.Default.tasta7 = i;
  1839. Properties.Settings.Default.Save();
  1840. text8.Text = sr.ReadLine();
  1841. i = Convert.ToInt32(sr.ReadLine());
  1842. ii = ((Keys)i).ToString();
  1843. hk8.Text = ii + "(" + i + ")";
  1844. Properties.Settings.Default.tasta8 = i;
  1845. Properties.Settings.Default.Save();
  1846. text9.Text = sr.ReadLine();
  1847. i = Convert.ToInt32(sr.ReadLine());
  1848. ii = ((Keys)i).ToString();
  1849. hk9.Text = ii + "(" + i + ")";
  1850. Properties.Settings.Default.tasta9 = i;
  1851. Properties.Settings.Default.Save();
  1852. text10.Text = sr.ReadLine();
  1853. i = Convert.ToInt32(sr.ReadLine());
  1854. ii = ((Keys)i).ToString();
  1855. hk10.Text = ii + "(" + i + ")";
  1856. Properties.Settings.Default.tasta10 = i;
  1857. Properties.Settings.Default.Save();
  1858. text11.Text = sr.ReadLine();
  1859. i = Convert.ToInt32(sr.ReadLine());
  1860. ii = ((Keys)i).ToString();
  1861. hk11.Text = ii + "(" + i + ")";
  1862. Properties.Settings.Default.tasta11 = i;
  1863. Properties.Settings.Default.Save();
  1864. text12.Text = sr.ReadLine();
  1865. i = Convert.ToInt32(sr.ReadLine());
  1866. ii = ((Keys)i).ToString();
  1867. hk12.Text = ii + "(" + i + ")";
  1868. Properties.Settings.Default.tasta12 = i;
  1869. Properties.Settings.Default.Save();
  1870. text13.Text = sr.ReadLine();
  1871. i = Convert.ToInt32(sr.ReadLine());
  1872. ii = ((Keys)i).ToString();
  1873. hk13.Text = ii + "(" + i + ")";
  1874. Properties.Settings.Default.tasta13 = i;
  1875. Properties.Settings.Default.Save();
  1876. text14.Text = sr.ReadLine();
  1877. i = Convert.ToInt32(sr.ReadLine());
  1878. ii = ((Keys)i).ToString();
  1879. hk14.Text = ii + "(" + i + ")";
  1880. Properties.Settings.Default.tasta14 = i;
  1881. Properties.Settings.Default.Save();
  1882. text15.Text = sr.ReadLine();
  1883. i = Convert.ToInt32(sr.ReadLine());
  1884. ii = ((Keys)i).ToString();
  1885. hk15.Text = ii + "(" + i + ")";
  1886. Properties.Settings.Default.tasta15 = i;
  1887. Properties.Settings.Default.Save();
  1888. text16.Text = sr.ReadLine();
  1889. i = Convert.ToInt32(sr.ReadLine());
  1890. ii = ((Keys)i).ToString();
  1891. hk16.Text = ii + "(" + i + ")";
  1892. Properties.Settings.Default.tasta16 = i;
  1893. Properties.Settings.Default.Save();
  1894. text17.Text = sr.ReadLine();
  1895. i = Convert.ToInt32(sr.ReadLine());
  1896. ii = ((Keys)i).ToString();
  1897. hk17.Text = ii + "(" + i + ")";
  1898. Properties.Settings.Default.tasta17 = i;
  1899. Properties.Settings.Default.Save();
  1900. text18.Text = sr.ReadLine();
  1901. i = Convert.ToInt32(sr.ReadLine());
  1902. ii = ((Keys)i).ToString();
  1903. hk18.Text = ii + "(" + i + ")";
  1904. Properties.Settings.Default.tasta18 = i;
  1905. Properties.Settings.Default.Save();
  1906. text19.Text = sr.ReadLine();
  1907. i = Convert.ToInt32(sr.ReadLine());
  1908. ii = ((Keys)i).ToString();
  1909. hk19.Text = ii + "(" + i + ")";
  1910. Properties.Settings.Default.tasta19 = i;
  1911. Properties.Settings.Default.Save();
  1912. text20.Text = sr.ReadLine();
  1913. i = Convert.ToInt32(sr.ReadLine());
  1914. ii = ((Keys)i).ToString();
  1915. hk20.Text = ii + "(" + i + ")";
  1916. Properties.Settings.Default.tasta20 = i;
  1917. Properties.Settings.Default.Save();
  1918. }
  1919. catch (Exception ex)
  1920. {
  1921. MessageBox.Show("We couldn't open the binds", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
  1922. }
  1923. }
  1924. bool enab = true;
  1925. private void toolStripStatusLabel5_Click(object sender, EventArgs e)
  1926. {
  1927. if (enab)
  1928. {
  1929. Properties.Settings.Default.enab = false;
  1930. Properties.Settings.Default.Save();
  1931. toolStripStatusLabel5.Text = "Disable Read Only";
  1932. hk1.Enabled = false;
  1933. hk2.Enabled = false;
  1934. hk3.Enabled = false;
  1935. hk4.Enabled = false;
  1936. hk5.Enabled = false;
  1937. hk6.Enabled = false;
  1938. hk7.Enabled = false;
  1939. hk8.Enabled = false;
  1940. hk9.Enabled = false;
  1941. hk10.Enabled = false;
  1942. hk11.Enabled = false;
  1943. hk12.Enabled = false;
  1944. hk13.Enabled = false;
  1945. hk14.Enabled = false;
  1946. hk15.Enabled = false;
  1947. hk16.Enabled = false;
  1948. hk17.Enabled = false;
  1949. hk18.Enabled = false;
  1950. hk19.Enabled = false;
  1951. hk20.Enabled = false;
  1952. text1.Enabled = false;
  1953. text2.Enabled = false;
  1954. text3.Enabled = false;
  1955. text4.Enabled = false;
  1956. text5.Enabled = false;
  1957. text6.Enabled = false;
  1958. text7.Enabled = false;
  1959. text8.Enabled = false;
  1960. text9.Enabled = false;
  1961. text10.Enabled = false;
  1962. text11.Enabled = false;
  1963. text12.Enabled = false;
  1964. text13.Enabled = false;
  1965. text14.Enabled = false;
  1966. text15.Enabled = false;
  1967. text16.Enabled = false;
  1968. text17.Enabled = false;
  1969. text18.Enabled = false;
  1970. text19.Enabled = false;
  1971. text20.Enabled = false;
  1972. enab = false;
  1973. }
  1974. else
  1975. {
  1976. hk1.Enabled = true;
  1977. hk2.Enabled = true;
  1978. hk3.Enabled = true;
  1979. hk4.Enabled = true;
  1980. hk5.Enabled = true;
  1981. hk6.Enabled = true;
  1982. hk7.Enabled = true;
  1983. hk8.Enabled = true;
  1984. hk9.Enabled = true;
  1985. hk10.Enabled = true;
  1986. hk11.Enabled = true;
  1987. hk12.Enabled = true;
  1988. hk13.Enabled = true;
  1989. hk14.Enabled = true;
  1990. hk15.Enabled = true;
  1991. hk16.Enabled = true;
  1992. hk17.Enabled = true;
  1993. hk18.Enabled = true;
  1994. hk19.Enabled = true;
  1995. hk20.Enabled = true;
  1996. text1.Enabled = true;
  1997. text2.Enabled = true;
  1998. text3.Enabled = true;
  1999. text4.Enabled = true;
  2000. text5.Enabled = true;
  2001. text6.Enabled = true;
  2002. text7.Enabled = true;
  2003. text8.Enabled = true;
  2004. text9.Enabled = true;
  2005. text10.Enabled = true;
  2006. text11.Enabled = true;
  2007. text12.Enabled = true;
  2008. text13.Enabled = true;
  2009. text14.Enabled = true;
  2010. text15.Enabled = true;
  2011. text16.Enabled = true;
  2012. text17.Enabled = true;
  2013. text18.Enabled = true;
  2014. text19.Enabled = true;
  2015. text20.Enabled = true;
  2016. enab = true;
  2017. toolStripStatusLabel5.Text = "Enable Read Only";
  2018.  
  2019. Properties.Settings.Default.enab = true;
  2020. Properties.Settings.Default.Save();
  2021. }
  2022. }
  2023.  
  2024. private void toolStripStatusLabel5_MouseEnter(object sender, EventArgs e)
  2025. {
  2026. this.Cursor = System.Windows.Forms.Cursors.Hand;
  2027. }
  2028.  
  2029. private void toolStripStatusLabel5_MouseLeave(object sender, EventArgs e)
  2030. {
  2031. this.Cursor = System.Windows.Forms.Cursors.Default;
  2032. }
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041.  
  2042. }
  2043. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement