發表文章

目前顯示的是 7月, 2024的文章

Lock workstation III

圖片
Picture 1  \     As shown in Picture 1, before you copy and paste the following code to be compiled, not only the project  MyBlog_Created_202407_09  must be created,but also the code  CodeFile1.vb  has to be added in. Picture 2 Imports System.Runtime.InteropServices Partial Public Class Form1     Private Sub Form1_HandleCreated(sender As Object, e As EventArgs) Handles Me.HandleCreated         MyCode_put_in_This_module.DeleteBlankLines = New Delete_Blank_Lines(CType(sender, Form1).Handle)         RegisterHotKey(Me.Handle, HotKey_ID1, MOD_ALT Or MOD_NOREPEAT, CUInt(Keys.A))         RegisterHotKey(Me.Handle, HotKey_ID2, MOD_ALT Or MOD_NOREPEAT, CUInt(Keys.B))     End Sub     Protected Overrides Sub WndProc(ByRef m As Message)         If m.Msg = WM_HOTKEY Then             MyCode_put_in_This_module.OnHotKey(m)   ...

Lock workstation II

圖片
Picture 1 First,the project  MyBlog_Created_2024_07_09  must be created,and then the following code can be added in. Picture 2                                                                 Picture 3 Imports System.Globalization Imports System.Runtime.InteropServices Imports System.Text Partial Public Class Form1     Private Sub Form1_Resize(sender As Object, e As EventArgs) Handles Me.Resize         MyCode_put_in_This_module.Form1Resize(CType(sender, Control))     End Sub     Private Sub Form1_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint         MyCode_put_in_This_module.Form1Paint(e.Graphics)     End Sub     Private Sub Form1_GotFocus(sender As Object, e As EventArgs) Handles Me.GotFocus       ...

Lock workstation

圖片
Public Class Form1     Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load         MyCode_put_in_This_module.Initialze()     End Sub     Private Sub Form1_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing         MyCode_put_in_This_module.CloseModule()     End Sub End Class Module MyCode_put_in_This_module     Dim Soundplayer As New System.Media.SoundPlayer     Dim Button1 As NativeWindow_Button     Public Const edge As Int32 = 5     Public Class NativeWindow_Button         Inherits NativeWindow         Implements IDisposable         Protected Overrides Sub WndProc(ByRef m As Message)             Select Case m.Msg                 Case WM_WTSSESSION_CHANGE         ...