Skip to content

Commit 7b8462c

Browse files
committed
增加强制顶置,修复一些问题 - 20250205
1 parent 605b2cb commit 7b8462c

21 files changed

+136
-62
lines changed

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/Src/.vs/
2+
3+
/Src/*.suo
4+
5+
/Src/TimeControl-bin/
6+
7+
/Src/TimeControl/bin/
8+
9+
/Src/TimeControl/obj/

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<h1 align="center">
2-
TimeControl - 时间小工具
2+
<a href="https://github.com/cjhdevact/TimeControl">TimeControl - 时间小工具</a>
33
</h1>
44

55
## 关于本项目

Src/PackOut.bat

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
@echo off
2-
echo 任意键打包 时间小工具(TimeControl)...
3-
pause > nul
4-
if exist "%~dp0TimeControl-Bin" rd /s /q "%~dp0TimeControl-Bin"
5-
md "%~dp0TimeControl-Bin"
6-
copy "%~dp0TimeControl\files\1-安装.bat" "%~dp0TimeControl-Bin\1-安装.bat"
7-
copy "%~dp0TimeControl\files\2-卸载.bat" "%~dp0TimeControl-Bin\2-卸载.bat"
8-
copy "%~dp0TimeControl\files\TimeControlAdmxs.exe" "%~dp0TimeControl-Bin\TimeControlAdmxs.exe"
9-
copy "%~dp0TimeControl\files\TimeControl.adm" "%~dp0TimeControl-Bin\TimeControl.adm"
10-
copy "%~dp0TimeControl\files\TimeControl.xml" "%~dp0TimeControl-Bin\TimeControl.xml"
11-
copy "%~dp0TimeControl\files\UserinitBootInstall.bat" "%~dp0TimeControl-Bin\UserinitBootInstall.bat"
12-
copy "%~dp0TimeControl\files\UserinitBootUnInstall.bat" "%~dp0TimeControl-Bin\UserinitBootUnInstall.bat"
13-
copy "%~dp0TimeControl\bin\Release\TimeControl.exe" "%~dp0TimeControl-Bin\TimeControl.exe"
14-
copy "%~dp0TimeControl\bin\x64\Release\TimeControl.exe" "%~dp0TimeControl-Bin\TimeControl64.exe"
15-
echo.
16-
echo 完成!
17-
echo 任意键退出...
1+
@echo off
2+
echo 任意键打包 时间小工具(TimeControl)...
3+
pause > nul
4+
if exist "%~dp0TimeControl-Bin" rd /s /q "%~dp0TimeControl-Bin"
5+
md "%~dp0TimeControl-Bin"
6+
copy "%~dp0TimeControl\files\1-安装.bat" "%~dp0TimeControl-Bin\1-安装.bat"
7+
copy "%~dp0TimeControl\files\2-卸载.bat" "%~dp0TimeControl-Bin\2-卸载.bat"
8+
copy "%~dp0TimeControl\files\TimeControlAdmxs.exe" "%~dp0TimeControl-Bin\TimeControlAdmxs.exe"
9+
copy "%~dp0TimeControl\files\TimeControl.adm" "%~dp0TimeControl-Bin\TimeControl.adm"
10+
copy "%~dp0TimeControl\files\TimeControl.xml" "%~dp0TimeControl-Bin\TimeControl.xml"
11+
copy "%~dp0TimeControl\files\UserinitBootInstall.bat" "%~dp0TimeControl-Bin\UserinitBootInstall.bat"
12+
copy "%~dp0TimeControl\files\UserinitBootUnInstall.bat" "%~dp0TimeControl-Bin\UserinitBootUnInstall.bat"
13+
copy "%~dp0TimeControl\bin\Release\TimeControl.exe" "%~dp0TimeControl-Bin\TimeControl.exe"
14+
copy "%~dp0TimeControl\bin\x64\Release\TimeControl.exe" "%~dp0TimeControl-Bin\TimeControl64.exe"
15+
copy "%~dp0TimeControl\files\certmgr.exe" "%~dp0TimeControl-Bin\certmgr.exe"
16+
copy "%~dp0TimeControl\files\rootcert.cer" "%~dp0TimeControl-Bin\rootcert.cer"
17+
echo.
18+
echo 完成!
19+
echo 任意键退出...
1820
pause > nul

Src/SignBin.bat

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
::Tips Set the CSIGNCERT as your path.
2+
@echo off
3+
path D:\ProjectsTmp\SignPack;%path%
4+
echo 任意键签名 时间小工具(TimeControl)...
5+
pause > nul
6+
cmd.exe /c signcmd.cmd "%CSIGNCERT%" "%~dp0TimeControl-Bin\TimeControl.exe"
7+
cmd.exe /c signcmd.cmd "%CSIGNCERT%" "%~dp0TimeControl-Bin\TimeControl64.exe"
8+
cmd.exe /c signcmd.cmd "%CSIGNCERT%" "%~dp0TimeControl-Bin\TimeControlAdmxs.exe"
9+
echo.
10+
echo 完成!
11+
echo 任意键退出...
12+
pause > nul

Src/TimeControl.sln

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
2-
Microsoft Visual Studio Solution File, Format Version 11.00
3-
# Visual Studio 2010
4-
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "TimeControl", "TimeControl\TimeControl.vbproj", "{F5B7BEEB-255F-4D20-A039-A4012DB99ECF}"
5-
EndProject
6-
Global
7-
GlobalSection(SolutionConfigurationPlatforms) = preSolution
8-
Debug|x64 = Debug|x64
9-
Debug|x86 = Debug|x86
10-
Release|x64 = Release|x64
11-
Release|x86 = Release|x86
12-
EndGlobalSection
13-
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14-
{F5B7BEEB-255F-4D20-A039-A4012DB99ECF}.Debug|x64.ActiveCfg = Debug|x64
15-
{F5B7BEEB-255F-4D20-A039-A4012DB99ECF}.Debug|x64.Build.0 = Debug|x64
16-
{F5B7BEEB-255F-4D20-A039-A4012DB99ECF}.Debug|x86.ActiveCfg = Debug|x86
17-
{F5B7BEEB-255F-4D20-A039-A4012DB99ECF}.Debug|x86.Build.0 = Debug|x86
18-
{F5B7BEEB-255F-4D20-A039-A4012DB99ECF}.Release|x64.ActiveCfg = Release|x64
19-
{F5B7BEEB-255F-4D20-A039-A4012DB99ECF}.Release|x64.Build.0 = Release|x64
20-
{F5B7BEEB-255F-4D20-A039-A4012DB99ECF}.Release|x86.ActiveCfg = Release|x86
21-
{F5B7BEEB-255F-4D20-A039-A4012DB99ECF}.Release|x86.Build.0 = Release|x86
22-
EndGlobalSection
23-
GlobalSection(SolutionProperties) = preSolution
24-
HideSolutionNode = FALSE
25-
EndGlobalSection
26-
EndGlobal
1+
2+
Microsoft Visual Studio Solution File, Format Version 11.00
3+
# Visual Studio 2010
4+
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "TimeControl", "TimeControl\TimeControl.vbproj", "{F5B7BEEB-255F-4D20-A039-A4012DB99ECF}"
5+
EndProject
6+
Global
7+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
8+
Debug|x64 = Debug|x64
9+
Debug|x86 = Debug|x86
10+
Release|x64 = Release|x64
11+
Release|x86 = Release|x86
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{F5B7BEEB-255F-4D20-A039-A4012DB99ECF}.Debug|x64.ActiveCfg = Debug|x64
15+
{F5B7BEEB-255F-4D20-A039-A4012DB99ECF}.Debug|x64.Build.0 = Debug|x64
16+
{F5B7BEEB-255F-4D20-A039-A4012DB99ECF}.Debug|x86.ActiveCfg = Debug|x86
17+
{F5B7BEEB-255F-4D20-A039-A4012DB99ECF}.Debug|x86.Build.0 = Debug|x86
18+
{F5B7BEEB-255F-4D20-A039-A4012DB99ECF}.Release|x64.ActiveCfg = Release|x64
19+
{F5B7BEEB-255F-4D20-A039-A4012DB99ECF}.Release|x64.Build.0 = Release|x64
20+
{F5B7BEEB-255F-4D20-A039-A4012DB99ECF}.Release|x86.ActiveCfg = Release|x86
21+
{F5B7BEEB-255F-4D20-A039-A4012DB99ECF}.Release|x86.Build.0 = Release|x86
22+
EndGlobalSection
23+
GlobalSection(SolutionProperties) = preSolution
24+
HideSolutionNode = FALSE
25+
EndGlobalSection
26+
EndGlobal

Src/TimeControl.suo

-2 KB
Binary file not shown.

Src/TimeControl/Form1.vb

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'****************************************************************************
22
' TimeControl
3-
' Copyright (C) 2022-2024 CJH.
3+
' Copyright (C) 2022-2025 CJH.
44
'
55
' This program is free software: you can redistribute it and/or modify
66
' it under the terms of the GNU General Public License as published by
@@ -95,6 +95,19 @@ Public Class Form1
9595
Public UnReadData As Integer '不读取设置
9696
Public ShowModeTips As Integer '不显示横幅
9797

98+
'在Alt+Tab中隐藏
99+
Const WS_EX_COMPOSITED = &H2000000 '0x02000000
100+
'Const WS_EX_NOACTIVATE = &H8000000 '0x08000000
101+
Const WS_EX_TOOLWINDOW = &H80 '0x00000080
102+
'Const WS_EX_TRANSPARENT = &H20 '0x00000020
103+
Protected Overrides ReadOnly Property CreateParams As CreateParams
104+
Get
105+
Dim cp As CreateParams = MyBase.CreateParams
106+
cp.ExStyle = cp.ExStyle Or WS_EX_TOOLWINDOW Or WS_EX_COMPOSITED
107+
Return cp
108+
End Get
109+
End Property
110+
98111
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
99112
Try
100113
If Form2.CheckBox5.Checked = True Then
@@ -117,7 +130,21 @@ Public Class Form1
117130
End If
118131
End If
119132
End If
133+
If Me.TopMost = True Then
134+
If Me.Visible = True Then
135+
SetWindowPos(Me.Handle, HWND_TOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS)
136+
End If
137+
End If
120138
End Sub
139+
<DllImport("user32.dll")>
140+
Private Shared Function SetWindowPos(ByVal hWnd As IntPtr, ByVal hWndInsertAfter As IntPtr, ByVal X As Integer, ByVal Y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal uFlags As UInteger) As Boolean
141+
End Function
142+
143+
Const HWND_TOPMOST = -1
144+
Const SWP_NOSIZE As UInteger = &H1
145+
Const SWP_NOMOVE As UInteger = &H2
146+
Const TOPMOST_FLAGS As UInteger = SWP_NOMOVE Or SWP_NOSIZE
147+
121148
Public Sub SetTimeFormSize(ByVal MeH As Integer, ByVal MeW As Integer)
122149
Dim disi As Graphics = Me.CreateGraphics()
123150
'If disi.DpiX <= 96 Then

Src/TimeControl/Form2.vb

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'****************************************************************************
22
' TimeControl
3-
' Copyright (C) 2022-2024 CJH.
3+
' Copyright (C) 2022-2025 CJH.
44
'
55
' This program is free software: you can redistribute it and/or modify
66
' it under the terms of the GNU General Public License as published by
@@ -209,7 +209,7 @@ errcode:
209209
ComboBox4.SelectedText = "自定义背景"
210210
End If
211211

212-
Label1.Text = "时间小工具 版本:" & My.Application.Info.Version.ToString & vbCrLf & "版权所有 © 2022-2024 CJH。"
212+
Label1.Text = "时间小工具 版本:" & My.Application.Info.Version.ToString & vbCrLf & "版权所有 © 2022-2025 CJH。"
213213
Call formatcolorcurset()
214214
End Sub
215215
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
@@ -448,8 +448,14 @@ errcode:
448448
End If
449449
End Sub
450450

451-
Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click
452-
If (MessageBox.Show("确定退出时间小工具吗?", "时间小工具", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) = DialogResult.Yes) Then
451+
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
452+
Dim aa As Integer = 0
453+
If MessageBox.Show("确定退出时间小工具吗?", "时间小工具", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) = DialogResult.Yes Then
454+
aa = 1
455+
End If
456+
If aa = 1 Then
457+
Form1.Timer1.Enabled = False
458+
Form1.Timer2.Enabled = False
453459
End
454460
End If
455461
End Sub
@@ -1694,8 +1700,14 @@ errcode:
16941700
MessageBox.Show("当前支持的命令行:" & vbCrLf & "/safemode 以安全模式加载,不读取设置也不保存设置。当程序由于配置原因无法正常启动,可以使用该命令行启动后恢复默认设置。" & vbCrLf & "/noproflie 不使用配置文件。" & vbCrLf & "/nosaveprofile 读取设置但不保存设置" & vbCrLf & vbCrLf & "部分功能可能因为策略设置而不可用。命令行的内容要优先于策略设置,为所有用户设置的策略优先级高于针对单一用户设置的策略。", "帮助", MessageBoxButtons.OK, MessageBoxIcon.Information)
16951701
End Sub
16961702

1697-
Private Sub Button12_Click(sender As System.Object, e As System.EventArgs) Handles Button12.Click
1703+
Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click
1704+
Dim bb As Integer = 0
16981705
If (MessageBox.Show("确定重启时间小工具吗?", "时间小工具", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) = DialogResult.Yes) Then
1706+
bb = 1
1707+
End If
1708+
If bb = 1 Then
1709+
Form1.Timer1.Enabled = False
1710+
Form1.Timer2.Enabled = False
16991711
System.Diagnostics.Process.Start(Application.ExecutablePath)
17001712
End
17011713
End If

Src/TimeControl/GPLForm.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'****************************************************************************
22
' TimeControl
3-
' Copyright (C) 2022-2024 CJH.
3+
' Copyright (C) 2022-2025 CJH.
44
'
55
' This program is free software: you can redistribute it and/or modify
66
' it under the terms of the GNU General Public License as published by

Src/TimeControl/MsgForm.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'****************************************************************************
22
' TimeControl
3-
' Copyright (C) 2022-2024 CJH.
3+
' Copyright (C) 2022-2025 CJH.
44
'
55
' This program is free software: you can redistribute it and/or modify
66
' it under the terms of the GNU General Public License as published by

0 commit comments

Comments
 (0)