Skip to content

Commit 4022ddb

Browse files
committed
修复了一些问题 - 20250205
1 parent 6ab5a29 commit 4022ddb

9 files changed

Lines changed: 82 additions & 17 deletions

File tree

.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/UsefulControl-bin/
6+
7+
/Src/UsefulControl/bin/
8+
9+
/Src/UsefulControl/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-
UsefulControl - 实用工具集合小工具
2+
<a href="https://github.com/cjhdevact/UsefulControl">UsefulControl - 实用工具集合小工具</a>
33
</h1>
44

55
## 关于本项目

Src/UsefulControl.suo

1 KB
Binary file not shown.

Src/UsefulControl/BootForm.vb

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ Public Class BootForm
102102
Form1.Show()
103103
End Sub
104104

105-
Private Sub BootForm_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
105+
Private Sub BootForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
106106
CurCommand = Split(Command.ToLower, " ")
107107
'////////////////////////////////////////////////////////////////////////////////////
108108
'//
@@ -658,7 +658,7 @@ Public Class BootForm
658658
End If
659659
End If
660660
Next
661-
661+
662662
If Uif <> 1 Then
663663
For i = 0 To CurCommand.Count - 1
664664
If CurCommand(i).ToLower = "/topbar" Or CurCommand(i).ToLower = "/bottombar" Or CurCommand(i).ToLower = "/lefttopbar" Or CurCommand(i).ToLower = "/righttopbar" Or CurCommand(i).ToLower = "/leftbottombar" Or CurCommand(i).ToLower = "/rightbottombar" Or CurCommand(i).ToLower = "/leftbar" Or CurCommand(i).ToLower = "/rightbar" Then
@@ -813,13 +813,26 @@ Public Class BootForm
813813
End If
814814
End Sub
815815

816-
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)
816+
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
817817
If MovedV <> 1 Then
818818
If Me.Location <> a Then
819819
Me.Location = a
820820
End If
821821
End If
822+
'If Me.TopMost = True Then
823+
' If Me.Visible = True Then
824+
' SetWindowPos(Me.Handle, HWND_TOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS)
825+
' End If
826+
'End If
822827
End Sub
828+
'<DllImport("user32.dll")>
829+
'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
830+
'End Function
831+
832+
'Const HWND_TOPMOST = -1
833+
'Const SWP_NOSIZE As UInteger = &H1
834+
'Const SWP_NOMOVE As UInteger = &H2
835+
'Const TOPMOST_FLAGS As UInteger = SWP_NOMOVE Or SWP_NOSIZE
823836
'API移动窗体
824837
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As IntPtr, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Boolean
825838
Declare Function ReleaseCapture Lib "user32" Alias "ReleaseCapture" () As Boolean

Src/UsefulControl/IBoard/IBoardpfrm.Designer.vb

Lines changed: 7 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Src/UsefulControl/IBoard/IBoardpfrm.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1729,6 +1729,9 @@
17291729
F/8ABBf/AAQW/gAEFv8ABBX/AAQU/gAEFP8ABBP/AAQS/wAEE/8ABxH+AAeI/w==
17301730
</value>
17311731
</data>
1732+
<metadata name="Timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
1733+
<value>305, 17</value>
1734+
</metadata>
17321735
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
17331736
<value>
17341737
AAABAAgAAAAAAAAAAAAgzwAAhgAAAEBAAAAAAAAAKEIAAKbPAAAwMAAAAAAAAKglAADOEQEAKCgAAAAA

Src/UsefulControl/IBoard/IBoardpfrm.vb

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
'* *
2626
'\*****************************************************/
2727
Imports Microsoft.Win32
28+
Imports System.Runtime.InteropServices
2829

2930
Public Class IBoardpfrm
3031
Public pfile As String
@@ -82,6 +83,19 @@ Public Class IBoardpfrm
8283
' Me.Close()
8384
'End Sub
8485

86+
'在Alt+Tab中隐藏
87+
Const WS_EX_COMPOSITED = &H2000000 '0x02000000
88+
Const WS_EX_NOACTIVATE = &H8000000 '0x08000000
89+
Const WS_EX_TOOLWINDOW = &H80 '0x00000080
90+
Const WS_EX_TRANSPARENT = &H20 '0x00000020
91+
Protected Overrides ReadOnly Property CreateParams As CreateParams
92+
Get
93+
Dim cp As CreateParams = MyBase.CreateParams
94+
cp.ExStyle = cp.ExStyle Or WS_EX_TOOLWINDOW Or WS_EX_COMPOSITED Or WS_EX_NOACTIVATE Or WS_EX_TRANSPARENT
95+
Return cp
96+
End Get
97+
End Property
98+
8599
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
86100
IBoardprms.ShowDialog()
87101
End Sub
@@ -148,7 +162,7 @@ Public Class IBoardpfrm
148162
'End Sub
149163

150164
Private Sub pfrm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
151-
165+
152166
' 获取当前窗体的 DPI
153167
Dim currentDpiX As Single = Me.CreateGraphics().DpiX
154168
Dim currentDpiY As Single = Me.CreateGraphics().DpiY
@@ -525,7 +539,7 @@ Public Class IBoardpfrm
525539
pfile = pfile1
526540
PictureBox1.Load(pfile)
527541
IBoardprms.TextBox1.Text = pfile1
528-
NotifyIcon1.Text = "图片展示小工具 - 已打开图片"
542+
NotifyIcon1.Text = "图片展示小工具 - 已打开图片"
529543
CFileState.Text = "已打开文件:" & pfile
530544
ImgAutoLoad = 1
531545
If UnSaveData = 0 Then
@@ -534,7 +548,7 @@ Public Class IBoardpfrm
534548
Catch ex As Exception
535549
pfile = pfile1
536550
IBoardprms.TextBox1.Text = ""
537-
NotifyIcon1.Text = "图片展示小工具 - 未打开图片"
551+
NotifyIcon1.Text = "图片展示小工具 - 未打开图片"
538552
CFileState.Text = "未打开文件。"
539553
ImgAutoLoad = 0
540554
MessageBox.Show("图片加载失败。", "图片展示小工具 - 错误", MessageBoxButtons.OK, MessageBoxIcon.Error)
@@ -617,13 +631,13 @@ Public Class IBoardpfrm
617631
NotifyIcon1.Visible = False
618632
End Sub
619633

620-
Private Sub NotifyIcon1_MouseDoubleClick(sender As System.Object, e As System.Windows.Forms.MouseEventArgs) Handles NotifyIcon1.MouseDoubleClick
634+
Private Sub NotifyIcon1_MouseDoubleClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles NotifyIcon1.MouseDoubleClick
621635
Me.Hsate = 0
622636
CHide.Text = "隐藏(&H)"
623637
Me.Show()
624638
End Sub
625639

626-
Private Sub CHide_Click(sender As System.Object, e As System.EventArgs) Handles CHide.Click
640+
Private Sub CHide_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CHide.Click
627641
If Hsate = 0 Then
628642
Me.Hsate = 1
629643
CHide.Text = "显示(&S)"
@@ -640,4 +654,15 @@ Public Class IBoardpfrm
640654
Me.Show()
641655
End If
642656
End Sub
657+
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
658+
SetWindowPos(Me.Handle, HWND_TOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS)
659+
End Sub
660+
<DllImport("user32.dll")>
661+
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
662+
End Function
663+
664+
Const HWND_TOPMOST = -1
665+
Const SWP_NOSIZE As UInteger = &H1
666+
Const SWP_NOMOVE As UInteger = &H2
667+
Const TOPMOST_FLAGS As UInteger = SWP_NOMOVE Or SWP_NOSIZE
643668
End Class

Src/UsefulControl/My Project/AssemblyInfo.vb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
3131
' 方法是按如下所示使用“*”:
3232
' <Assembly: AssemblyVersion("1.0.*")>
3333

34-
<Assembly: AssemblyVersion("1.0.13.25011")>
35-
<Assembly: AssemblyFileVersion("1.0.13.25011")>
34+
<Assembly: AssemblyVersion("1.0.14.25021")>
35+
<Assembly: AssemblyFileVersion("1.0.14.25021")>

Src/UsefulControl/SeewoFakeShut.vb

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,29 +24,39 @@
2424
'* Seewo Fake Shutdown UI. *
2525
'* *
2626
'\*****************************************************/
27+
Imports System.Runtime.InteropServices
28+
2729
Public Class SeewoFakeShut
2830
Public ReTime As Integer
29-
Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
31+
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
3032
Me.Close()
3133
End Sub
3234

33-
Private Sub SeewoFakeShut_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
35+
Private Sub SeewoFakeShut_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
3436
ReTime = 10
3537

3638
Label2.Text = "PC已关机 , 确认关闭整机?" & vbCrLf & "系统将在10秒后关闭"
3739
Timer1.Enabled = True
3840
End Sub
3941

40-
Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
42+
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
4143
If ReTime = 1 Then
4244
Me.Close()
4345
Else
4446
ReTime = ReTime - 1
4547
Label2.Text = "PC已关机 , 确认关闭整机?" & vbCrLf & "系统将在" & ReTime & "秒后关闭"
4648
End If
49+
'SetWindowPos(Me.Handle, HWND_TOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS)
4750
End Sub
51+
'<DllImport("user32.dll")>
52+
'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
53+
'End Function
4854

49-
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
55+
'Const HWND_TOPMOST = -1
56+
'Const SWP_NOSIZE As UInteger = &H1
57+
'Const SWP_NOMOVE As UInteger = &H2
58+
'Const TOPMOST_FLAGS As UInteger = SWP_NOMOVE Or SWP_NOSIZE
59+
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
5060
Me.Close()
5161
End Sub
5262
Private Sub Button1_MouseMove(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.MouseMove

0 commit comments

Comments
 (0)