Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个带有 AfxBeginThread() 的程序,它需要将 postmessage 发送到主对话框以更改 listcontrol 数据。
我如何实现这一点,因为我需要传递我想要更改的文本和元素更改文本?我该怎么做?
调用 API 版本的 SendMessage (::SendMessage(hwnd, w, l) 以便您不使用指向对话框的指针。指向对话框的指针是线程本地的。
您传入的 LPARAM ::SendMessage 可以是指向任何内容的指针。如果您需要传递多个参数,则创建一个包含所有参数的结构并将指针传递给该结构。在消息处理函数中,从结构中获取各个参数。