当前位置:网站首页>WPF opens external programs and activates them when needed
WPF opens external programs and activates them when needed
2022-07-24 22:29:00 【ima_ zhan】
Open an external program to use Process
Activate forms , adopt SetForegroundWindow Function transfer Process Get handle activation
_external = new Process();[DllImport("User32.dll", EntryPoint = "SetForegroundWindow")]
public static extern int SetForegroundWindow(IntPtr hWnd);
public void Run(string file, string args)
{
bool _bExisted = true;
try
{
if (_external.HasExited == false)
{
_bExisted = false;
SetForegroundWindow(_external.MainWindowHandle);
return;
}
}
catch (Exception e)
{
Global.MainLogging.LogError("ExternalProcess.Run:param1:" + file + ",param2:" + args + "," + e.ToString());
}
finally
{
if (_bExisted) RunExternal(file, args);
}
}边栏推荐
- 图结构的实现,从点到边再到图
- Helm -- a powerful package management tool for kubernetes applications
- When texturebrush is created, it prompts that there is insufficient memory
- Ue5 reports an error using the plug-in quixel Bridge
- Visual studio input! No prompt
- Im instant messaging develops ten million level concurrent long connection Gateway Technology
- Archsummit: evolution of the underlying framework of cherished microservices
- Luogu p2024 [noi2001] food chain
- Esp32485 air temperature and humidity test
- 物联网平台返回数据解析时遇到org.json.JSONException: No value for Value怎么办
猜你喜欢

Okaleido tiger NFT即将登录Binance NFT平台,后市持续看好

From violent recursion to dynamic programming, memory search

AVL tree of ordered table

EL & JSTL: JSTL summary

Helm -- a powerful package management tool for kubernetes applications

Application programming of communication heartbeat signal for communication abnormality judgment
![[Apipost和Apifox哪个更好用?看这篇就够了!]](/img/58/4dfe5c56d12e8e88b0a7f3583ff0a4.jpg)
[Apipost和Apifox哪个更好用?看这篇就够了!]

Ue5 reports an error using the plug-in quixel Bridge

VScode默认输出到调试控制台如何调整到终端以及两者中的乱码问题

Uniform sampling and thinning of PCL point cloud processing (61)
随机推荐
Enterprise operation we media can't "self Hi": the content should be grounded, not advertising
Luogu p2024 [noi2001] food chain
Brainstorming -- using reduce method to reconstruct concat function
How to adjust the default output of vscode to the debugging console to the terminal and the problem of garbled code in both
EL & JSTL: JSTL summary
ICML2022 | 图神经网络的局域数据增强方法
Visual studio input! No prompt
PCL点云处理之ply文件读取与保存(五十四)
物联网平台返回数据解析时遇到org.json.JSONException: No value for Value怎么办
Icassp 2022 | KS transformer for multimodal emotion recognition
AC自动机
通过企业微信自建应用向微信推送信息
A compatible, smaller and easy-to-use web font API
Projection regularization of line point set in PCL point cloud processing (56)
Filter list
Low code that democratizes software development
When texturebrush is created, it prompts that there is insufficient memory
【1184. 公交站间的距离】
PCL point cloud processing to find the two endpoints of the line point set (57)
PCL点云处理之pcd文件转txt文件(单个或多个批量转换)(六十三)