PageRenderTime 48ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/UIMisc.cs

#
C# | 115 lines | 70 code | 14 blank | 31 comment | 0 complexity | 51a3aedb04cccc1de29b235395b2cebd MD5 | raw file
  1. /*
  2. * Please leave this Copyright notice in your code if you use it
  3. * Written by Decebal Mihailescu [http://www.codeproject.com/script/articles/list_articles.asp?userid=634640]
  4. */
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Text;
  8. using System.ComponentModel;
  9. using System.Data;
  10. using System.Drawing;
  11. using System.Windows.Forms;
  12. using System.Runtime.InteropServices;
  13. using System.Windows.Forms.Design;
  14. namespace FreeTranslator
  15. {
  16. //public class MyHook : IMessageFilter
  17. //{
  18. // public bool PreFilterMessage(ref Message m)
  19. // {
  20. // if (m.Msg == 0x0102)//this will give you the key pressed "in your application"
  21. // {
  22. // MessageBox.Show(m.WParam.ToString());
  23. // return true;
  24. // }
  25. // return false;
  26. // }
  27. //}
  28. //static class Program
  29. //{
  30. // /// <summary>
  31. // /// The main entry point for the application.
  32. // /// </summary>
  33. // [STAThread]
  34. // static void Main()
  35. // {
  36. // MyHook mh = new MyHook();
  37. // Application.AddMessageFilter(mh);
  38. // Application.EnableVisualStyles();
  39. // Application.SetCompatibleTextRenderingDefault(false);
  40. // Application.Run(new Form1());
  41. // }
  42. //}
  43. internal enum VirtualKeys : int
  44. {
  45. VK_LBUTTON = 0x01,
  46. VK_RBUTTON = 0x02,
  47. VK_CANCEL = 0x03,
  48. VK_MBUTTON = 0x04,
  49. VK_XBUTTON1 = 0x05,
  50. VK_XBUTTON2 = 0x6,
  51. VK_BACK = 0x08,
  52. VK_TAB = 0x09,
  53. VK_RETURN = 0x0D,
  54. VK_SHIFT = 0x10,
  55. VK_CONTROL = 0x11,
  56. VK_ESCAPE = 0x1B,
  57. VK_SPACE = 0x20,
  58. VK_LEFT = 0x25,
  59. VK_UP = 0x21,
  60. VK_RIGHT = 0x27,
  61. VK_DOWN = 0x22,
  62. VK_DELETE = 0x2E,
  63. VK_F1 = 0x70,
  64. VK_F2 = 0x71,
  65. VK_F3 = 0x72,
  66. VK_F4 = 0x73,
  67. VK_F5 = 0x74,
  68. VK_F6 = 0x75,
  69. VK_F7 = 0x76,
  70. VK_F8 = 0x77,
  71. VK_F9 = 0x78,
  72. VK_F10 = 0x79,
  73. VK_F11 = 0x7A,
  74. VK_F12 = 0x7B,
  75. VK_F13 = 0x7C,
  76. VK_F14 = 0x7D,
  77. }
  78. [ToolStripItemDesignerAvailability(ToolStripItemDesignerAvailability.ToolStrip | ToolStripItemDesignerAvailability.StatusStrip)]
  79. public class ToolStripCheckedBox : ToolStripControlHost
  80. {
  81. public ToolStripCheckedBox()
  82. : base(new CheckBox())
  83. {
  84. }
  85. [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
  86. public CheckBox CheckBox
  87. {
  88. get { return (CheckBox)this.Control; }
  89. }
  90. }
  91. struct Marker
  92. {
  93. public readonly int source;
  94. public readonly int destination;
  95. public Marker(int s, int d)
  96. {
  97. source = s;
  98. destination = d;
  99. }
  100. }
  101. }