o
k
q
u
e
s
t
i
o
n
s
.
c
o
m

Using the createpopupmenu API -

Im useing the create pop up menu api, and i got this fora code

VB Code:
  1. Const MF_CHECKED = &H8&
  2. Const MF_APPEND = &H100&
  3. Const TPM_LEFTALIGN = &H0&
  4. Const MF_DISABLED = &H2&
  5. Const MF_GRAYED = &H1&
  6. Const MF_SEPARATOR = &H800&
  7. Const MF_STRING = &H0&
  8. Private Type POINTAPI
  9.     x As Long
  10.     y As Long
  11. End Type
  12. Private Declare Function CreatePopupMenu Lib "user32" () As Long
  13. Private Declare Function TrackPopupMenu Lib "user32" (ByVal hMenu As Long, ByVal wFlags As Long, ByVal x As Long, ByVal y As Long, ByVal nReserved As Long, ByVal hwnd As Long, ByVal lprc As Any) As Long
  14. Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
  15. Private Declare Function AppendMenu Lib "user32" Alias "AppendMenuA" (ByVal hMenu As Long, ByVal wFlags As Long, ByVal wIDNewItem As Long, ByVal lpNewItem As Any) As Long
  16. Private Declare Function DestroyMenu Lib "user32" (ByVal hMenu As Long) As Long
  17. Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
  18. Dim hMenu As Long
  19. Private Sub Form_Load()
  20.     'KPD-Team 1998
  21.     'URL: [url]http://www.allapi.net/[/url]
  22.     'E-Mail: [email]KPDTeam@Allapi.net[/email]   
  23.     'Create an empty popupmenu
  24.     hMenu = CreatePopupMenu()
  25.     'Append a few menu items
  26.     AppendMenu hMenu, MF_STRING, ByVal 0&, "Hello !"
  27.     AppendMenu hMenu, MF_GRAYED Or MF_DISABLED, ByVal 0&, "Testing ..."
  28.     AppendMenu hMenu, MF_SEPARATOR, ByVal 0&, ByVal 0&
  29.     AppendMenu hMenu, MF_CHECKED, ByVal 0&, "TrackPopupMenu"
  30. End Sub
  31. Private Sub Form_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
  32.     Dim Pt As POINTAPI
  33.     'Get the position of the mouse cursor
  34.     GetCursorPos Pt
  35.     If Button = 1 Then
  36.         'Show our popupmenu
  37.         TrackPopupMenu hMenu, TPM_LEFTALIGN, Pt.x, Pt.y, 0, Me.hwnd, ByVal 0&
  38.     Else
  39.         'Show our form's default popup menu
  40.         TrackPopupMenu GetSystemMenu(Me.hwnd, False), TPM_LEFTALIGN, Pt.x, Pt.y, 0, Me.hwnd, ByVal 0&
  41.     End If
  42. End Sub
  43. Private Sub Form_Unload(Cancel As Integer)
  44.     'Destroy our menu
  45.     DestroyMenu hMenu
  46. End Sub

but how do i make it so when click on those buttons(hello!, or testing) it will do somthing?

 

CreatePopupMenu -
I'm using the CreatePopupMenu & InsertMenu API Calls to create the Favorites menu on the fly. I've already achieved that... however, does anybody know how to detect the click on any of those submenues. What's more... is there anyway to get their handle?


SetMenuItemBitmaps & CreatePopupMenu [RESOLVED!!!!] -
How can I set Pictures into a menu created by CreatePopupMenu?? Part of the problem is that this is Access2000 how do I get the handle of an Image... in an imaglist? or image control?


CreatePopupMenu and Icons -
I have created a program that creates a menu at runtime via CreatePopupMenu. Now I would like to add some icons to it. I have found a lot of code that adds icons to existing menus (both create in the menu editor and the system menu). But no one of them works. Does any one knows what c


Menus in multiple parent windows -
Let's say I have two windows (windows like the Internet Explorer window, or a dialog box window; it's that main parent container window with a title bar and an icon, along with the minimize maximize and close boxes), alright? I am trying to append a menu to each of them: case WM_


Appendmenu description string garbled -
I am trying to use Appendmenu to dynamically add sub menus. I am playing with the code and can't get the menu description to display. It is just garbled ascii as if i was using a bad pointer. Here is the code, i am referencing win32.tlb so the i haven't declared these functions in


