What is pop up menu in windows

Pop-up Windows

Applies To: Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012

Many tasks in Enterprise Portal are performed in modal windows that are opened from list pages. The URL Web Menu Item used to open the page indicates whether the page is displayed in a modal window. This is the preferred way to use modal windows in Enterprise Portal for Microsoft Dynamics AX 2012.

In Microsoft Dynamics AX 2009, if you wanted to display information or have the user perform a task in a separate window, you had to use a pop-up window. A pop-up window is another web browser window that appears on top of the main Enterprise Portal window. Pop-up windows like this can still be used in Microsoft Dynamics AX 2012.

Parent Window

The parent window is the page in Enterprise Portal from which the pop-up window is opened. The parent window must contain a User Control that has the AxPopupParentControl component. Properties for this component allow for you to specify characteristics of the pop-up window. For example, the PopupHeight and PopupWidth properties control the size of the pop-up window.

Child Window

The child window is another page in Enterprise Portal that will be displayed in the pop-up window. It must have a URL Web Menu Item defined that points to the page. For details about how to create a web menu item, see How to: Create Web Menu Items.

The page used for the child window will typically contain a User Control that has the AxPopupChildControl component. This component is used when closing the pop-up window. It is also used when passing values from the pop-up window back to the parent window.

Opening the Pop-up Window

To open the pop-up window, use the OpenPopup method provided by the AxPopupParentControl. This method is typically called from the code for a User Control on the parent page. The OpenPopup method has one parameter, which specifies the web menu item of the page to be opened and displayed in the pop-up window.

The following example is the code for a button that was added to a User Control. The User Control contains the AxPopupParentControl component. An AxUrlMenuItem object is created that specifies the page to open in the pop-up window.

Closing the Pop-up Window

The user can close a pop-up window by clicking the close box. The pop-up window can also be closed through code for a User Control in the pop-up window. The AxPopupChildControl provides the ClosePopup method. This method requires two boolean parameters. The first specifies whether field values must be passed from the pop-up window back to the parent. The second parameter specifies whether the parent page has to post back after the pop-up window closes.

If the second parameter of the ClosePopup method is set to true, the PopupClosed event for the AxPopupParentControl will be run when the pop-up window closes. You can use the method handler for this event to retrieve values that are passed back to the parent from the pop-up window.

Passing Values Back to the Parent Window

It is often useful to pass values from the pop-up window back to the parent window. The AxPopupParentControl and AxPopupChildControl provide a collection of AxPopupField objects for this purpose. This collection is accessed through the Fields property for the component. This property provides access to the AxPopupField Collection Editor.

You will use the AxPopupField Collection Editor to create the collection of field values to pass from the child window back to the parent window. Each AxPopupField object in the collection has a Name property. It also has an optional Target property which maps the field to a control on the page. The names of the AxPopupField objects in the collection must be the same for both the AxPopupChildControl and the AxPopupParentControl. For instance, assume the AxPopupParentControl had the following set of AxPopupField objects defined:

Читайте также:  Как обновить не подлинный windows

The AxPopupChildControl must have AxPopupField objects that have the same names defined for its Fields collection. The names enable the fields to be matched as they are passed from the child back to the parent.

The values of the AxPopupField objects can be set or retrieved automatically. They can also be set or retrieved manually through code for the User Control.

Automatically Setting and Retrieving Values

If you have set the Target property for an AxPopupField object for the AxPopupChildControl, it is mapped to a field for the User Control. In the pop-up window, Enterprise Portal will automatically set the AxPopupField object value to the value that is contained in the field specified by the Target property. If you have set the Target property for the AxPopupField object for the AxPopupParentControl, the value passed back for this field from the pop-up window will automatically be retrieved and put in the mapped field.

The field specified by the Target property must be within the same naming container as the User Control, or any parent container in the hierarchy. The field must also have the Value client-side property.

Manually Setting and Retrieving Values

If you have not set the Target property for the AxPopupField objects, you can set their value manually through code in the pop-up window. Use the SetFieldValue method to do this. You can also use code in the parent window to retrieve the value of each AxPopupField object. Use the GetFieldValue method to do this.

You cannot set or retrieve an AxPopupField object value through code if you have used the Target property to map it to a field.

For example, the following is code for a button that is contained in the User Control displayed in a pop-up window. When the button is clicked, the two AxPopupField objects defined in the Fields collection have their values set. Then the pop-up window is closed.

