I am creating a dialogbox(modal) from inside my parent dialog. On this dialog, there is a Finish button whose id = IDC_BUTTON6. When I click this button I would like to call my parent dialog's apply(); method.
However I don't know how to refer to IDC_BUTTON6 of Popup.cpp from inside the Parent.class.
Should I write something like;
if (nResponse == IDC_BUTTON6) which is erroneous,
if (nResponse == Popup.IDC_BUTTON6) which is also erroneous.
I additionally do attach a Toolbar programmatically to the hooked MDIChild window, all works fine, meaning that 1)the toolbar is created and attached, 2) the messages are rerouted to my WindowProc.
There is one problem , though:
I am not able to intercept the WM_COMMAND message sent, whenever I click on one of the toolbar buttons, this message is sent directly to the child and not rerouted. I also DO NOT want to induce a redirection of the message from within the MDI child window, that would be pointless in my case.
QUESTION : How can I intercept the WM_COMMAND messages issued upon clicking the toolbar buttons such, that they will be redirected automatically to my WindowProc procedure.
Thanks , but I should have explained better. What I needed to achieve was a way to cause my DLL to plug into an existing application by some other programmer, without having to involve the the other programmer .This way , he wouldn't have to change a bit. There would be only his application with a few MDI child windows created by him, while I hook up to those MDI child windows, I induce the creation of different toolbars for the respective MDI child and intercept all the messages to those windows, thus taking over the MDI children. I achieved it, everything works fine now. As I explained in the former posting, I do receive the rerouted messages. The WM_COMMAND message cannot be intercepted by me, it is intercepted in the MDI child, but I found a way around it. Whenever I create the toolbar, I keep record of the amount of buttons and record the rectangles within the toolbar, where they are located. Now, I need just to catch the WM_LBUTTONDOWN and ..BUTTONUP messages, thus enabling me to detect which button was pressed and take action... Works great !
kedar.dave wrote: how can i get an ICON from a window and pass it to the
if you want to get the Icon from some other window and use that in your window program you can use ExtractIcon api
here is small code listing for that
<font color=#008000>//Assume m_strFileName point to valid Program file//Now use the Extract Icon api to Extract the Icon
//First Parameter =NULL( indicateuse the curent instance)
//Second Parameter = Name of file from which you want to extract icon
//Third Parameter : Index of icon ,here i am extracting the
// first icon from the exefile
<font color=#008000>//here m_statIcon is static ctrl of type ICON </font>
Basicly in your propertysheet's OnSize handler you have to resize the tab control to match the sheet and then resize the active page to match the tab control. Then use your propertypage's OnSize handler to resize the controls on the page.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04