PostThreadMessage失败,消息队列未创建,怎样创建?(50分)

Z

zdjxy

Unregistered / Unconfirmed
GUEST, unregistred user!
wordThd := TWordActiveThread.Create(oleWord,'e:/sample.word');
if not postThreadMessage(wordThd.ThreadID,MSG_ACTIVEWORD,0,0) then
begin
sleep(100);
postThreadMessage(wordThd.ThreadID,MSG_ACTIVEWORD,0,0);
end;
 
先要在线程中调用任意的 USER 或 GDI Win32 API,才会建立消息队列。
》The system creates a thread's message queue when the thread makes its first
》call to one of the Win32 USER or GDI functions.
 
给出代码,一句都行
 
在线程创建时调用:
var
Msg: TMsg;
GetMessage(Msg, 0, 0, 0);
 
还是用 PeekMessage 吧
 
接受答案了.
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
顶部