Code for the PopupClosed event on the parent window is typically used to retrieve the values passed back from the pop-up window. The following example shows the code that retrieves the values returned by the previous example.

Pop-up Menu Support

[Microsoft Agent is deprecated as of Windows 7, and may be unavailable in subsequent versions of Windows.]

Microsoft Agent includes a pop-up menu (also known as a contextual menu) for each character. The server displays this pop-up menu automatically when a user right-clicks the character. You can add commands for your client application to the menu by defining a Commands collection. For each command in the collection that you define, you can specify Caption and Visible properties. The Caption is the text that appears in the menu when the Visible property is set to True. You can also use the Enabled property to display the command in the menu as disabled and the HelpContextID to support Help support for the property. Define the access key for the menu text by including an ampersand (&) before the text character of the Caption text setting.

The server automatically adds to the menu commands for opening the Voice Commands Window and hiding the character as well as the Commands captions of other clients of the character to enable users to switch between clients. The server automatically adds a separator to the menu between its menu entries and those defined by the client. Separators appear only when there are items in the menu to separate.

To remove commands from a menu, use the Remove method. Note that menu entries do not change while the menu displays. If you add or remove commands or change their properties, the menu displays the changes when the user redisplays the menu.

Читайте также:  Windows 10 lock screen images collection

If you prefer to provide your own pop-up menu services for a character, you can use the AutoPopupMenu property to turn off server handling of the right-click action. You can then use the Click event notification to create your own menu handling behavior.

When the user selects a command from a character’s pop-up menu or the Voice Commands Window, the server triggers the Command event of the associated client and passes back the parameters of the input using the UserInput object.

The server also provides a pop-up menu for the character’s taskbar icon. When the character is visible, right-clicking this menu displays the same commands as those displayed by right-clicking the character. However, when the character is hidden, only the server-supplied commands are included.

Start Menu keeps popping up or opens randomly in Windows 10

If Windows 10 Start Menu or Search box keeps popping up randomly or opening automatically on its own, here are a few troubleshooting steps you may want to take a look at. This is a weird problem some people are reporting to be facing and there really do not seem to be any answers. Nevertheless, there are a few things you could check on and see if they help resolve your issue.

Start Menu keeps popping up or opens randomly

You may try these suggestions in any order you wish.

1] Physically check WinKey

Physically check your WinKey on your keyboard and ensure that there are no particles lodged there and it is functioning properly.

2] Update Touchpad device drivers

Update your Synaptics/Touchpad device drivers and see. If you updated them recently, then rollback the driver and see.

3] Check TouchPad settings

Open your TouchPad settings. You will be able to access it via Control panel > Mouse properties & settings. Configure your Touchpad settings like Pressure, etc properly. Did that help? No? Then disable 2-finger & 3-finger scrolling and see.

Does unchecking Right Edge Swipe help? If not, you can, set all settings to Default and see. If even this does not help, disable TouchPad and see.

I have displayed Dell Touchpad settings, but you will have to search for similar settings on your device.

4] Run SFC

If you have any third-party Start Menu replacement installed, uninstall it, run System File Checker and see if it helps.

5] Hide Search or Cortana icon

Hide Search or Cortana icon in Taskbar and check. Right-click on the taskbar, select Cortana and choose Hidden.

6] Disable 3-finger tap

If you have 3-finger tap to launch Cortana enabled, disable it and check if that helps you.

7] Use Start Menu Troubleshooter

8] Troubleshoot in Clean Boot State

Perform a Clean Boot and see if this problem persists. If it does not, then you will have to identify the offending software which is interfering, by trial and error method.

9] Disable Taskbar tidbits

Click on the Taskbar Cortana button, open Cortana settings and toggle the Taskbar tidbits switch to the Off position.

10] Disable Cortana

Completely disable Cortana and see if that helps.

Let us know if any of these suggestions helped you or if you have any other ideas.

TrackPopupMenu function (winuser.h)

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.

Syntax

Parameters

A handle to the shortcut menu to be displayed. The handle can be obtained by calling CreatePopupMenu to create a new shortcut menu, or by calling GetSubMenu to retrieve a handle to a submenu associated with an existing menu item.

Use zero of more of these flags to specify function options.

Use one of the following flags to specify how the function positions the shortcut menu horizontally.

