Uploaded June 2022 | Updated September 2026, 1 week ago
How I hide the blinking cursor in a read-only textbox and richtextbox in VB.NET winforms using the win32 function is below
#vbdotnet
Public Declare Auto Function HideCaret Lib "user32" (ByVal hWnd As IntPtr) As Boolean
How I hide the blinking cursor in a read-only textbox and richtextbox in VB.NET winforms using the win32 function is below
#vbdotnet
Public Declare Auto Function HideCaret Lib "user32" (ByVal hWnd As IntPtr) As Boolean



![C# - Simulate mouse drag with SendInput (codeproject implementation)
How I simulate dragging the mouse in other Windows apps using C# SendInput function. A download from codeproject.com is used to build functions to drag the left and right mouse.
InputSender Download:
https://www.codeproject.com/Articles/5264831/How-to-Send-Inputs-using-Csharp
C# Automation Playlist:
https://youtube.com/playlist?list=PLAW4P1Sb_oJbIJIQd8-HPmsVUE6Ez6NFL&si=3rb4bQHNPmHYsaXs
#csharp
private void LeftDrag(Point start, Point end)
{
InputSender.SetCursorPosition(start.X, start.Y);
InputSender.SendMouseInput(new InputSender.MouseInput[]
{
new InputSender.MouseInput
{
dwFlags = (uint)InputSender.MouseEventF.LeftDown
}
});
Thread.Sleep(100);
InputSender.SetCursorPosition(end.X, end.Y);
// added to fix text not always being selected during drag
Thread.Sleep (100);
InputSender.SendMouseInput(new InputSender.MouseInput[]
{
new InputSender.MouseInput
{
dwFlags = (uint)InputSender.MouseEventF.LeftUp
}
});
} C# - Simulate mouse drag with SendInput (codeproject implementation)](https://i.ytimg.com/vi/FD9GBM3qPFM/mqdefault.jpg)





![VB.NET - Automate desktop apps with Sendkeys and Win32 functions
How I automate Windows desktop apps with VB.NET using Sendkeys and Win32 functions. It covers waiting until a specific window is active, explicit wait, simulating keyboard input with Sendkeys and simulating left click and right click.
#vbdotnet
Win32
Private Declare Function GetForegroundWindow Lib user32 () As IntPtr
Private Declare Auto Function GetWindowText Lib user32 (ByVal hWnd As System.IntPtr, ByVal lpString As System.Text.StringBuilder,
ByVal cch As Integer) As Integer
Public Declare Sub mouse_event Lib user32 (ByVal dwFlags As UInteger, ByVal dx As UInteger, ByVal dy As UInteger, ByVal dwData As UInteger,
ByVal dwExtraInfo As Integer)
Const MOUSEEVENTF_LEFTDOWN As UInteger = &H2
Const MOUSEEVENTF_LEFTUP As UInteger = &H4
Const MOUSEEVENTF_RIGHTDOWN As UInteger = &H8
Const MOUSEEVENTF_RIGHTUP As UInteger = &H10
Regex function
Regex.Replace(str, [+^%~(){}], {$0})
Sendkeys Codes
https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.sendkeys
0:00 Summary of automation tasks
0:20 Wait for active window
1:22 Sendkeys functions
2:45 Mouseclicks
3:32 Demo UI to run scripts VB.NET - Automate desktop apps with Sendkeys and Win32 functions](https://i.ytimg.com/vi/HS_PnrTKrwI/mqdefault.jpg)
