开机自动运行程序最小化

来源:百度知道 编辑:UC知道 时间:2024/05/09 12:33:08
有一个程序开机自动运行
我想让它开机运行后再自动最小化
怎么办?

首先想办法让你的程序先自动运行起来,不管是启动项也好注册表也吧,启动起来再说。

然后再来看看WinMain()函数
int WINAPI WinMain(
HINSTANCE hInstance, // handle to current instance
HINSTANCE hPrevInstance, // handle to previous instance
LPSTR lpCmdLine, // pointer to command line
int nCmdShow // show state of window
);
其中的参数nCmdShow就是显示模式了,其中#define SW_MINIMIZE 6
也就是说,给启动项添加命令行参数最小化就可以了

写入注册表