Value Meaning
TPM_CENTERALIGN 0x0004L Centers the shortcut menu horizontally relative to the coordinate specified by the x parameter.
TPM_LEFTALIGN 0x0000L Positions the shortcut menu so that its left side is aligned with the coordinate specified by the x parameter.
TPM_RIGHTALIGN 0x0008L Positions the shortcut menu so that its right side is aligned with the coordinate specified by the x parameter.

В

Use one of the following flags to specify how the function positions the shortcut menu vertically.

Читайте также:  Linux mint уровни обновлений
Value Meaning
TPM_BOTTOMALIGN 0x0020L Positions the shortcut menu so that its bottom side is aligned with the coordinate specified by the y parameter.
TPM_TOPALIGN 0x0000L Positions the shortcut menu so that its top side is aligned with the coordinate specified by the y parameter.
TPM_VCENTERALIGN 0x0010L Centers the shortcut menu vertically relative to the coordinate specified by the y parameter.

В

Use the following flags to control discovery of the user selection without having to set up a parent window for the menu.

Value Meaning
TPM_NONOTIFY 0x0080L The function does not send notification messages when the user clicks a menu item.
TPM_RETURNCMD 0x0100L The function returns the menu item identifier of the user’s selection in the return value.

В

Use one of the following flags to specify which mouse button the shortcut menu tracks.

Value Meaning
TPM_LEFTBUTTON 0x0000L The user can select menu items with only the left mouse button.
TPM_RIGHTBUTTON 0x0002L The user can select menu items with both the left and right mouse buttons.

В

Use any reasonable combination of the following flags to modify the animation of a menu. For example, by selecting a horizontal and a vertical flag, you can achieve diagonal animation.

Value Meaning
TPM_HORNEGANIMATION 0x0800L Animates the menu from right to left.
TPM_HORPOSANIMATION 0x0400L Animates the menu from left to right.
TPM_NOANIMATION 0x4000L Displays menu without animation.
TPM_VERNEGANIMATION 0x2000L Animates the menu from bottom to top.
TPM_VERPOSANIMATION 0x1000L Animates the menu from top to bottom.

В

For any animation to occur, the SystemParametersInfo function must set SPI_SETMENUANIMATION. Also, all the TPM_*ANIMATION flags, except TPM_NOANIMATION, are ignored if menu fade animation is on. For more information, see the SPI_GETMENUFADE flag in SystemParametersInfo.

Use the TPM_RECURSE flag to display a menu when another menu is already displayed. This is intended to support context menus within a menu.

For right-to-left text layout, use TPM_LAYOUTRTL. By default, the text layout is left-to-right.

The horizontal location of the shortcut menu, in screen coordinates.

The vertical location of the shortcut menu, in screen coordinates.

Reserved; must be zero.

A handle to the window that owns the shortcut menu. This window receives all messages from the menu. The window does not receive a WM_COMMAND message from the menu until the function returns. If you specify TPM_NONOTIFY in the uFlags parameter, the function does not send messages to the window identified by hWnd. However, you must still pass a window handle in hWnd. It can be any window handle from your application.

Type: const RECT*

Return value

If you specify TPM_RETURNCMD in the uFlags parameter, the return value is the menu-item identifier of the item that the user selected. If the user cancels the menu without making a selection, or if an error occurs, the return value is zero.

If you do not specify TPM_RETURNCMD in the uFlags parameter, the return value is nonzero if the function succeeds and zero if it fails. To get extended error information, call GetLastError.

Remarks

Call GetSystemMetrics with SM_MENUDROPALIGNMENT to determine the correct horizontal alignment flag (TPM_LEFTALIGN or TPM_RIGHTALIGN) and/or horizontal animation direction flag (TPM_HORPOSANIMATION or TPM_HORNEGANIMATION) to pass to TrackPopupMenu or TrackPopupMenuEx. This is essential for creating an optimal user experience, especially when developing Microsoft Tablet PC applications.

To specify an area of the screen that the menu should not overlap, use the TrackPopupMenuEx function

To display a context menu for a notification icon, the current window must be the foreground window before the application calls TrackPopupMenu or TrackPopupMenuEx. Otherwise, the menu will not disappear when the user clicks outside of the menu or the window that created the menu (if it is visible). If the current window is a child window, you must set the (top-level) parent window as the foreground window.

However, when the current window is the foreground window, the second time this menu is displayed, it appears and then immediately disappears. To correct this, you must force a task switch to the application that called TrackPopupMenu. This is done by posting a benign message to the window or thread, as shown in the following code sample:

Оцените статью