Была. Вот она:
X++:
#winapi
#define.MF_BYPOSITION(0x400)
static client void DeleteUserMenu()
{
int wnd;
int hMenu;
int cnt, i;
str name;
dll _dll = new dll("USER32");
DllFunction GetMenu = new DllFunction(_dll, "GetMenu");
str getMenuItemString(HWND popupHandle, int id)
{
DLLFunction _getMenuString = new DLLFunction(_DLL, "GetMenuStringA");
Binary b = new Binary(81);
_getMenuString.returns(ExtTypes::DWord);
_getMenuString.arg(ExtTypes::DWord);
_getMenuString.arg(ExtTypes::DWord);
_getMenuString.arg(ExtTypes::Pointer);
_getMenuString.arg(ExtTypes::DWord);
_getMenuString.arg(ExtTypes::DWord);
if (_getMenuString.call(popupHandle, id, b, 80, #MF_BYPOSITION))
return b.string(0);
return '';
}
int DeleteMenu(HWND popupHandle, int id)
{
DLLFunction _DeleteMenu = new DLLFunction(_DLL, "DeleteMenu");
_DeleteMenu.returns(ExtTypes::DWord);
_DeleteMenu.arg(ExtTypes::DWord);
_DeleteMenu.arg(ExtTypes::DWord);
_DeleteMenu.arg(ExtTypes::DWord);
return _DeleteMenu.call(popupHandle, id, #MF_BYPOSITION);
}
;
wnd = infolog.hWnd();
if (wnd)
{
GetMenu.returns(ExtTypes::DWord);
GetMenu.arg(ExtTypes::DWord);
hMenu = GetMenu.call(wnd);
if (hMenu) hmenu = winapi::getSubMenu(hMenu, 0);
if (hMenu)
{
cnt = winapi::getMenuItemCount(hMenu);
for (i=0;i<cnt;i++)
{
name = getMenuItemString(hMenu, i);
if (name == "&Открыть")
{
hmenu = winapi::getSubMenu(hMenu, i);
if (hMenu)
{
cnt = winapi::getMenuItemCount(hMenu);
for (i=0;i<cnt;i++)
{
name = getMenuItemString(hMenu, i);
if (name == "Мен&ю")
{
DeleteMenu(hMenu, i);
return;
}
}
}
}
}
}
}
}
Саму тему с эти проектом искать нет времени.