How to simulate "MsgBox"

Post a reply

Confirmation code
Enter the code exactly as it appears. All letters are case insensitive.
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review

Expand view Topic review: How to simulate "MsgBox"

Re: How to simulate "MsgBox"

Post by arcticir » 22 Aug 2017, 18:13

This simply means that "65306" has the same functionality as "pause".
It does not solve the "pause" can not solve the problem.


I found a way to accurately restore a suspended thread.

Code: [Select all] [Expand]GeSHi © Codebox Plus

Re: How to simulate "MsgBox"

Post by HotKeyIt » 22 Aug 2017, 16:46

You can't pause a pseudo thread, it must be a real thread.

For some reason PostThreadMessage does not work, probably because of Messages sent by PostThreadMessage are not associated with a window.

Try this:

Code: [Select all]GeSHi © Codebox Plus

aThread:=ExeThread("#Persistent`nSetTimer `"a`", 100`nReturn`na:`nToolTip A_TickCount `" - `" A_ThreadId`nReturn")
Sleep 1000
PostMessage_(aThreadHwnd, 0x111, 65306)


Re: How to simulate "MsgBox"

Post by arcticir » 21 Aug 2017, 18:10

I do not understand.
Take this example, how to restore the earliest suspended "A" thread?

Code: [Select all] [Expand]GeSHi © Codebox Plus

In addition, can there be any way to achieve this example of the program?

Code: [Select all] [Expand]GeSHi © Codebox Plus

Re: How to simulate "MsgBox"

Post by HotKeyIt » 21 Aug 2017, 15:58

Thread Id can be retrieved via A_ThreadId.
Try PostThreadMessage(A_ThreadId, 65306) to pause the thread.

How to simulate "MsgBox"

Post by arcticir » 21 Aug 2017, 07:46

I tried using the following code instead of "MsgBox".
It is very fast and supports selecting / editing / copying text
  Even loading a few MB of text is also extremely responsive.

But the "WinWaitClose" command brought a huge disaster.
We know that a script can have multiple "MsgBox" windows at the same time,
Before you click "OK", the thread is in a paused state.
This is very friendly.
And "WinWaitClose" is the opposite
It hinders other threads,
Even if other processes use "Accessible" to view this window,
It will make this process stagnant.
I spent a lot of time looking for the cause of the process of stagnation.

I try to find a perfect solution like "MsgBox" treat threads

I think, can we make precise opening / closing of threads?

Code: [Select all] [Expand]GeSHi © Codebox Plus

So, can add a variable that marks the thread?
In order to accurately control the state of the thread.
What do you think?

Code: [Select all] [Expand]GeSHi © Codebox Plus