What's new

message handler macro for OnVisible method

mesman00

What's that...?
does anyone know what macro i need to add to the message map in order to use the OnVisible() method in the CHtmlView class. what i want to do is allow the user be able to show or not show the web browser (chtml view object). this is how i am currently doing it. i call the OnVisible method and pass a boolean value (i overloaded OnVisible() in the CHtmlView class). Then the OnVisible method calls the SetVisible method of the chtmlview object and passes the boolean value passed to the OnVisible method. Am i doing this correctly? shouldn't there be a macro in the message map since the method OnVisible is an event? if anyone can clear up how to properly do this i would greatly appreciate it.
 

smcd

Active member
I don't use MFC (mainly for reasons such as this problem, and the others you have with it) or I'd answer you to keep the bumpity down :p
 
OP
mesman00

mesman00

What's that...?
here's the solution to anyone who might be interested in the future. took me alot of reading in msdn to figure this out.

CWnd *pBrowser;
pBrowser = GetDlgItem(IDC_WEB_BROWSER);
pBrowser->ShowWindow(TRUE);

i think this can probably be used for most MFC crontrols (static controls, buttons, etc). The GetDlgItem() method recieves the resource id of the control whose view you want to toggle, and the ShowWindow() method recieves either TRUE or FALSE, TRUE if you want to show the control, FALSE if you want to hide the control.
 

smcd

Active member
Ah, I don't think I initially understood exactly what you wanted to do. Glad to see you got it working & shared for anyone who might use it in the future. :)
 

Top