Program.cs 807 B

123456789101112131415161718192021222324252627282930
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using Walterlv.WindowDetector;
  7. namespace Windowtxt
  8. {
  9. public class Program
  10. {
  11. public string doUpload(string inParams)
  12. {
  13. System.Diagnostics.Debugger.Launch();
  14. var windows = WindowEnumerator.FindAll();
  15. for (int i = 0; i < windows.Count; i++)
  16. {
  17. var window = windows[i];
  18. string Title = window.Title;
  19. IntPtr Hwnd = window.Hwnd;
  20. if (Title.IndexOf("飞书") > -1)
  21. {
  22. //显示窗口
  23. WindowEnumerator.ForceWindowIntoForeground(Hwnd);
  24. }
  25. }
  26. return "";
  27. }
  28. }
  29. }