Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8036859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:45:30+00:00 2026-06-05T02:45:30+00:00

C++11’s standard library contains <thread> which allows threads to be created. However, the Windows

  • 0

C++11’s standard library contains <thread> which allows threads to be created. However, the Windows api requires an ID for some functions (PostThreadMessage, namely). How can I get it?

remark: std::thread::get_id() doesn’t seem to work:

PostThreadMessage(m_thread->get_id(), WM_QUIT, 0, 0);

e:\documents\khook\khooker\hook_runner.cpp(129): error C2664: 'PostThreadMessageW' : cannot convert parameter 1 from 'std::thread::id' to 'DWORD'
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T02:45:32+00:00Added an answer on June 5, 2026 at 2:45 am

    Use the member function native_handle(). It provides the native thread handle. Then you can call GetThreadId() on it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While searching for some functions in C++ standard library documentation I read that push
Suppose I have a library which contains a bunch of interdependent functions, this library
The filecmp module from the standard library contains a the dircmp class which has
I have a shared library say foo.so which contains a function called initialize() .
So the standard c++ library mainly contains roughly 7 categories, what's the rationale/prototype that
While learning C I regularly come across resources which recommend that some functions (e.g.
Buffer overrun problems are well known. Thus we were blessed with standard library functions
I just created a C++ Standard Dynamic library project using Xcode and compiled using
In standard library, I found that namespace std is declared as a macro. #define
The standard library namedtuple class looks to me like a way to make tuples

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.