Skip to content

Commit

Permalink
修复了一些问题 - 20250205
Browse files Browse the repository at this point in the history
  • Loading branch information
cjhdevact committed Feb 5, 2025
1 parent 6ab5a29 commit 4022ddb
Show file tree
Hide file tree
Showing 9 changed files with 82 additions and 17 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/Src/.vs/

/Src/*.suo

/Src/UsefulControl-bin/

/Src/UsefulControl/bin/

/Src/UsefulControl/obj/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 align="center">
UsefulControl - 实用工具集合小工具
<a href="https://github.com/cjhdevact/UsefulControl">UsefulControl - 实用工具集合小工具</a>
</h1>

## 关于本项目
Expand Down
Binary file modified Src/UsefulControl.suo
Binary file not shown.
19 changes: 16 additions & 3 deletions Src/UsefulControl/BootForm.vb
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Public Class BootForm
Form1.Show()
End Sub

Private Sub BootForm_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Private Sub BootForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
CurCommand = Split(Command.ToLower, " ")
'////////////////////////////////////////////////////////////////////////////////////
'//
Expand Down Expand Up @@ -658,7 +658,7 @@ Public Class BootForm
End If
End If
Next

If Uif <> 1 Then
For i = 0 To CurCommand.Count - 1
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
Expand Down Expand Up @@ -813,13 +813,26 @@ Public Class BootForm
End If
End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If MovedV <> 1 Then
If Me.Location <> a Then
Me.Location = a
End If
End If
'If Me.TopMost = True Then
' If Me.Visible = True Then
' SetWindowPos(Me.Handle, HWND_TOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS)
' End If
'End If
End Sub
'<DllImport("user32.dll")>
'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
'End Function

'Const HWND_TOPMOST = -1
'Const SWP_NOSIZE As UInteger = &H1
'Const SWP_NOMOVE As UInteger = &H2
'Const TOPMOST_FLAGS As UInteger = SWP_NOMOVE Or SWP_NOSIZE
'API移动窗体
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
Declare Function ReleaseCapture Lib "user32" Alias "ReleaseCapture" () As Boolean
Expand Down
9 changes: 7 additions & 2 deletions Src/UsefulControl/IBoard/IBoardpfrm.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Src/UsefulControl/IBoard/IBoardpfrm.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1729,6 +1729,9 @@
F/8ABBf/AAQW/gAEFv8ABBX/AAQU/gAEFP8ABBP/AAQS/wAEE/8ABxH+AAeI/w==
</value>
</data>
<metadata name="Timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>305, 17</value>
</metadata>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAgAAAAAAAAAAAAgzwAAhgAAAEBAAAAAAAAAKEIAAKbPAAAwMAAAAAAAAKglAADOEQEAKCgAAAAA
Expand Down
35 changes: 30 additions & 5 deletions Src/UsefulControl/IBoard/IBoardpfrm.vb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
'* *
'\*****************************************************/
Imports Microsoft.Win32
Imports System.Runtime.InteropServices

Public Class IBoardpfrm
Public pfile As String
Expand Down Expand Up @@ -82,6 +83,19 @@ Public Class IBoardpfrm
' Me.Close()
'End Sub

'在Alt+Tab中隐藏
Const WS_EX_COMPOSITED = &H2000000 '0x02000000
Const WS_EX_NOACTIVATE = &H8000000 '0x08000000
Const WS_EX_TOOLWINDOW = &H80 '0x00000080
Const WS_EX_TRANSPARENT = &H20 '0x00000020
Protected Overrides ReadOnly Property CreateParams As CreateParams
Get
Dim cp As CreateParams = MyBase.CreateParams
cp.ExStyle = cp.ExStyle Or WS_EX_TOOLWINDOW Or WS_EX_COMPOSITED Or WS_EX_NOACTIVATE Or WS_EX_TRANSPARENT
Return cp
End Get
End Property

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
IBoardprms.ShowDialog()
End Sub
Expand Down Expand Up @@ -148,7 +162,7 @@ Public Class IBoardpfrm
'End Sub

