示例#1
0
 internal static void SelectComboBoxItem(System.IntPtr hWnd, string itemText)
 {
     if (!IsWindowDisabled(hWnd))
     {
         Win32NativeMethods.SendMessage(hWnd, ComboBoxMessage.CB_SELECTSTRING, System.IntPtr.Zero, itemText);
     }
 }
示例#2
0
 internal static void SetWindowTextAny(System.IntPtr hWnd, string text)
 {
     if (!IsWindowDisabled(hWnd))
     {
         Win32NativeMethods.SendMessage(hWnd, WindowMessage.WM_SETTEXT, System.IntPtr.Zero, text);
     }
 }
示例#3
0
 internal static void Send_WMCOMMAND(System.IntPtr hWndMainWindow, System.IntPtr hWnd)
 {
     if (!IsWindowDisabled(hWnd))
     {
         Win32NativeMethods.SendMessage(hWndMainWindow, WindowMessage.WM_COMMAND, System.IntPtr.Zero, hWnd);
     }
 }
示例#4
0
 internal static void SelectComboBoxItem(System.IntPtr hWnd, int index)
 {
     if (!IsWindowDisabled(hWnd))
     {
         Win32NativeMethods.SendMessage(hWnd, ComboBoxMessage.CB_SETCURSEL, (System.IntPtr)index, System.IntPtr.Zero);
     }
 }
示例#5
0
 internal static void Send_BMCLICK(System.IntPtr hWnd)
 {
     if (!IsWindowDisabled(hWnd))
     {
         Win32NativeMethods.SetActiveWindow(hWnd);
         Win32NativeMethods.SendMessage(hWnd, ButtonControlMessage.BM_CLICK, System.IntPtr.Zero, System.IntPtr.Zero);
     }
 }
示例#6
0
        internal static void SelectNextComboBoxItem(System.IntPtr hWnd)
        {
            int num = (int)Win32NativeMethods.SendMessage(hWnd, ComboBoxMessage.CB_GETCOUNT, System.IntPtr.Zero, System.IntPtr.Zero);

            if (num > 0)
            {
                int index = (int)Win32NativeMethods.SendMessage(hWnd, ComboBoxMessage.CB_GETCURSEL, System.IntPtr.Zero, System.IntPtr.Zero);
                if (index >= -1)
                {
                    index = (int)((index + 1) % num);
                    SelectComboBoxItem(hWnd, index);
                }
            }
        }
示例#7
0
        internal static string GetCheck(System.IntPtr hWnd)
        {
            if (IsCheckBoxStateReadable(hWnd))
            {
                switch (((int)Win32NativeMethods.SendMessage(hWnd, ButtonControlMessage.BM_GETCHECK, System.IntPtr.Zero, System.IntPtr.Zero)))
                {
                case 0:
                    return(bool.FalseString);

                case 1:
                    return(bool.TrueString);
                }
                return("indeterminate");
            }
            return("unreadable");
        }
示例#8
0
 internal static void SetCheck(System.IntPtr hWnd, string checkStateStr)
 {
     if (!IsWindowDisabled(hWnd))
     {
         bool flag;
         ButtonControlMessage message;
         if (bool.TryParse(checkStateStr, out flag))
         {
             message = flag ? ButtonControlMessage.BST_CHECKED : ButtonControlMessage.BST_UNCHECKED;
         }
         else
         {
             message = ButtonControlMessage.BST_INDETERMINATE;
         }
         Win32NativeMethods.SendMessage(hWnd, ButtonControlMessage.BM_SETCHECK, (System.IntPtr)((long)message), System.IntPtr.Zero);
     }
 }
示例#9
0
 internal static string GetWindowTextAny(System.IntPtr hWnd)
 {
     System.Text.StringBuilder lParam = new System.Text.StringBuilder(0x80);
     Win32NativeMethods.SendMessage(hWnd, WindowMessage.WM_GETTEXT, (System.IntPtr)lParam.Capacity, lParam);
     return(lParam.ToString());
 }