Board index » Visual Studio » SOME THING ABOUT MESSAGE PASSING

SOME THING ABOUT MESSAGE PASSING

Visual Studio192
Hi

i have CToolbarCtrl drived class.this tool bar has a lot of buttons,in

which one button call's a

Dialog.

I Want to send a message from my dialog class to the toolbar class when



a specific button is clickd.the problem is that when we send a message

to any control class we need its HWND.I have a problem here that how i

can got the HWND of toolbar in dialog class to send the messge.



the structure of mt program like this

this is just an example.

class mytoolbar

{

dialog is a member of this class which is called when a specific

button of toolbar is called.

|





class

{

this is the dialog class,i want to now send a message to the

mytoolbar class when a specific message of this dialog is pressed.







}





plz tell me some one about that



i m just confused.

Thanks in advance.





CrimeMaster


-
 

Re:SOME THING ABOUT MESSAGE PASSING

"CrimeMaster" <ajmal798@gmail.com>wrote in message

Quote
I have a problem here that how i

can got the HWND of toolbar in dialog class to send the messge.



GetDlgItem() exists just for that purpose.



Alternatively, you may also find SendDlgItemMessage() useful.



Regards,

Will





-

Re:SOME THING ABOUT MESSAGE PASSING

CrimeMaster wrote:



Quote
Hi

i have CToolbarCtrl drived class.this tool bar has a lot of buttons,in

which one button call's a

Dialog.

I Want to send a message from my dialog class to the toolbar class when



a specific button is clickd.the problem is that when we send a message

to any control class we need its HWND.I have a problem here that how i

can got the HWND of toolbar in dialog class to send the messge.



the structure of mt program like this

this is just an example.

class mytoolbar

{

dialog is a member of this class which is called when a specific

button of toolbar is called.

|





class

{

this is the dialog class,i want to now send a message to the

mytoolbar class when a specific message of this dialog is pressed.







}





plz tell me some one about that



i m just confused.

Thanks in advance.





CrimeMaster





When the toolbar creates the dialog it can initialize an HWND variable

in dialog.

CSomeDialog dlg();

dlg.m_hparent = m_hWnd;



--

Scott McPhillips [VC++ MVP]



-

Re:SOME THING ABOUT MESSAGE PASSING



Scott McPhillips [MVP] wrote:

Quote
CrimeMaster wrote:



>Hi

>i have CToolbarCtrl drived class.this tool bar has a lot of buttons,in

>which one button call's a

>Dialog.

>I Want to send a message from my dialog class to the toolbar class when

>

>a specific button is clickd.the problem is that when we send a message

>to any control class we need its HWND.I have a problem here that how i

>can got the HWND of toolbar in dialog class to send the messge.

>

>the structure of mt program like this

>this is just an example.

>class mytoolbar

>{

>dialog is a member of this class which is called when a specific

>button of toolbar is called.

>|

>

>

>class

>{

>this is the dialog class,i want to now send a message to the

>mytoolbar class when a specific message of this dialog is pressed.

>

>

>

>}

>

>

>plz tell me some one about that

>

>i m just confused.

>Thanks in advance.

>

>

>CrimeMaster

>



When the toolbar creates the dialog it can initialize an HWND variable

in dialog.

CSomeDialog dlg();

dlg.m_hparent = m_hWnd;



--

Scott McPhillips [VC++ MVP]





Thanks Scott

its done



-