Browse Source

WindowsAPI唤起程序窗口测试,唤起隐藏窗口失败,隐藏边框窗体唤起失败,常规窗口正常,如chrome

yuzhengyang 7 years ago
parent
commit
bf0933f745

BIN
Fork.Net/.vs/Fork.Net/v15/Server/sqlite3/storage.ide


BIN
Fork.Net/.vs/Fork.Net/v15/sqlite3/storage.ide


BIN
Fork.Net/.vs/Fork.Net/v15/sqlite3/storage.ide-shm


BIN
Fork.Net/.vs/Fork.Net/v15/sqlite3/storage.ide-wal


+ 1 - 0
Fork.Net/Azylee.Utils/Azylee.Core/WindowsUtils/APIUtils/ApplicationAPI.cs

@@ -35,6 +35,7 @@ namespace Azylee.Core.WindowsUtils.APIUtils
 
         /// <summary>
         /// 唤起进程窗口(搭配 AppUnique.IsUnique() 食用更佳)
+        /// -测试无法唤起隐藏窗口,仅能唤起常规窗口
         /// </summary>
         public static void Raise(Process process, bool all = false)
         {

+ 14 - 0
Fork.Net/Test/Test.RaiseOtherApp/Form1.Designer.cs

@@ -28,13 +28,25 @@
         /// </summary>
         private void InitializeComponent()
         {
+            this.button1 = new System.Windows.Forms.Button();
             this.SuspendLayout();
             // 
+            // button1
+            // 
+            this.button1.Location = new System.Drawing.Point(13, 13);
+            this.button1.Name = "button1";
+            this.button1.Size = new System.Drawing.Size(75, 23);
+            this.button1.TabIndex = 0;
+            this.button1.Text = "button1";
+            this.button1.UseVisualStyleBackColor = true;
+            this.button1.Click += new System.EventHandler(this.button1_Click);
+            // 
             // Form1
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(284, 261);
+            this.Controls.Add(this.button1);
             this.Name = "Form1";
             this.Text = "Form1";
             this.Load += new System.EventHandler(this.Form1_Load);
@@ -43,6 +55,8 @@
         }
 
         #endregion
+
+        private System.Windows.Forms.Button button1;
     }
 }
 

+ 10 - 1
Fork.Net/Test/Test.RaiseOtherApp/Form1.cs

@@ -22,7 +22,16 @@ namespace Test.RaiseOtherApp
 
         private void Form1_Load(object sender, EventArgs e)
         {
-            
+
+        }
+
+        private void button1_Click(object sender, EventArgs e)
+        {
+            Process[] p = Process.GetProcessesByName("AccessSecurity");
+            if (ListTool.HasElements(p))
+            {
+                ApplicationAPI.Raise(p[0], true);
+            }
         }
     }
 }