VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



MenuAPI Example v1

by Danny Krotzer (2 Submissions)
Category: Windows API Call/Explanation
Compatability: Visual Basic 5.0
Difficulty: Advanced
Date Added: Wed 3rd February 2021
Rating: (5 Votes)

This shows how to access another process' menu and clone it in your own application using API. The example allows you to choose an app from a list of open windows, then once the menu is 'cloned', it will allow you to execute menu items in the other process by clicking on them in your own app. This also demonstrates how to create & remove dynamic menus and submenus on your form, as well as handle messages from them when clicked (uses subclassing). API Calls: IsWindow(), SetWindowLong(), EnumWindows(), GetMenuString(), GetMenuItemID(), GetMenuItemCount(), GetMenu(), GetSubMenu(), AppendMenu(), DeleteMenu(), CreatePopupMenu(), DrawMenuBar(), CallWindowProc(), PostMessage(), GetWindowTextLength(), GetWindowText(), & IsWindowVisible()

Side Effects
As with any subclassing and cross-process calls, debugging can be tricky and cause VB Environment to crash so save project often if you make any changes.

Rate MenuAPI Example v1

Download MenuAPI Example v1

Download MenuAPI Example v1 (6 KB)

MenuAPI Example v1 Comments

No comments have been posted about MenuAPI Example v1. Why not be the first to post a comment about MenuAPI Example v1.

Post your comment

Subject:
Message:
0/1000 characters