[Pharo-dev] How to listen for windows messages?

lw1990 lukewallace1990 at gmail.com
Tue Feb 28 00:04:11 EST 2017

In the OS-Windows package, there exists the ability to use the windows api in
This is very powerful, and I intend to add more of the windows api into it
(it's only partially implemented).

This appears to all have been done with DllCalls (FFI calls) so far.

A big part of interacting with windows is listening to/intercepting and
responding to windows messages.
For example, every time a user presses a key on the keyboard, a windows
message will happen in the background for that key. If Pharo was aware of
these messages, then Pharo could do things in response to hotkeys pressed on
Windows (outside of a pharo window).

It would also make reacting to events potentially nicer. Like making a
windows-desktop-manager in Pharo that can tell when a new window is created
by windows (maybe they opened notepad). It would certainly be better than an
infinite loop or timer of 'get active window and compare to last active
window and see if it changed'. Instead it would be 'when receive the
WM_MESSAGE for new window created, notify Pharo so it can react'.

How can I set up a windows message hook in Pharo?
Please keep in mind I'm very new to programming, but I work from home and
have lots of time to learn :-)

View this message in context: http://forum.world.st/How-to-listen-for-windows-messages-tp4936285.html
Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.

More information about the Pharo-dev mailing list