Back to Browse

Visual Basic 2010- Window Selection

1.5K views
Jan 23, 2013
9:34

This program will give you a list of open windows and allow you to put a border around the selected one. This can be useful when making a screenshot or screen capture program. ++Section 1++ ======= Imports System.Runtime.InteropServices ======= Private Declare Function GetWindowRect Lib "User32.dll" (ByVal handle As Integer, ByRef rect As RECT) As Integer [LESS_THEN_SIGN]System.Runtime.InteropServices.StructLayout(LayoutKind.Sequential)[GREATER_THEN_SIGN] Private Structure RECT Public Left As Integer Public Top As Integer Public Right As Integer Public Bottom As Integer End Structure ======= ++Section 2++ ======= Dim r As RECT GetWindowRect(p.MainWindowHandle.ToInt32, r) Form2.GroupBox1.Location = New Point(r.Left, r.Top) Form2.GroupBox1.Size = New Size(r.Right - r.Left, r.Bottom - r.Top) Form2.GroupBox1.Text = ListBox1.SelectedItem Form2.BringToFront() =======

Download

1 formats

Video Formats

360pmp412.7 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

Visual Basic 2010- Window Selection | NatokHD