RE: [BLACKBOX] Cursor re-focus

From: null <">
Date: Fri, 17 Sep 2010 14:08:26 +0000

----boundary-LibPST-iamunique-421304654_-_-
Content-type: text/plain

Dear Doug,

having encountered recently a similar problem, when working with folds,
I digged through the BlackBox mailing List and found your solution,
which you posted in March:

> -----Original Message-----
> From: BlackBox [mailto:BLACKBOX{([at]})nowhere.xy
> Douglas G. Danforth
> Sent: Tuesday, March 02, 2010 5:20 AM
[...]
>
> PROCEDURE SetFocus;
> VAR res: INTEGER; win: HostWindows.Window;
> BEGIN
> win := HostWindows.dir.Focus(Controllers.targetPath);
> res := WinApi.SetFocus(win.wnd);
> res := WinApi.UpdateWindow(win.wnd)
> END SetFocus;

I am just curious: Can you explain the inner workings of it to me?

Below is my solution, which does not even require changing any of the BlackBox modules, it requires only a little addition to Std/Rsrc/Fold.odc, which is included below as StdCoded text.
--
  Bernhard 
---------------------
MODULE PrivFocus;
(*
  *  posted to the BlackBox Mailing List on 2-Mar-2010 by Doug Danforth
 *)
IMPORT Controllers, WinApi, HostWindows;
PROCEDURE ReFocus*;
	VAR res: INTEGER; win: HostWindows.Window;
    BEGIN
        win := HostWindows.dir.Focus(Controllers.targetPath);
        res := WinApi.SetFocus(win.wnd);
        res := WinApi.UpdateWindow(win.wnd)
    END ReFocus;
END PrivFocus.
--------------------
StdCoder.Decode ..,, ..Di....3Qw7uP5PRPPNR9Rbf9b8R79FTvMf1GomCrlAy2xhX,Cb2x
 hXhC6FU1xhiZiVBhihgmRiioedhgrZcZRiXFfaqmSrtuGfa4700zdGrr8rmCLLCJuyKtYcZRiX
 7.2.s,63L.,6.5Qw7uP51QCPuP7PNN9F9vQAy1xB.gdj,UBxhYhAbf9P0G2sIdvPZntgcghghZ
 cZRC8T0E.Ele.H.pe02.,U0eFTfQPfJHPNCbHZiYpedhgrZ6MwBuPZ1QCh0708T,U..w.YU8.,
 sUOor8bBxhYltQ8qorGqmY6Mw.sQq2Y6cwB.0.nM0I,AW7E.0E.E,RcjpBZvPNvQRt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G.fpG2Ut1Z.0.VH.2.292.7.sE.sEmajtQKa2NO4agtPS4,s6CZttQGbZNPe
 X1,CbaMN0.,.U,.PhA,F54pAMXDFbnNCIEU.EAF.E.1U.E0UYdFUYtQUmNN4aoNNWWlM8iXU6I
 85.C4CbicIcF.6.OW1,4466,MNWbkNMu4KaY7.0...L6xIisA1l8QTEpKPCIkmX.6.IH6.Ik.6
 .0E0.O2m4C5C2.680XdsC6I.UX,uWGNNO2.0U1dQMMUU2UXd7yag7P6QMNG4,6...AlP20Z1,e
 sxEpKPC2k.6.U0Cy4V1xhi,NPNZvQRtIdnVyKrG5EWKqt2Ulr6..bf95uP.Y62.5011Z1cQ...
 sQR,.G20EtH.0..M0E.I.6.3M.Vfl2cNk06.0U,YVsH4WDXQoHllyPDIklb6.Qcj,.k8U...F.
 ,..lwGbHESmF3kwL,,AzJEAyIo2oe2H,.Hq1...
 --- end of encoding ---
----boundary-LibPST-iamunique-421304654_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIERlYXIgRG91ZyxccGFyDQpccGFyDQpoYXZpbmcg
ZW5jb3VudGVyZWQgcmVjZW50bHkgYSBzaW1pbGFyIHByb2JsZW0sIHdoZW4gd29ya2luZyB3aXRo
IGZvbGRzLCBccGFyDQpJIGRpZ2dlZCB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Ri42Lk9XMSw0NDY2LE1OV2JrTk11
NEthWTcuMC4uLkw2eElpc0ExbDhRVEVwS1BDSWttWC42LklINi5Jay42XHBhcg0KIC4wRTAuTzJt
NEM1QzIuNjgwWGRzQzZJLlVYLHVXR05OTzIuMFUxZFFNTVVVMlVYZDd5YWc3UDZRTU5HNCw2Li4u
QWxQMjBaMSxlXHBhcg0KIHN4RXBLUEMyay42LlUwQ3k0VjF4aGksTlBOWnZRUnRJZG5WeUtyRzVF
V0txdDJVbHI2Li5iZjk1dVAuWTYyLjUwMTFaMWNRLi4uXHBhcg0KIHNRUiwuRzIwRXRILjAuLk0w
RS5JLjYuM00uVmZsMmNOazA2LjBVLFlWc0g0V0RYUW9IbGx5UERJa2xiNi5RY2osLms4VS4uLkYu
XHBhcg0KICwuLmx3R2JIRVNtRjNrd0wsLEF6SkVBeUlvMm9lMkgsLkhxMS4uLlxwYXINCiAtLS0g
ZW5kIG9mIGVuY29kaW5nIH19AHdzLmRpci4=
----boundary-LibPST-iamunique-421304654_-_---
Received on Fri Sep 17 2010 - 16:08:26 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:30:30 UTC