I have hooked my window and I am trying to know when a menu window is created as a new window is created. The class for the menu window is #32770 (I think) so I am using the following chunk of code to check when a menu window is created:
PHP Code:
LRESULT CALLBACK CallWndProc(int nCodeWPARAM wParamLPARAM lParam)
{
    
CWPSTRUCT *cw;
    
string classname;
    switch (
nCode)
    {
    case 
HC_ACTION:
        
cw = (CWPSTRUCT*)lParam;
        
GetTheClassName(cw->hwndclassname);
    
//    MessageBox(cw->hwnd,classname.c_str(),"",MB_OK);
        
if(strcmp(classname.c_str(),"#32770") == 0)
        {
        
MessageBox("A menu window was created","",MB_OK);
            
//A menu window was created
        
}
        return 
CallNextHookEx(myhook,nCode,wParam,lParam);
    }
    
    return 
CallNextHookEx(myhook,nCode,wParam,lParam);
}

void GetTheClassName(HWND hWndstring &classdest)
{
    
char classname[128];
    
GetClassName(hWnd,classname128);
    
classdest classname;

Now if I uncomment the line MessageBox(cw
>hwnd,classname.c_str(),"",MB_OK);
before I use the if statement, some of the class names ARE "#32770" so it should actually return 0 from strcmpy but it's NOT. It never shows the message box inside the if statement which says "A menu window was created".