1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
HWND hAppli;
HMENU hMenu1;
HMENU hMenu2;
char* lpClassName = "ClassName";
char* lpWindowName = "WindowName";
if( (hAppli = FindWindow(lpClassName,lpWindowName)) != NULL ) {
if( (hMenu2 = CreatePopupMenu()) != NULL) {
InsertMenu(hMenu2, -1, MF_BYPOSITION|MF_STRING, 777, "Test - Sous-menu !!");
InsertMenu(hMenu2, -1, MF_SEPARATOR, 0, "");
InsertMenu(hMenu2, -1, MF_BYPOSITION|MF_STRING, 778, "Test - Sous-menu 2 !!");
if( (hMenu1 = GetMenu(hAppli)) != NULL) {
InsertMenu(hMenu1, -1, MF_BYPOSITION|MF_POPUP, (unsigned int)hMenu2, "Test !");
}
}
} |
Partager