using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Diagnostics;namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} private void Form1_Load(object sender, EventArgs e)
{ Process[] proc = Process.GetProcesses();
foreach (Process p in proc)
{
Console.WriteLine(p.MainWindowHandle.ToString());
}
}
}
}上面是得到所有进程的主窗口句柄
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Diagnostics;namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} private void Form1_Load(object sender, EventArgs e)
{ Process[] proc = Process.GetProcesses();
foreach (Process p in proc)
{
Console.WriteLine(p.MainWindowHandle.ToString());
}
}
}
}上面是得到所有进程的主窗口句柄
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货