Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Support Forum
Download Visual Studio Add-In

Terms of Use
Privacy Policy

Search Results for "GetCurrentThreadId" in [All]

user32

.

var curThreadId = GetCurrentThreadId();

.

    uint appThread = GetCurrentThreadId();

.

AppDomain.GetCurrentThreadId is marked as deprecated in favour of Thread.ManagedThreadId but this will not to work with unmanaged API.

.

You can use the GetCurrentThreadId API as well:

.

     SetWindowsHookEx(HookType.WH_KEYBOARD, this.myCallbackDelegate, IntPtr.Zero, AppDomain.GetCurrentThreadId());

.

    SetWindowsHookEx(HookType.WH_KEYBOARD, Me.myCallbackDelegate, IntPtr.Zero, AppDomain.GetCurrentThreadId())

kernel32

.

This does not return a real handle, but a fixed value which is interpreted as the current, calling thread by any function which requires a thread handle. To get the real handle, you need to call GetCurrentThreadId, then OpenThread with the returned value along with the necessary permissions and what-not. Then close the handle when you're done with it.

.
Summary
.

static extern uint GetCurrentThreadId();

.

Public Shared Function GetCurrentThreadId() As UInteger

.

  System.AppDomain.GetCurrentThreadId() (This is deprecated in .NET 2.0)

.
Documentation
[GetCurrentThreadId] on MSDN
.

     threadId = (uint)AppDomain.GetCurrentThreadId();

dbghelp

.

static extern uint GetCurrentThreadId();

.

    info.ThreadId = GetCurrentThreadId();


 
Access PInvoke.net directly from VS: