Esempio n. 1
0
        private void SnapRightButton_Click(object sender, RoutedEventArgs e)
        {
            var hWnd = GetWindowHandle();

            if (hWnd != IntPtr.Zero)
            {
                var result = WindowUtilty.SetWindowPosition(hWnd, desiredWidth + 1, 0, desiredWidth, desiredHeight);
                StatusText.Text = result ? "Snap Right (successful)" : "Snap Right (failed)";
            }
        }
Esempio n. 2
0
        private void NoTopMostButton_Click(object sender, RoutedEventArgs e)
        {
            var hWnd = GetWindowHandle();

            if (hWnd != IntPtr.Zero)
            {
                var result = WindowUtilty.SetWindowTopMost(hWnd, false);
                StatusText.Text = result ? "Unset TopMost (successful)" : "Unset TopMost (failed)";
            }
        }
Esempio n. 3
0
        private IntPtr GetWindowHandle()
        {
            var hWnd = WindowUtilty.GetTencentMeetingWindowHandle();

            if (hWnd == IntPtr.Zero)
            {
                MessageBox.Show("Cannot find the window of Tencent Meeting!", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                StatusText.Text = "Missing window";
            }
            return(hWnd);
        }