# Events from C++ to Clarion - EVENT()

**URL:** <https://clarionhub.com/t/events-from-c-to-clarion-event/9318>\
**Category:** questions\
**Tags:** winapi\
**Created:** [August 25, 2026, 10:31am UTC](https://clarionhub.com/t/events-from-c-to-clarion-event/9318 "2026-08-25T10:31:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![blue](https://clarionhub.com/letter_avatar_proxy/v4/letter/b/3bc359/32.png) [@blue](https://clarionhub.com/u/blue)\
**Post date:** [August 25, 2026, 10:31am UTC](https://clarionhub.com/t/events-from-c-to-clarion-event/9318/1 "2026-08-25T10:31:45Z")

</div>

Hello,

Has anybody sent window event from C++ to Clarion window?

PostMessage() does not return error, but Clarion window does not register event. Code `PostMessage((HWND)win_hndl, WM_USER, 0, 0);` is not registered in Clarion `ThisWindow.TakeEvent()` or `ThisWindow.TakeWindowEvent()`.

Interesing thing is that `PostMessage((HWND)win_hndl, WM_CLOSE, 0, 0);` is registered, and window closes.

I have found this post [Printed Icetips Article](https://www.icetips.com/printarticle.php?articleid=411&productID=0), but that does not work. And, post is 22 years old. Maybe things changed how are they processes in Clarion window? I can successfully register message in Clarion `msg_id = RegisterWindowMessageA(msg_str)` and in C++ `PostMessage((HWND)win_hndl, msg_id, 0, 0);`. But again, it is not processed inside Clarion window.

---

<div class="post-metadata">

**Author:** ![jslarve](https://clarionhub.com/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@jslarve](https://clarionhub.com/u/jslarve)\
**Post date:** [August 25, 2026, 11:52am UTC](https://clarionhub.com/t/events-from-c-to-clarion-event/9318/2 "2026-08-25T11:52:25Z")

</div>

If you search for the word “subclass” on this site, I think you will find what you need.

---

<div class="post-metadata">

**Author:** ![PaulAttryde](https://clarionhub.com/user_avatar/clarionhub.com/paulattryde/32/3519_2.png) [@PaulAttryde](https://clarionhub.com/u/PaulAttryde)\
**Post date:** [August 25, 2026, 1:12pm UTC](https://clarionhub.com/t/events-from-c-to-clarion-event/9318/3 "2026-08-25T13:12:00Z")

</div>

Windows messages and Clarion events are not the same thing. Conceptually yes, but in implementation they are different.  
Unless/until something drastically changes in the Clarion runtime no Windows message will ever show up in a Clarion ACCEPT loop.  
If you want to have a Clarion program respond to a Windows message you’re going to need to subclass the window.

This is nearly 30 years old now, but should explain some concepts for you

> **[Sub-classed procedures 101](https://www.attryde.com/clarion/col_subclass.htm)**

There are almost certainly newer articles and tools that make it easier to implement than it is with direct API calls.

---

<div class="post-metadata">

**Author:** ![blue](https://clarionhub.com/letter_avatar_proxy/v4/letter/b/3bc359/32.png) [@blue](https://clarionhub.com/u/blue)\
**Post date:** [August 25, 2026, 2:15pm UTC](https://clarionhub.com/t/events-from-c-to-clarion-event/9318/4 "2026-08-25T14:15:02Z")

</div>

@PaulAttryde thank you! Now it works.
