WM_USER message WinXP 
Author Message
 WM_USER message WinXP

I've got a thread capturing sound in my CSound class and upon filling the
buffer it sends a message to my Dialog Class.

I'm performing a HWND_BROADCAST just to get it to function at the minute,
because I don't know exactly how to get a thread in one class to talk to (or
get the hWnd) of the Dialog class? (without transmitting to all windows and
possibly affecting other programs!)

All thoughts welcome.

Martin Brindle



Mon, 25 Apr 2005 21:15:03 GMT  
 WM_USER message WinXP
I realise the subject is a bit misleading, while I was typing my question, I
suddenly thought of a solution to the problem and I put down another issue I
was faced with!

Martin

Quote:
> I've got a thread capturing sound in my CSound class and upon filling the
> buffer it sends a message to my Dialog Class.

> I'm performing a HWND_BROADCAST just to get it to function at the minute,
> because I don't know exactly how to get a thread in one class to talk to
(or
> get the hWnd) of the Dialog class? (without transmitting to all windows
and
> possibly affecting other programs!)

> All thoughts welcome.

> Martin Brindle



Mon, 25 Apr 2005 21:36:40 GMT  
 WM_USER message WinXP
If this is a MFC dialog based app, then your dialog window is your main
window and you can get its HWND from anywhere using AfxGetMainWnd()->m_hWnd

Regards,
Nish [Visual C++ MVP]


Quote:
> I've got a thread capturing sound in my CSound class and upon filling the
> buffer it sends a message to my Dialog Class.

> I'm performing a HWND_BROADCAST just to get it to function at the minute,
> because I don't know exactly how to get a thread in one class to talk to
(or
> get the hWnd) of the Dialog class? (without transmitting to all windows
and
> possibly affecting other programs!)

> All thoughts welcome.

> Martin Brindle



Tue, 26 Apr 2005 01:21:03 GMT  
 WM_USER message WinXP
HWND_BROADCAST is almost always a Bad Idea. WM_USER is an obsolete concept and you should
use WM_APP, but you should NEVER, EVER use a WM_USER or WM_APP based message for a
broadcast, you should use a Registered Window Message.

Read my essay on worker threads on my MVP Tips site. It shows how to post messages from a
thread to a window.
                                        joe

Quote:

>I've got a thread capturing sound in my CSound class and upon filling the
>buffer it sends a message to my Dialog Class.

>I'm performing a HWND_BROADCAST just to get it to function at the minute,
>because I don't know exactly how to get a thread in one class to talk to (or
>get the hWnd) of the Dialog class? (without transmitting to all windows and
>possibly affecting other programs!)

>All thoughts welcome.

>Martin Brindle

Joseph M. Newcomer [MVP]

Web: http://www3.pgh.net/~newcomer
MVP Tips: http://www3.pgh.net/~newcomer/mvp_tips.htm


Tue, 26 Apr 2005 07:20:43 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. handling user-defined messages (WM_USER) with message maps

2. Spurious WM_USER message received on dialog start

3. WM_USER messages lost when working with menus

4. missing WM_USER messages to CWinThread threads :-(

5. How to link a method to Message WM_USER* and WM_WINDOWPOSCHANGED

6. Application exits after Pressing Enter (WM_USER+31743 message?)

7. WM_USER

8. Guru's: WM_USER/Worker Thread

9. WM_USER

10. WM_USER and Class wizard, beginners question

11. Handle WM_USER notify

12. WM_USER vs WM_APP

 

 
Powered by phpBB® Forum Software