diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..0a40470
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,9 @@
+/Src/.vs/
+
+/Src/*.suo
+
+/Src/UsefulControl-bin/
+
+/Src/UsefulControl/bin/
+
+/Src/UsefulControl/obj/
\ No newline at end of file
diff --git a/README.md b/README.md
index 1ac7bca..6a13149 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
## 关于本项目
diff --git a/Src/UsefulControl.suo b/Src/UsefulControl.suo
index 05db7d4..f167372 100644
Binary files a/Src/UsefulControl.suo and b/Src/UsefulControl.suo differ
diff --git a/Src/UsefulControl/BootForm.vb b/Src/UsefulControl/BootForm.vb
index 19a96f5..71a7740 100644
--- a/Src/UsefulControl/BootForm.vb
+++ b/Src/UsefulControl/BootForm.vb
@@ -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, " ")
'////////////////////////////////////////////////////////////////////////////////////
'//
@@ -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
@@ -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
+ '
+ '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
diff --git a/Src/UsefulControl/IBoard/IBoardpfrm.Designer.vb b/Src/UsefulControl/IBoard/IBoardpfrm.Designer.vb
index e6c15b8..39f2881 100644
--- a/Src/UsefulControl/IBoard/IBoardpfrm.Designer.vb
+++ b/Src/UsefulControl/IBoard/IBoardpfrm.Designer.vb
@@ -32,6 +32,7 @@ Partial Class IBoardpfrm
Me.CFileState = New System.Windows.Forms.ToolStripMenuItem()
Me.ToolStripMenuItem1 = New System.Windows.Forms.ToolStripSeparator()
Me.CHide = New System.Windows.Forms.ToolStripMenuItem()
+ Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
Me.FlowLayoutPanel1.SuspendLayout()
CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.ContextMenuStrip1.SuspendLayout()
@@ -107,7 +108,10 @@ Partial Class IBoardpfrm
Me.CHide.Size = New System.Drawing.Size(148, 22)
Me.CHide.Text = "隐藏(&H)"
'
- 'pfrm
+ 'Timer1
+ '
+ '
+ 'IBoardpfrm
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi
@@ -121,7 +125,7 @@ Partial Class IBoardpfrm
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.MaximizeBox = False
Me.MinimizeBox = False
- Me.Name = "pfrm"
+ Me.Name = "IBoardpfrm"
Me.ShowInTaskbar = False
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "图片展示小工具"
@@ -139,4 +143,5 @@ Partial Class IBoardpfrm
Friend WithEvents CFileState As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents ToolStripMenuItem1 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents CHide As System.Windows.Forms.ToolStripMenuItem
+ Friend WithEvents Timer1 As System.Windows.Forms.Timer
End Class
diff --git a/Src/UsefulControl/IBoard/IBoardpfrm.resx b/Src/UsefulControl/IBoard/IBoardpfrm.resx
index 723ebd3..befbd0e 100644
--- a/Src/UsefulControl/IBoard/IBoardpfrm.resx
+++ b/Src/UsefulControl/IBoard/IBoardpfrm.resx
@@ -1729,6 +1729,9 @@
F/8ABBf/AAQW/gAEFv8ABBX/AAQU/gAEFP8ABBP/AAQS/wAEE/8ABxH+AAeI/w==
+
+ 305, 17
+
AAABAAgAAAAAAAAAAAAgzwAAhgAAAEBAAAAAAAAAKEIAAKbPAAAwMAAAAAAAAKglAADOEQEAKCgAAAAA
diff --git a/Src/UsefulControl/IBoard/IBoardpfrm.vb b/Src/UsefulControl/IBoard/IBoardpfrm.vb
index 1eae250..b024a1b 100644
--- a/Src/UsefulControl/IBoard/IBoardpfrm.vb
+++ b/Src/UsefulControl/IBoard/IBoardpfrm.vb
@@ -25,6 +25,7 @@
'* *
'\*****************************************************/
Imports Microsoft.Win32
+Imports System.Runtime.InteropServices
Public Class IBoardpfrm
Public pfile As String
@@ -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
@@ -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
@@ -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
@@ -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)
@@ -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)"
@@ -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
+
+ 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
\ No newline at end of file
diff --git a/Src/UsefulControl/My Project/AssemblyInfo.vb b/Src/UsefulControl/My Project/AssemblyInfo.vb
index 46c3335..a47f182 100644
--- a/Src/UsefulControl/My Project/AssemblyInfo.vb
+++ b/Src/UsefulControl/My Project/AssemblyInfo.vb
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' 方法是按如下所示使用“*”:
'
-
-
+
+
diff --git a/Src/UsefulControl/SeewoFakeShut.vb b/Src/UsefulControl/SeewoFakeShut.vb
index 6cbdbba..da3bde6 100644
--- a/Src/UsefulControl/SeewoFakeShut.vb
+++ b/Src/UsefulControl/SeewoFakeShut.vb
@@ -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
+ '
+ '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