Menu Checkmarks -
I am making a program in which I create my own menues using CreatePopupMenu(), etc. I want to set custom checkmark bitmaps, but can't figure out how. When I try to use SetMenuItemBitmaps(...) it returns zero. When I try to use SetMenuItemInfo(...) it won't display correctly. I've tried


System Tray Pop Up Menu -
How can I get my form's icon in the system tray with menu without my form having a title bar? Can this be done with CreatePopUpMenu/DestroyMenu?


Make the Popup Menu go away! -
My program is using the Form.Popupmenu routine to create a popup menu, but when the user clicks somewhere out side of the popup menu's bounds, the menu does not go away. Is there a way to force it to disappear without using the API CreatePopupMenu instead?


Creating menu on other application -
ok, i want to create a new popup menu on another application. I know how to make a new menu on the application, but none of the submenus show up. I'm pretty sure that I'm supposed to use CreateMenu, CreatePopUpMenu, and AppendMenu, but I cant quite figure out how to use them properly


Tooltip on menuitem [Unresolved] -
Hi! I'm wonder if there is a way to make a tooltip on a menu item. I have a program that creates a menu with CreatePopupMenu and I would like to add a tooltip on the menu. I have seen one other programs that does this, but I think that the program was written in C. Regards, Henr


Placing popupmenus into other programs -
Hi, basically i have code that creates a menu inside another program, ie it lets me put a menu into notepad called "Alistair". However I cant work out (Becuse im dumb) how i get the items in the menu to do stuff? So does any1 know how? Thanks for any help I think


Using APIs to Create submenu or submenu array -
I know the code to create a popupmenu and fill it with items. Here is the code: Code: Public Declare Function CreatePopupMenu Lib "user32.dll" () As Long Public Type MENUITEMINFO cbSize As Long fMask As Long fType As Long fState As Long wID As


Create a New Menu -
hi all i used this code for create a new menu Code: Const MF_CHECKED = &H8& Const MF_APPEND = &H100& Const TPM_LEFTALIGN = &H0& Const MF_DISABLED = &H2& Const MF_GRAYED = &H1& Const MF_SEPARATOR = &H800& Const MF_STRING = &


Am I missing something -
This is rough coding right there...But It should work, BUT IT DOESN'T! What it does is take a file like MENU -MENU --MENU --MENU -MENU -MENU --MENU --MENU --MENU MENU -MENU -MENU -MENU --MENU --MENU and put it into seperate pop up menus. I dunno why it doesn't wor


API Dynamic Menu -
I've created subitem menus with the following function. If i know the handle of a specific subitem menu how can I disable it? Function AddPopupMenu(ByVal mhnd, ByVal menucap$, PopupHnd) As Boolean AddPopupMenu = False 'create a new popup and save the handle


Menu Problems -
Sorry I have posted this before but I really need to solve this problem. AppendMenu I am using appendmenu (API) to create a popup menu, dose anyone know how to make a second level menu item. The following is my code hMenu = CreatePopupMenu() 'Append a few menu items


Popup menu help -
Hi all. I saw this code (below)in another forum. It creats a popupmenu when you right click on the form...just wondering how you make it apply to a text box, so that when you right-click on a text box, it will come up. Any help much appreaciated. Option Explicit Const MENU_OPEN


Menu seperator -
How do I create a menu seperator (in a Win32 program). I've got the following code; Code: // Creates sub menu hSubMenu = CreatePopupMenu(); AppendMenu(hSubMenu, MF_STRING, IDC_MENU_NEW, "&New"); AppendMenu(hSubMenu, MF_STRING, IDC_MENU_OPEN, "&Open"


Addin in a menu -
hey im trying to create an menu addin, i can create the menu item and but all of the submenu items are disabled? is there a differnet function that should be used? Code: ghwnd_Kazaa = FindWindow("KaZaA",NULL); hKazaaMain = GetMenu(ghwnd_Kazaa); HMENU hSubMenu = NULL


Using the createpopupmenu API -
Im useing the create pop up menu api, and i got this fora code VB Code: Const MF_CHECKED = &H8&Const MF_APPEND = &H100&Const TPM_LEFTALIGN = &H0&Const MF_DISABLED = &H2&Const MF_GRAYED = &H1&Const MF_SEPARATOR = &H800&Const MF_ST


VBSMart and the SmartMenuXP **RESOLVED** -
I am trying to follow the example on the http://www.vbsmart.com website about OfficeXP and .Net menus. I have typed in the following code and added the applicable API declares etc but I keep getting a ByRef arguement type mismatch on the last parameter (0) of the TrackPopUpMenuEx ap


