c# 控制台应用程序怎么隐藏黑窗口
2024-10-16 08:38:14
class
Program
{
[DllImport(
"user32.dll"
, EntryPoint =
"ShowWindow"
, SetLastError =
true
)]
static
extern
bool
ShowWindow(IntPtr hWnd,
uint
nCmdShow);
[DllImport(
"user32.dll"
, EntryPoint =
"FindWindow"
, SetLastError =
true
)]
public
static
extern
IntPtr FindWindow(
string
lpClassName,
string
lpWindowName);
static
void
Main(
string
[] args)
{
Console.Title =
"WAHAHA"
;
IntPtr intptr = FindWindow(
"ConsoleWindowClass"
,
"WAHAHA"
);
if
(intptr != IntPtr.Zero)
{
ShowWindow(intptr, 0);
//隐藏这个窗口
}
string
x;
x = Console.ReadLine();
}
}
通过以上代码只能是让其闪的时间变得纪委短暂。有时候还是看到有框出现。
代码摘自网络
最新文章
- 委托 lambda表达式浅显理解
- WPF感悟
- sudo: /etc/sudoers is world writable
- int main(int argc,char* argv[])详解
- uva748 - Exponentiation
- XCode使用自带SVN,SVN命令
- Oracle中关于bitmap index的使用问题
- kill 命令详解 系统信号
- LVS单机测试不负载
- win2008 ent r2 开启端口
- [周译见] C# 7 中的模范和实践
- Learning to Rank算法介绍:GBRank
- python中关于turtle库的学习笔记
- com.mysql.jdbc.connection和java.sql.connection的区别
- 关于a标签的用法总结
- cocos2dx添加新的类后出现错误undefined reference to的解决办法
- WebAssembly 浏览器中运行c/c++模块
- 彻底理解lib和dll
- 投稿核心期刊、中文重要期刊、SCI二区及以上期刊目录
- Linux内核分析 计算机是如何工作的——by王玥