110,534
社区成员
发帖
与我相关
我的任务
分享
public bool checkhide{
string path = "C:\\Windows\\System32\\";
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.CreateNoWindow = true;
p.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
p.StartInfo.FileName = path + "calc.exe";
try
{
p.Start();
}
catch (Exception ex)
{
ErrorStr = ex.Message;
p.Kill();
return false;
}
finally
{
IntPtr intptr = p.MainWindowHandle;
ShowWindow(intptr, 0);
p.Dispose();
}
return true;
}
[DllImport("user32.dll", EntryPoint = "ShowWindow", SetLastError = true)]
static extern bool ShowWindow(IntPtr hWnd, uint nCmdShow);