FindWindow

Yazılım notları
Post Reply
ahmet
Site Admin
Posts: 68
Joined: Tue Feb 23, 2021 6:54 pm

FindWindow

Post by ahmet »

Code: Select all

Imports System.Runtime.InteropServices

Public Class Form1
    <DllImport("user32.dll", EntryPoint:="FindWindowW")>
    Public Shared Function FindWindowW(<MarshalAs(UnmanagedType.LPTStr)> ByVal lpClassName As String, <MarshalAs(UnmanagedType.LPTStr)> ByVal lpWindowName As String) As IntPtr
    End Function

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim hWnd As IntPtr = FindWindowW("TheClassName", Nothing)
        If hWnd <> IntPtr.Zero Then
            'do whatever you need with the window handle....
        End If
    End Sub
End Class
Örnek kod kaynağı: https://social.msdn.microsoft.com/Forum ... =vbgeneral
Post Reply