了解Application.DoEvents [英] Understanding Application.DoEvents
问题描述
我想了解Application.DoEvents调用的后果。
它是否会创建一个新线程?
谢谢
Hi,
I''d like to understand consequences of Application.DoEvents call.
Does it create a new thread?
Thank you
推荐答案
" bazad" <无**** @ noreply.not>写在消息中
新闻:1099593932.4 + jIsAHupOrTgThYXFT72g@teranews ...
"bazad" <no****@noreply.not> wrote in message
news:1099593932.4+jIsAHupOrTgThYXFT72g@teranews...
我想了解应用程序的后果。 DoEvents调用。
是否会创建一个新线程?
谢谢
Hi,
I''d like to understand consequences of Application.DoEvents call.
Does it create a new thread?
Thank you
不,它不会创建一个新的线程,它''可能''在当前线程上运行一个模态消息循环
(peekmessage / getmessage / dispatchmessage stuff)。
''可能' '这里意味着 - 在某些条件下 - 如窗口句柄
与线程相关联,并运行交互式会话。
Willy。
No, it doesn''t create a new thread, it ''possibly'' runs a modal message loop
(peekmessage/getmessage/dispatchmessage stuff) on the current thread.
''possibly'' here means- under certain conditions- like a window handle
associated with the thread, and running an interactive session.
Willy.
" Willy Denoyette [MVP]" <无线************* @ pandora.be>写道:
"Willy Denoyette [MVP]" <wi*************@pandora.be> writes:
" bazad" <无**** @ noreply.not>在消息中写道
新闻:1099593932.4+jIsAHupOrTgThYXFT72g@teranews ...
"bazad" <no****@noreply.not> wrote in message
news:1099593932.4+jIsAHupOrTgThYXFT72g@teranews...
我想了解Application.DoEvents调用的后果。<它是否会创建一个新线程?
谢谢
Hi,
I''d like to understand consequences of Application.DoEvents call.
Does it create a new thread?
Thank you
不,它没有创建新线程,它可能''在当前线程上运行模态消息循环
(peekmessage / getmessage / dispatchmessage stuff)。
''可能''这里意味着 - 在某些条件下 - 如窗口句柄
Willy。
No, it doesn''t create a new thread, it ''possibly'' runs a modal message loop
(peekmessage/getmessage/dispatchmessage stuff) on the current thread.
''possibly'' here means- under certain conditions- like a window handle
associated with the thread, and running an interactive session.
Willy.
这是否意味着用户可以在主UI上点击菜单项线程
忙吗?
Does this mean that user can click on menu items while main UI thread
is busy?
" bazad" <无**** @ noreply.not>在消息中写道
news:1099605909.kJ + tXbnQcb3AE70X6mbdMw@teranews ...
"bazad" <no****@noreply.not> wrote in message
news:1099605909.kJ+tXbnQcb3AE70X6mbdMw@teranews...
" Willy Denoyette [MVP]" <无线************* @ pandora.be>写道:
"Willy Denoyette [MVP]" <wi*************@pandora.be> writes:
" bazad" <无**** @ noreply.not>在消息中写道
新闻:1099593932.4+jIsAHupOrTgThYXFT72g@teranews ...
"bazad" <no****@noreply.not> wrote in message
news:1099593932.4+jIsAHupOrTgThYXFT72g@teranews...
>
>
> Hi,
>
这是否意味着用户可以在主UI线程忙碌时点击菜单项?
Does this mean that user can click on menu items while main UI thread
is busy?
我猜你在隐藏这个问题背后的东西:-)。
主UI线程运行自己的消息循环,所以调用DoEvents不是
需要具有响应式UI。如果用户界面没有响应,那么对于一个被阻塞的等待线程,这是一个
指示,所以在你的代码中包含DoEvents
因为赢了而没有帮助执行。
威利。
I guess you are hiding something behind this question :-).
The main UI thread runs his own message loop, so calling DoEvents is not
needed to have a responsive UI. If the UI is not responsive, it''s an
indication for a blocked waiting thread, so including DoEvents in your code
won''t help as it won''t execute.
Willy.
这篇关于了解Application.DoEvents的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!