-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
使用原子窗体、提示用户以管理员权限运行、开机自启自动获取管理员权限并跳过警告窗口
- Loading branch information
Showing
5 changed files
with
53 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<project ver="10" name="电源计划管理器" libEmbed="true" icon="res\battery-level.ico" ui="win" output="电源计划管理器.exe" CompanyName="YrracOwl" FileDescription="电源计划管理器" LegalCopyright="Copyright (C) YrracOwl 2022" ProductName="电源计划管理器" InternalName="电源计划管理器" FileVersion="0.0.0.04" ProductVersion="0.0.0.04" publishDir="/dist/" dstrip="false" local="false" ignored="false"> | ||
<project ver="10" name="电源计划管理器" libEmbed="true" icon="res\battery-level.ico" ui="win" output="电源计划管理器.exe" CompanyName="YrracOwl" FileDescription="电源计划管理器" LegalCopyright="Copyright (C) YrracOwl 2022" ProductName="电源计划管理器" InternalName="电源计划管理器" FileVersion="1.0.0.11" ProductVersion="1.0.0.11" publishDir="/dist/" dstrip="false" local="false" ignored="false"> | ||
<file name="main.aardio" path="main.aardio" comment="main.aardio"/> | ||
<folder name="资源文件" path="res" embed="true" local="false" ignored="false"> | ||
<file name="battery-level.ico" path="res\battery-level.ico" comment="res\battery-level.ico"/> | ||
<file name="runAsAdmin.bmp" path="res\runAsAdmin.bmp" comment="res\runAsAdmin.bmp"/> | ||
</folder> | ||
<folder name="窗体文件" path="dlg" comment="目录" embed="true" local="false" ignored="false"> | ||
<file name="askForAdmin.aardio" path="dlg\askForAdmin.aardio" comment="dlg\askForAdmin.aardio"/> | ||
<file name="settings.aardio" path="dlg\settings.aardio" comment="dlg\settings.aardio"/> | ||
</folder> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import fonts.fontAwesome; | ||
import win.ui; | ||
/*DSG{{*/ | ||
var winform = win.form(text="请以管理员启动";right=383;bottom=279;border="thin";max=false;min=false) | ||
winform.add( | ||
picturebox={cls="picturebox";left=8;top=112;right=376;bottom=216;image=$"\res\runAsAdmin.bmp";z=2}; | ||
plus={cls="plus";text="确定并退出";left=112;top=232;right=272;bottom=270;align="left";font=LOGFONT(h=-19);forecolor=-2104577;iconStyle={align="left";font=LOGFONT(h=-16;name='FontAwesome');padding={left=16}};iconText='\uF011';notify=1;textPadding={left=39};z=4}; | ||
static={cls="static";text="请右键程序,点击“以管理员身份运行”!";left=8;top=40;right=376;bottom=64;align="center";center=1;font=LOGFONT(h=-20;underline=1);transparent=1;z=1}; | ||
static2={cls="static";text="如下所示";left=8;top=72;right=376;bottom=96;align="center";center=1;font=LOGFONT(h=-20;underline=1);transparent=1;z=3} | ||
) | ||
/*}}*/ | ||
|
||
winform.plus.skin({ | ||
foreground={ | ||
active=0xFFF78987; | ||
default=0xFFFFE2DF; | ||
disabled=0xFF8A4343; | ||
focus=0xFFCF6565; | ||
hover=0xFFFFBAB7 | ||
}; | ||
color={ | ||
default=0xFF000000; | ||
disabled=0xFF6D6D6D | ||
} | ||
}) | ||
|
||
winform.plus.oncommand = function(id,event){ | ||
winform.endModal("关闭程序") | ||
} | ||
|
||
winform.show(); | ||
win.loopMessage(); | ||
return winform; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -258,4 +258,4 @@ else { | |
} | ||
} | ||
|
||
return win.loopMessage(); | ||
return win.loopMessage(); |
Binary file not shown.