# Win32 window messaging

**URL:** <https://clarionhub.com/t/win32-window-messaging/6831>\
**Category:** questions\
**Tags:** winapi\
**Created:** [December 6, 2023, 11:50am UTC](https://clarionhub.com/t/win32-window-messaging/6831 "2023-12-06T11:50:26Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bostjan\_Laba](https://clarionhub.com/user_avatar/clarionhub.com/bostjan_laba/32/2498_2.png) [@Bostjan\_Laba](https://clarionhub.com/u/Bostjan_Laba)\
**Post date:** [December 6, 2023, 11:50am UTC](https://clarionhub.com/t/win32-window-messaging/6831/1 "2023-12-06T11:50:27Z")

</div>

Hi guys,

I need to catch some messaging from a windows application made in c++.

So the developer of that app (he's no longer developing it) sent me this info:

> I sent a string to a hidden window class for the RDF plugin which at the  
> time maintained backwards compatibility with them I think..
> 
> If you create a window you will receive a string.. The window has to  
> present as
> 
> int hWnd = getWindowId("RDFHiddenWindowClass", "RDFHiddenWindow");  
> result = sendWindowsStringMessage(hWnd, 0, callsignsString);
> 
> you will then receive a string separated by colons as follows
> 
> windowMessaging.SendReceivingCallsigns(string.Join(":",  
> e.ReceivingCallsigns));
> 
> if there are no receivingcallsigns at the time you will get a blank string  
> as such
> 
> windowMessaging.SendReceivingCallsigns("");

So how do I create such "window" in CW and get that message I want?

Thank you all

Bostjan

---

<div class="post-metadata">

**Author:** ![Mike\_Duglas](https://clarionhub.com/user_avatar/clarionhub.com/mike_duglas/32/1061_2.png) [@Mike\_Duglas](https://clarionhub.com/u/Mike_Duglas)\
**Post date:** [December 6, 2023, 4:28pm UTC](https://clarionhub.com/t/win32-window-messaging/6831/2 "2023-12-06T16:28:07Z")

</div>

I suspect that getWindowId(“RDFHiddenWindowClass”, “RDFHiddenWindow”) finds the window with class name “RDFHiddenWindowClass” **OR** window text (title) “RDFHiddenWindow”, so you could create plain Clarion (hidden) window and inspect the messages receiving by this window.

---

<div class="post-metadata">

**Author:** ![Bostjan\_Laba](https://clarionhub.com/user_avatar/clarionhub.com/bostjan_laba/32/2498_2.png) [@Bostjan\_Laba](https://clarionhub.com/u/Bostjan_Laba)\
**Post date:** [December 6, 2023, 5:10pm UTC](https://clarionhub.com/t/win32-window-messaging/6831/3 "2023-12-06T17:10:26Z")

</div>

Ok. But how do we do “getMessages” in cw window procedure that Windows are holding a messaging queue for?

---

<div class="post-metadata">

**Author:** ![AbdullahAkilah](https://clarionhub.com/user_avatar/clarionhub.com/abdullahakilah/32/4818_2.png) [@AbdullahAkilah](https://clarionhub.com/u/AbdullahAkilah)\
**Post date:** [December 6, 2023, 5:16pm UTC](https://clarionhub.com/t/win32-window-messaging/6831/4 "2023-12-06T17:16:10Z")

</div>

Subclass it. I’ve always used SetWindowLong API call w/ GWL\_WndProc parameter but newer version of Clarion may have a property to that kind of thing now. Then you need a 2nd procedure to catch all the window messages before the CW runtime does.

---

<div class="post-metadata">

**Author:** ![Rick\_UpperPark](https://clarionhub.com/user_avatar/clarionhub.com/rick_upperpark/32/346_2.png) [@Rick\_UpperPark](https://clarionhub.com/u/Rick_UpperPark)\
**Post date:** [December 6, 2023, 5:35pm UTC](https://clarionhub.com/t/win32-window-messaging/6831/5 "2023-12-06T17:35:16Z")

</div>

Search here on ClarionHub for subclass or prop:wndproc and you’ll find some examples.

---

<div class="post-metadata">

**Author:** ![Mike\_Duglas](https://clarionhub.com/user_avatar/clarionhub.com/mike_duglas/32/1061_2.png) [@Mike\_Duglas](https://clarionhub.com/u/Mike_Duglas)\
**Post date:** [December 6, 2023, 8:39pm UTC](https://clarionhub.com/t/win32-window-messaging/6831/6 "2023-12-06T20:39:00Z")

</div>

Most of my gdiplus examples use the subclassing.

---

<div class="post-metadata">

**Author:** ![Bostjan\_Laba](https://clarionhub.com/user_avatar/clarionhub.com/bostjan_laba/32/2498_2.png) [@Bostjan\_Laba](https://clarionhub.com/u/Bostjan_Laba)\
**Post date:** [December 6, 2023, 9:13pm UTC](https://clarionhub.com/t/win32-window-messaging/6831/7 "2023-12-06T21:13:04Z")

</div>

Great! I will check it out to see if I understand the code.

---

<div class="post-metadata">

**Author:** ![Mike\_Duglas](https://clarionhub.com/user_avatar/clarionhub.com/mike_duglas/32/1061_2.png) [@Mike\_Duglas](https://clarionhub.com/u/Mike_Duglas)\
**Post date:** [December 6, 2023, 9:30pm UTC](https://clarionhub.com/t/win32-window-messaging/6831/8 "2023-12-06T21:30:55Z")

</div>

Just checked: all examples use inherited from TCWnd class. This is a “client” window (prop:ClientHandle). In your case you must use host window (prop:Handle, TWnd class) as only the host window has the title (window text).

---

<div class="post-metadata">

**Author:** ![Bostjan\_Laba](https://clarionhub.com/user_avatar/clarionhub.com/bostjan_laba/32/2498_2.png) [@Bostjan\_Laba](https://clarionhub.com/u/Bostjan_Laba)\
**Post date:** [December 7, 2023, 4:49pm UTC](https://clarionhub.com/t/win32-window-messaging/6831/9 "2023-12-07T16:49:15Z")

</div>

How do I set windowclass to a window? I think I got messaging subclass ready but I don’t know how to set window class. CW seems to set it as ClaWin01000000H\_2

In c++, this is the code:  
RegisterClass(&this-\>windowClass);

```
this->hiddenWindow = CreateWindow(
	"RDFHiddenWindowClass",
	"RDFHiddenWindow",
	NULL,
	0,
	0,
	0,
	0,
	NULL,
	NULL,
	GetModuleHandle(NULL),
	reinterpret_cast<LPVOID>(this)
);

```

Bostjan

---

<div class="post-metadata">

**Author:** ![Mike\_Duglas](https://clarionhub.com/user_avatar/clarionhub.com/mike_duglas/32/1061_2.png) [@Mike\_Duglas](https://clarionhub.com/u/Mike_Duglas)\
**Post date:** [December 7, 2023, 5:15pm UTC](https://clarionhub.com/t/win32-window-messaging/6831/10 "2023-12-07T17:15:11Z")

</div>

Reread my reply, (probably) window title 'RDFHiddenWindow" is enough.

---

<div class="post-metadata">

**Author:** ![Bostjan\_Laba](https://clarionhub.com/user_avatar/clarionhub.com/bostjan_laba/32/2498_2.png) [@Bostjan\_Laba](https://clarionhub.com/u/Bostjan_Laba)\
**Post date:** [December 7, 2023, 5:21pm UTC](https://clarionhub.com/t/win32-window-messaging/6831/11 "2023-12-07T17:21:13Z")

</div>

I did. I changed the working c++ code where I change the class only hoping it would work with Windows name but it does not ☹

And this is the definition prior to CreateWindow in c++:

WNDCLASS windowClass = {  
NULL,  
HiddenWindow,  
NULL,  
NULL,  
GetModuleHandle(NULL),  
NULL,  
NULL,  
NULL,  
NULL,  
“ADFHiddenWindowClass”  
};

---

<div class="post-metadata">

**Author:** ![Mike\_Duglas](https://clarionhub.com/user_avatar/clarionhub.com/mike_duglas/32/1061_2.png) [@Mike\_Duglas](https://clarionhub.com/u/Mike_Duglas)\
**Post date:** [December 7, 2023, 5:57pm UTC](https://clarionhub.com/t/win32-window-messaging/6831/12 "2023-12-07T17:57:13Z")

</div>

If you have an access to c++ code, then change getWindowId function to ignore window class.

---

<div class="post-metadata">

**Author:** ![Bostjan\_Laba](https://clarionhub.com/user_avatar/clarionhub.com/bostjan_laba/32/2498_2.png) [@Bostjan\_Laba](https://clarionhub.com/u/Bostjan_Laba)\
**Post date:** [December 7, 2023, 8:10pm UTC](https://clarionhub.com/t/win32-window-messaging/6831/13 "2023-12-07T20:10:36Z")

</div>

I have access to a cpp plugin dll code which is a target for something else, so i can use it for testing

I don’t have any code from the app that send messages unfortunately.

---

<div class="post-metadata">

**Author:** ![Mike\_Duglas](https://clarionhub.com/user_avatar/clarionhub.com/mike_duglas/32/1061_2.png) [@Mike\_Duglas](https://clarionhub.com/u/Mike_Duglas)\
**Post date:** [December 7, 2023, 8:38pm UTC](https://clarionhub.com/t/win32-window-messaging/6831/14 "2023-12-07T20:38:53Z")

</div>

Ah I see, then you can play with CreateWindow api.

---

<div class="post-metadata">

**Author:** ![Bostjan\_Laba](https://clarionhub.com/user_avatar/clarionhub.com/bostjan_laba/32/2498_2.png) [@Bostjan\_Laba](https://clarionhub.com/u/Bostjan_Laba)\
**Post date:** [December 7, 2023, 9:31pm UTC](https://clarionhub.com/t/win32-window-messaging/6831/15 "2023-12-07T21:31:42Z")

</div>

Haha, for you this is something to play with, for me it’s hard work with no certain results 🙂

---

<div class="post-metadata">

**Author:** ![Mike\_Duglas](https://clarionhub.com/user_avatar/clarionhub.com/mike_duglas/32/1061_2.png) [@Mike\_Duglas](https://clarionhub.com/u/Mike_Duglas)\
**Post date:** [December 7, 2023, 10:02pm UTC](https://clarionhub.com/t/win32-window-messaging/6831/16 "2023-12-07T22:02:10Z")

</div>

Yup, hard work must be done by someone else 🙂

---

<div class="post-metadata">

**Author:** ![Bostjan\_Laba](https://clarionhub.com/user_avatar/clarionhub.com/bostjan_laba/32/2498_2.png) [@Bostjan\_Laba](https://clarionhub.com/u/Bostjan_Laba)\
**Post date:** [December 8, 2023, 7:56am UTC](https://clarionhub.com/t/win32-window-messaging/6831/17 "2023-12-08T07:56:40Z")

</div>

That’s where the money comes in and levels it out 😁😅
