----boundary-LibPST-iamunique-1722668324_-_-
Content-type: text/plain
Hi Helmut,
Returning to your original Boss3 example, if you make sure that you
process the message queue in your Delay loop like so:
PROCEDURE Delay* (delta: LONGINT); (* delta time to wait in [ms] *)
VAR t: LONGINT; msg: WinApi.MSG; res: INTEGER;
BEGIN
t := Services.Ticks() + delta;
REPEAT
IF WinApi.PeekMessage(msg, 0, 0, 0, WinApi.PM_REMOVE) # 0 THEN
res := WinApi.TranslateMessage(msg);
res := WinApi.DispatchMessageA(msg)
END
UNTIL Services.Ticks() > t
END Delay;
then you will be able to move windows, resize windows, enter text into
dialog boxes, run other commands, quit BlackBox etc. etc. during the
delay.
However, one quirk I noticed is that if you enter text in another
window, although the cursor moves, the text does not appear until the
delay loop terminates. Why, I don't know. Also, your clock and rotating
cube still freeze.
Anyway, I hope this helps towards a general solution,
Chris Burrows
CFB Software
http://www.cfbsoftware.com/gpcp
> -----Original Message-----
> From: blackbox{([at]})nowhere.xy
> Behalf Of Collection
> Sent: Saturday, 13 May 2006 7:32 AM
> To: BlackBox Mailing List
> Subject: [BlackBox] - A Cookbook Topic: "Delay", "WaitUntil"
> and "Let's see actions"
>
>
> Dear BlackBox users,
>
> first I would like to say thank you to everybody who send me
> an answer of my cookbook request. I would like to explain
> what I need once again:
>
>
> All I need is to suspend my current foreground task and start
> it again automatically not before a given (short) time.
>
> ... my running program before the delay ...
> Services.DoLaterContinue(notBefore)
> ... my running program after the delay ...
>
> The procedure DoLaterContinue suspend (stop) my program and
> restart it at the current position after the time notBefore.
> This maybe done via the action control. It needn't the exact
> time. The notBefore is accurate enough.
>
>
>
> Another solution maybe:
> Just to have a call to the PROCEDURE
> "HostOrSystemWorkingLoop". It runs thru all system tasks once
> and then returns the control to my program. It is just a call
> back functions to keep the cooperative multitasking running.
> The time should be use for updating & resize windows, doing
> the actions and so on. And of course give the control back to
> my program.
>
>
> I won't waste my computer power by doing silly loops. I
> couldn't believe that a simple "wait a second" rise so much problems.
>
> Regards
>
> Helmut
>
> --- BlackBox
> --- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy>
>
--- BlackBox
--- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy
----boundary-LibPST-iamunique-1722668324_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIEhpIEhlbG11dCxccGFyDQpccGFyDQpSZXR1cm5p
bmcgdG8geW91ciBvcmlnaW5hbCBCb3NzMyBleGFtcGxlLCBpZiB5b3UgbWFrZSBzdXJlIHRoYXQg
eW91XHBhcg0KcHJvY2VzcyB0aGUgbWVzc2FnZSBxdWV1ZSBpbiB5b3VyIERlbGF5IGxvb3AgbGlr
ZSBzbzpccGFyDQpccGFyDQogIFBST0NFRFVSRSBEZWxheSogKGRlbHRhOiBMT05HSU5UKTsgXHRh
YiAoKiBkZWx0YSB0aW1lIHRvIHdhaXQgaW4gW21zXSAqKVxwYXINCiAgICBWQVIgdDogTE9OR0lO
VDsgbXNnOiBXaW5BcGkuTVNHOyByZXM6IElOVEVHRVI7IFxwYXINCiAgQkVHSU5ccGFyDQogICAg
dCA6PSBTZXJ2aWNlcy5UaWNrcygpICsgZGVsdGE7XHBhcg0KICAgIFJFUEVBVFxwYXINCiAgICAg
IElGIFdpbkFwaS5QZWVrTWVzc2FnZShtc2csIDAs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