RE: [EXT] Microsoft UI Automation in VisualWorks?
Mark Plas <[email protected]> Wed, 19 Nov 2025 13:58:08 +0000
| Newsgroups | gmane.comp.lang.smalltalk.vwnc |
|---|---|
| Message-ID | <AM8PR05MB79545A2DB2322F56747CD9D9FAD7A@AM8PR05MB7954.eurprd05.prod.outlook.com> |
--_000_AM8PR05MB79545A2DB2322F56747CD9D9FAD7AAM8PR05MB7954eurp_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
(small clarification)
To be clear, I would want VisualWorks to be on the 'server side' of the UI =
automation. It should be possible for other applications to ask our applica=
tion "What UI-control is located at these coordinates".
I want to be able to respond to other applications sending (for instance) t=
he following message to our windows:
https://urldefense.com/v3/__https://learn.microsoft.com/en-=
us/windows/win32/api/oleacc/nf-oleacc-accessibleobjectfrompoint__;!!DZ3fjg!=
--JRTVqj4-t9Dgu_w5Ux9SrRHMRfFhCysUZwgiipq2-k8_MWWuKKw6Q9APFOD0I-kHwBWzfWOG8=
vdD6fN7Of00DH$=20
Mark
From: [email protected] <[email protected]=
elschool.illinois.edu> On Behalf Of Mark Plas
Sent: Wednesday, November 19, 2025 12:24 PM
To: '[email protected]' <[email protected]>
Subject: [EXT] [vwnc] Microsoft UI Automation in VisualWorks?
Warning: This is an external email. Do not click on links or open attachmen=
ts unless you recognize the sender and know the content is safe.
Hi all,
Has anyone ever implemented Microsoft UI Automation in VisualWorks?
https://urldefense.com/v3/__https://learn.microsoft.com/en-us/windows/win32=
/winauto/entry-uiauto-win32__;!!DZ3fjg!--JRTVqj4-t9Dgu_w5Ux9SrRHMRfFhCysUZw=
giipq2-k8_MWWuKKw6Q9APFOD0I-kHwBWzfWOG8vdD6fN2i6Uwfo$ <https://urldefense.c=
om/v3/__https:/learn.microsoft.com/en-us/windows/win32/winauto/entry-uiauto=
-win32__;!!DZ3fjg!_aQGOK7EA64lDd39rsL3YgMyNrjpz-h71lMBNG-HmSuaCpXFN4HqRsEhP=
wgCPsx8cr6dxMreJnNEF_VebzM95XCf$>
This is becoming a requirement for us, and I wanted to know if anyone has e=
ver done this before.
Alternatively, does anyone know how to intercept a windows message and retu=
rn a result for it from within VisualWorks?
As a small experiment, I tried to intercept the WM_GETOBJECT message as des=
cribed here:
https://urldefense.com/v3/__https://learn.microsoft.com/en-=
us/windows/win32/winauto/wm-getobject__;!!DZ3fjg!--JRTVqj4-t9Dgu_w5Ux9SrRHM=
RfFhCysUZwgiipq2-k8_MWWuKKw6Q9APFOD0I-kHwBWzfWOG8vdD6fN769veqE$ <https://ur=
ldefense.com/v3/__https:/learn.microsoft.com/en-us/windows/win32/winauto/wm=
-getobject__;!!DZ3fjg!_aQGOK7EA64lDd39rsL3YgMyNrjpz-h71lMBNG-HmSuaCpXFN4HqR=
sEhPwgCPsx8cr6dxMreJnNEF_Veb6sI9g7W$>
In order to do this from within Smalltalk, I tried to replace the window pr=
ocedure of a window, with a callback like this:
| callback old |
old :=3D self getWindowLong: aWindow windowHandle nIndex: -=
4.
callback :=3D CCallback
do: [:hwnd =
:uMsg :wParam :lParam | self CallWindowProcWWith: old with: hwnd with: uMsg=
with: wParam with: lParam]
ofType: sel=
f WNDPROC pointerType.
self setWindowLongPtr: aWindow windowHandle nIndex: -4 dwNe=
wLong: callback.
self halt
In the callback I just call the old window procedure, so the window should =
just behave as if nothing was changed.
However, this doesn't really work. As long as I only move the mouse over a =
window it seems to work, but as soon as I click on a window VisualWorks sto=
ps handling messages and the application needs to be killed.
Does anyone know how to do this?
In summary:
* Has anyone implemented Microsoft UI Automation in VisualWorks?
* Does anyone know how to intercept windows messages and return a resul=
t for them from within VisualWorks Smalltalk code?
Thanks in advance,
Mark
--_000_AM8PR05MB79545A2DB2322F56747CD9D9FAD7AAM8PR05MB7954eurp_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" xmlns:w=3D"urn:sc=
hemas-microsoft-com:office:word" xmlns:m=3D"http://schemas.microsoft.com/of=
fice/2004/12/omml" xmlns=3D"http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii">
<meta name=3D"Generator" content=3D"Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Aptos;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:12.0pt;
font-family:"Aptos",sans-serif;
mso-ligatures:standardcontextual;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#467886;
text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
font-size:12.0pt;
font-family:"Aptos",sans-serif;
mso-ligatures:standardcontextual;}
span.EmailStyle21
{mso-style-type:personal-reply;
font-family:"Aptos",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
mso-ligatures:none;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:797534769;
mso-list-template-ids:923320416;}
@list l0:level1
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:36.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l0:level2
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:72.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l0:level3
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:108.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l0:level4
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:144.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l0:level5
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:180.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l0:level6
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:216.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l0:level7
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:252.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l0:level8
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:288.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l0:level9
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:324.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l1
{mso-list-id:1367607372;
mso-list-type:hybrid;
mso-list-template-ids:-172470470 301370246 67698691 67698693 67698689 6769=
8691 67698693 67698689 67698691 67698693;}
@list l1:level1
{mso-level-start-at:2850;
mso-level-number-format:bullet;
mso-level-text:-;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Aptos",sans-serif;
mso-fareast-font-family:Aptos;
mso-bidi-font-family:"Times New Roman";}
@list l1:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l1:level3
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l1:level4
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l1:level5
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l1:level6
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l1:level7
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l1:level8
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l1:level9
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></style>
</head>
<body lang=3D"EN-US" link=3D"#467886" vlink=3D"#96607D" style=3D"word-wrap:=
break-word">
<div class=3D"WordSection1">
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt">(small clarificatio=
n)<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt"><o:p> </o:p></=
span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt">To be clear, I woul=
d want VisualWorks to be on the ‘server side’ of the UI automat=
ion. It should be possible for
<b>other</b> applications to ask our application “What UI-control is =
located at these coordinates”.<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt"><o:p> </o:p></=
span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt">I want to be able t=
o respond to other applications sending (for instance) the following messag=
e to our windows:<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt"><o:p> </o:p></=
span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt"> &=
nbsp; <a =
href=3D"https://urldefense.com/v3/__https://learn.microsoft.com/en-us/windo=
ws/win32/api/oleacc/nf-oleacc-accessibleobjectfrompoint__;!!DZ3fjg!--JRTVqj=
4-t9Dgu_w5Ux9SrRHMRfFhCysUZwgiipq2-k8_MWWuKKw6Q9APFOD0I-kHwBWzfWOG8vdD6fN7O=
f00DH$">
https://learn.microsoft.com/en-us/windows/win32/api/oleacc/nf-oleacc-access=
ibleobjectfrompoint</a><o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt"><o:p> </o:p></=
span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt">Mark<o:p></o:p></sp=
an></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt"><o:p> </o:p></=
span></p>
<div>
<div style=3D"border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm =
0cm 0cm">
<p class=3D"MsoNormal"><b><span style=3D"font-size:11.0pt;font-family:"=
;Calibri",sans-serif;mso-ligatures:none">From:</span></b><span style=
=3D"font-size:11.0pt;font-family:"Calibri",sans-serif;mso-ligatur=
es:none"> [email protected] <vwnc-request@lis=
ts.siebelschool.illinois.edu>
<b>On Behalf Of </b>Mark Plas<br>
<b>Sent:</b> Wednesday, November 19, 2025 12:24 PM<br>
<b>To:</b> '[email protected]' <[email protected]><br>
<b>Subject:</b> [EXT] [vwnc] Microsoft UI Automation in VisualWorks?<o:p></=
o:p></span></p>
</div>
</div>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p align=3D"center" style=3D"mso-margin-top-alt:0cm;margin-right:0cm;margin=
-bottom:.5pt;margin-left:61.2pt;text-align:center;background:#FFFFCC">
<b><span style=3D"color:red">Warning:</span></b><span style=3D"color:black"=
> This is an external email. Do not click on links or open attachments unle=
ss you recognize the sender and know the content is safe.<o:p></o:p></span>=
</p>
<div>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt">Hi all,<o:p></o:p><=
/span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt"><o:p> </o:p></=
span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt">Has anyone ever imp=
lemented <b>
Microsoft</b> UI Automation in VisualWorks?<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt"><o:p> </o:p></=
span></p>
<p class=3D"MsoNormal" style=3D"text-indent:36.0pt"><span style=3D"font-siz=
e:11.0pt"><a href=3D"https://urldefense.com/v3/__https:/learn.microsoft.com=
/en-us/windows/win32/winauto/entry-uiauto-win32__;!!DZ3fjg!_aQGOK7EA64lDd39=
rsL3YgMyNrjpz-h71lMBNG-HmSuaCpXFN4HqRsEhPwgCPsx8cr6dxMreJnNEF_VebzM95XCf$">=
https://learn.microsoft.com/en-us/windows/win32/winauto/entry-uiauto-win32<=
/a><o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt"><o:p> </o:p></=
span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt">This is becoming a =
requirement for us, and I wanted to know if anyone has ever done this befor=
e.<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt"><o:p> </o:p></=
span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt">Alternatively, does=
anyone know how to intercept a windows message and return a result for it =
from within VisualWorks?<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt"><o:p> </o:p></=
span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt">As a small experime=
nt, I tried to intercept the WM_GETOBJECT message as described here:<o:p></=
o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt"><o:p> </o:p></=
span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt"> &=
nbsp; <a =
href=3D"https://urldefense.com/v3/__https:/learn.microsoft.com/en-us/window=
s/win32/winauto/wm-getobject__;!!DZ3fjg!_aQGOK7EA64lDd39rsL3YgMyNrjpz-h71lM=
BNG-HmSuaCpXFN4HqRsEhPwgCPsx8cr6dxMreJnNEF_Veb6sI9g7W$">
https://learn.microsoft.com/en-us/windows/win32/winauto/wm-getobject</a><o:=
p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt"><o:p> </o:p></=
span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt">In order to do this=
from within Smalltalk, I tried to replace the window procedure of a window=
, with a callback like this:<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt"><o:p> </o:p></=
span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt"> &=
nbsp; | c=
allback old |<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt"> &=
nbsp; old=
:=3D self getWindowLong: aWindow windowHandle nIndex: -4.<o:p></o:p></span=
></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt"> &=
nbsp; cal=
lback :=3D CCallback<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt"> &=
nbsp; &nbs=
p; &=
nbsp; &nbs=
p; &=
nbsp; do: [:hwnd :uMs=
g :wParam :lParam | self CallWindowProcWWith: old with: hwnd with: uMsg wit=
h: wParam with: lParam]<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt"> &=
nbsp; &nbs=
p; &=
nbsp; &nbs=
p; &=
nbsp; ofType: self WN=
DPROC pointerType.<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt"> &=
nbsp; sel=
f setWindowLongPtr: aWindow windowHandle nIndex: -4 dwNewLong: callback.<o:=
p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt"> &=
nbsp; sel=
f halt<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt"><o:p> </o:p></=
span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt">In the callback I j=
ust call the old window procedure, so the window should just behave as if n=
othing was changed.<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt"><o:p> </o:p></=
span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt">However, this doesn=
’t really work. As long as I only move the mouse over a window it see=
ms to work, but as soon as I click on a window VisualWorks stops handling m=
essages and the application needs to be killed.<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt"><o:p> </o:p></=
span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt">Does anyone know ho=
w to do this?<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt"><o:p> </o:p></=
span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt">In summary:<o:p></o=
:p></span></p>
<ul style=3D"margin-top:0cm" type=3D"disc">
<li class=3D"MsoListParagraph" style=3D"margin-left:0cm;mso-list:l1 level1 =
lfo3"><span style=3D"font-size:11.0pt">Has anyone implemented Microsoft UI =
Automation in VisualWorks?<o:p></o:p></span></li><li class=3D"MsoListParagr=
aph" style=3D"margin-left:0cm;mso-list:l1 level1 lfo3"><span style=3D"font-=
size:11.0pt">Does anyone know how to intercept windows messages and return =
a result for them from within VisualWorks Smalltalk code?<o:p></o:p></span>=
</li></ul>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt"><o:p> </o:p></=
span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt">Thanks in advance,<=
o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:11.0pt">Mark<o:p></o:p></sp=
an></p>
</div>
</div>
</body>
</html>
--_000_AM8PR05MB79545A2DB2322F56747CD9D9FAD7AAM8PR05MB7954eurp_--