使用的主要代码如下:
//////////////////
// Note that windows are enumerated in top-down Z-order, so the
// menu window should always be the first one found.
//
static BOOL CALLBACK MyEnumProc(HWND hwnd, LPARAM lParam)
{
char buf[16];
GetClassName(hwnd,buf,sizeof(buf));
if (strcmp(buf,"#32768")==0) { // special classname for
// menus
*((HWND*)lParam) = hwnd; // found it
return FALSE;
}
return TRUE;
}