Advertisement
4_2005-2006 Windows API Call/ Explanation #167459

API Menu Example v2

Like the first version, this shows how to access another application's menu and copy it in your own app using API...allowing you to actually call the menu functions in the other application from your menu. The example creates a list of current windows (only windows with compatible menus). Then when selected, the menu is 'cloned' using API calls GetMenuItemInfo() and InsertMenuItem() allowing you to not only to copy the menuitem but the state of the menuitem.(Checked, Grayed, etc...) And unlike the first version which only loaded 1 level of submenus, this will load all levels. This example could also prove to be useful to anyone wanting to know more about creating dynamic menus and submenus in VB as well as how to handle messages from them when clicked (uses subclassing). Unlike many 'dynamic menu' examples, this does not require any 'dummy' menus or menu arrays to be created. Demonstrates API Calls: IsWindow, SetWindowLong, EnumWindows, GetMenuItemCount, GetSubMenu, GetMenu, SetMenu, DestroyMenu, CreateMenu, CreatePopupMenu, DrawMenuBar, CallWindowProc, PostMessage, GetWindowTextLength, GetWindowText, IsMenu, GetMenuItemInfo, & InsertMenuItem.

AI

Resumo por IA: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Código fonte
original-source
Upload
Comentários originais (3)
Recuperado do Wayback Machine