This commit is contained in:
睿 安
2026-01-25 23:46:14 +08:00
parent 2a2a3d68d8
commit 37e7d278bd
727 changed files with 193377 additions and 7 deletions

33
demo/kugou/main.cpp Normal file
View File

@@ -0,0 +1,33 @@
#include "global.h"
#include "mainFrm.h"
int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
_In_opt_ HINSTANCE hPrevInstance,
_In_ LPWSTR lpCmdLine,
_In_ int nCmdShow)
{
Application app;//app类
app.EnableHighDpi();//启用高dpi适配
app.SetResource("my_res");//设定资源名称
MainFrm frm;//主窗口
//给窗口添加淡入效果
Animation* ant = new Animation(&frm);//绑定父对象为frm,则ant无需手动释放
ant->SetStartValue(0.1);
ant->SetEndValue(1.0);
ant->ValueChanged = [&](float value) {
Invoke([value, &frm] {
frm.Opacity = value;//修改透明度
frm.Invalidate();//刷新
});
};
frm.Opacity = 0.1;
ant->Start(200);//开始动画
frm.CenterToScreen();//屏幕居中
frm.Show();
return app.Exec();
}