예제 #1
0
            public static string GetDrawingName()
            {
                var drawingHandles = WindowController2.GetDrawingHandles();

                if (drawingHandles.Count != 0)
                {
                    WindowController2.Maximize(drawingHandles[0]);
                }

                foreach (var handle in drawingHandles)
                {
                    var title = WindowController2.GetWindowTitle(handle);
                    return(Path.GetFileNameWithoutExtension(title));
                }

                return(string.Empty);
            }
예제 #2
0
            /// <summary>
            /// EnumChildWindowsメソッドの引数に渡すコールバックメソッド
            /// </summary>
            public int FindChildWindow(IntPtr childWindowHandle, int lParam)
            {
                var title = WindowController2.GetWindowTitle(childWindowHandle);

                if (string.IsNullOrEmpty(this.targetTitle))
                {
                    if (title.Contains(this.jpTitle) || title.Contains(this.enTitle))
                    {
                        this.FoundWindowHandle = childWindowHandle;
                        return(0); //見つかったら処理中止
                    }
                }
                else
                {
                    if (title.Contains(this.targetTitle))
                    {
                        this.FoundWindowHandle = childWindowHandle;
                        return(0); //見つかったら処理中止
                    }
                }

                return(1); //処理続行
            }