----boundary-LibPST-iamunique-502141743_-_-
Content-type: text/plain
Hello, Wojtek!
WS> On Tue, 5 Sep 2006, Alexander Iljin wrote:
>> It's Ctrl+Break (or, if that hotkey is would be already registered,
>> then Ctrl+Shift+Break).
WS> What is this supposed to do? I tried both on my BB 1.5 running on Win2k.
WS> Nothing happens. BB is idle at this point, so I have full control and
WS> I do not need to break anything. But I expected a trap to pop up when
WS> I press the Ctrl+Break or Ctrl+Shift+Break. Nothing happened.
WS> So what is this key combination supposed to do on the idle system,
WS> if anything?
There are two threads of execution in BlackBox. One is the main
thread where everything happens, the other is a Keyboard Watcher
(KW). Its entire code is in Kernel.KeyboardWatcher procedure. The KW
sets up a hot key (Ctrl+Break, or if that key is taken,
Ctrl+Shift+Break). When it gets a WM_HOTKEY message from the OS, it
enters a loop. In this loop the KW does the following:
- pause main thread;
- check if the main thread's execution pointer is outside the
"Kernel" module; if it is, then KW sets a trap flag for the main
thread and leaves the loop, resuming main thread; if execution
pointer is in the address space of "Kernel" module, the loop
continues;
- resume main thread;
- call KERNEL32.Sleep(0).
This loop is executed for one second (1000 ticks) maximum, then
aborted, whether successfull or not.
The call to KERNEL32.Sleep(0) tells OS that the calling thread is
willing to give up the rest of its processor time slack. This gives
the main thread a chance to leave Kernel and be paused in some other
place later on. Only a chance, but no guaranty.
When BB is idle, you will most probably trap it in some sort of
repainting activity, like HostWindows.UpdateScrollbar or
HostWindows.Idle. Anyway, on my system (XPsp2) I see trap window
after pressing Ctrl+Break about 1 time out of 10. Sometimes more
often, sometimes it just does not work at all.
---=====---
Alexander
--- BlackBox
--- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy
----boundary-LibPST-iamunique-502141743_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZt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