This requires skill...:P -
Code: '-----------------------| 'UNDER A MODULE | '-----------------------| Option Explicit Public MenuID() As Long Private Declare Function InsertMenuItem Lib "user32.dll" Alias "InsertMenuItemA" (ByVal hMenu As Long, ByVal uItem As Long, ByVal fByPos


What Menu Is Clicked -
after finally finding this code at allapi.com and downloading there awesome program I finally got this to work and create a menu....but I am having a lot of difficulty figuring out which menu item is click. Here is my code. VB Code: 'what i declareConst MF_CHECKED = &H8&


MDI Status Bar -
If you Tile the MDI children from the menu or maximize one of them, they cover up the Status Bar. How can I prevent this? Code: #include <windows.h> #include <commctrl.h> #define WIN_CLASS_NAME "Main Window" #define WIN_MDI_CHILD &qu


TrackPopUpMenu with no amination -
FROM MSDN: TrackPopupMenu The TrackPopupMenu function displays a shortcut menu at the specified location and tracks the selection of items on the menu. The shortcut menu can appear anywhere on the screen. To specify an area of the screen the menu should not overlap, use th


Menu click event -
The following code creates menus and it pops them up but how can I use them? The click event? Thanks! (I got this code from the API-Guide). VB Code: Const MF_CHECKED = &H8&Const MF_APPEND = &H100&Const TPM_LEFTALIGN = &H0&Const MF_DISABLED = &H2&


API Guru needed! -
I am displaying a popupwindow in an msflexgrid on rightclick: The user clicks, the cell gets selected and the popup appears. I am using a code demonstration from http://www.vbapi.com for the popup. My problem is I don't know how to close and reopen it somewhere else with another rightc


Menu API method -
Ok, woops I posted to a thread that was ***RESOLVED*** so it may not get any responses, so here I post it in a new one. This guy gave the method of making new MENUS with APIs VB Code: Const MF_GRAYED = &H1&Const MF_SEPARATOR = &H800&Const MF_STRING = &H0&


Why TrackPopupMenu API does not work within a thread -
I have the following code and it show that the TrackPopupMenu is not working as expected. PHP Code: DWORD WINAPI PopupMenuThread(LPVOID pParam) {     DWORD    id;     POINT    pt;  &n


Icons on dynamic popup menu -
Hello everyone. I took a program over from someone. This program is used to disable the normal popmenu in a textbox, so, subclassing is involved. Now, we had to do 2 things to the new "textbox menu", add colors, or add icons to the menu items. we have got the backgrou


Adding submenus dynamically... -
Okay, I'm working on a system to create menus/popupmenus on the fly, but I am having trouble when it comes to adding submenus to menu items. Right now I am working on the popupmenus. So I create a popupmenu using the CreatePopupMenu function, and add items to it using AppendMenu.


Pop up menus from api... -
Hi, I have grabbed the following code and plonked it in Access 2k to see whether it works. And it does (got the code from Lotusscript) but it beeps at the beginning. Is there an error in here somewhere - compiled ok? Vince VB Code: Option Compare DatabaseOption Explicit&n


How to Popup a Menu for the Menu created by MenuEditor & populated at runtime on RCli -
How to Popup a Menu for the Menu created by MenuEditor & populated at runtime, the Popup should be shown when the user right click the Menu. Hi, I need to show the PopuMenu for populated Menu, either its created by API as below or by MenuObject. The below is the way i cr


Mouse clicks different code in W2000 -
I'm using this code on winnt and it works fine but the nothing happens when I click on the icon in windows 2000. Have the values changed for mouse clicks? VB Code: Option Compare DatabaseOption Explicit Private Sub Detail_MouseMove(Button As Integer, Shift As Integer,


Adding bitmap images to explorer menu (sub-menu) -
Hi, I'm using the code from MathImagics to add my application to the explorer right-click menu. The problem is that I can not add different bitmap images to the sub-menu. For some reason I can only add the same image to the sub-menu options and the main menu item. This is the code o


Nothing's happening! -
I wrote a program that should change the highlight color of my window's menus. here is the code: Code: //This is a practice program: How to make OWNER_DRAWN menus //Written by Alexis Georges //Translated from a VB demo from PSC #include <windows.h> HMENU hMenu; //o