1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > Qt之创建桌面和开始菜单快捷方式

Qt之创建桌面和开始菜单快捷方式

时间:2019-02-06 17:41:14

相关推荐

Qt之创建桌面和开始菜单快捷方式

将安装好的酷狗拷贝到C:\data目录中

1.创建桌面快捷方式

QFile::link("C:/data/KuGou.exe", QStandardPaths::writableLocation(QStandardPaths::DesktopLocation).append("/").append("KuGou.lnk"));

2.创建开始菜单快捷方式

QString startMenuPath=QStandardPaths::writableLocation(QStandardPaths::ApplicationsLocation).append("/").append(QStringLiteral("酷狗"));QDir dir(startMenuPath);if(!dir.exists()){ dir.mkdir(startMenuPath);}if(dir.exists()){ QFile::link("C:/data/KuGou.exe", startMenuPath.append("/").append("KuGou.lnk"));}

3.将快捷方式锁定到任务栏

Win7、Win8有效

//快捷方式必须存在,才能锁定到任务栏QFile::link("C:/data/KuGou.exe", QStandardPaths::writableLocation(QStandardPaths::DesktopLocation).append("/").append("KuGou.lnk"));QString strTemp

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。