Private Sub pfrm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

' 获取当前窗体的 DPI
Dim currentDpiX As Single = Me.CreateGraphics().DpiX
Dim currentDpiY As Single = Me.CreateGraphics().DpiY
Expand Down Expand Up @@ -525,7 +539,7 @@ Public Class IBoardpfrm
pfile = pfile1
PictureBox1.Load(pfile)
IBoardprms.TextBox1.Text = pfile1
NotifyIcon1.Text = "图片展示小工具 - 已打开图片"
NotifyIcon1.Text = "图片展示小工具 - 已打开图片"
CFileState.Text = "已打开文件:" & pfile
ImgAutoLoad = 1
If UnSaveData = 0 Then
Expand All @@ -534,7 +548,7 @@ Public Class IBoardpfrm
Catch ex As Exception
pfile = pfile1
IBoardprms.TextBox1.Text = ""
NotifyIcon1.Text = "图片展示小工具 - 未打开图片"
NotifyIcon1.Text = "图片展示小工具 - 未打开图片"
CFileState.Text = "未打开文件。"
ImgAutoLoad = 0
MessageBox.Show("图片加载失败。", "图片展示小工具 - 错误", MessageBoxButtons.OK, MessageBoxIcon.Error)
Expand Down Expand Up @@ -617,13 +631,13 @@ Public Class IBoardpfrm
NotifyIcon1.Visible = False
End Sub

Private Sub NotifyIcon1_MouseDoubleClick(sender As System.Object, e As System.Windows.Forms.MouseEventArgs) Handles NotifyIcon1.MouseDoubleClick
Private Sub NotifyIcon1_MouseDoubleClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles NotifyIcon1.MouseDoubleClick
Me.Hsate = 0
CHide.Text = "隐藏(&H)"
Me.Show()
End Sub

Private Sub CHide_Click(sender As System.Object, e As System.EventArgs) Handles CHide.Click
Private Sub CHide_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CHide.Click
If Hsate = 0 Then
Me.Hsate = 1
CHide.Text = "显示(&S)"
Expand All @@ -640,4 +654,15 @@ Public Class IBoardpfrm
Me.Show()
End If
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
SetWindowPos(Me.Handle, HWND_TOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS)
End Sub
<DllImport("user32.dll")>
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
End Function

Const HWND_TOPMOST = -1
Const SWP_NOSIZE As UInteger = &H1
Const SWP_NOMOVE As UInteger = &H2
Const TOPMOST_FLAGS As UInteger = SWP_NOMOVE Or SWP_NOSIZE
End Class
4 changes: 2 additions & 2 deletions Src/UsefulControl/My Project/AssemblyInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' 方法是按如下所示使用“*”:
' <Assembly: AssemblyVersion("1.0.*")>

<Assembly: AssemblyVersion("1.0.13.25011")>
<Assembly: AssemblyFileVersion("1.0.13.25011")>
<Assembly: AssemblyVersion("1.0.14.25021")>
<Assembly: AssemblyFileVersion("1.0.14.25021")>
18 changes: 14 additions & 4 deletions Src/UsefulControl/SeewoFakeShut.vb
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,39 @@
'* Seewo Fake Shutdown UI. *
'* *
'\*****************************************************/
Imports System.Runtime.InteropServices

Public Class SeewoFakeShut
Public ReTime As Integer
Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.Close()
End Sub

Private Sub SeewoFakeShut_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Private Sub SeewoFakeShut_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ReTime = 10

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

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

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
'Const HWND_TOPMOST = -1
'Const SWP_NOSIZE As UInteger = &H1
'Const SWP_NOMOVE As UInteger = &H2
'Const TOPMOST_FLAGS As UInteger = SWP_NOMOVE Or SWP_NOSIZE
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.Close()
End Sub
Private Sub Button1_MouseMove(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.MouseMove
Expand Down

0 comments on commit 4022ddb

Please sign in to comment.