Desktop Functions: Smart Device Functions:
|
getwindowthreadprocessid (user32)
C# Signature:
[DllImport("user32.dll", SetLastError=true)] VB.Net Signature:
<DllImport("user32.dll", SetLastError:=True)> _ User-Defined Types:None. Notes:None. Tips & Tricks:We can use this API to get ProcessID from Window's Title by combining this function with EnumWindows. Sample Code (VB):
If objAcc Is Nothing Then Sample Code (C#):
IntPtr pID = GetWindowThreadProcessId(GetForegroundWindow(), IntPtr.Zero); GetWindowThreadProcessId returns the id of the thread that created the target window. To get the process id of a window, use the first c# signature above, and: Sample Code (C#):uint processID= 0; uint threadID=GetWindowThreadProcessId(hWnd, out processID); Alternative Managed API:Do you know one? Please contribute it! Sneha Please edit this page!Do you have...
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more). |
|