Print Page | Close Window

Problem with TrackPopupMenu/TPM_LEFTALIGN

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Skin Framework
Forum Description: Topics Related to Codejock Skin Framework
Printed Date: 03 March 2024 at 9:56am
Software Version: Web Wiz Forums 12.04 -

Topic: Problem with TrackPopupMenu/TPM_LEFTALIGN
Posted By: rdefulio
Subject: Problem with TrackPopupMenu/TPM_LEFTALIGN
Date Posted: 21 December 2020 at 5:51pm
I recently upgraded a legacy vb6 project from SkinFramework ActiveX Control 16.3.1 to 19.3.0 and Popup menu alignments started failing.  I am using the Windows TrackPopupMenu API to build a pop up menu and display it in the appropriate location in the application.

See the following simplified example.

iMenu = TrackPopupMenu(hMenu, Flags + TPM_LEFTALIGN, p.x, p.y, 0, GetForegroundWindow(), 0)

iMenu = TrackPopupMenu(hMenu, Flags + TPM_CENTERALIGN, p.x, p.y, 0, GetForegroundWindow(), 0)

iMenu = TrackPopupMenu(hMenu, Flags + TPM_RIGHTALIGN, p.x, p.y, 0, GetForegroundWindow(), 0)

In this example, LEFTALIGN ignores the value in p.x and treats it as zero, basically putting it at the left-most position on the display.  The Center and Right align work properly.

I reproduced this in the SkinControls sample application.  Rolling back to 16.3.1 fixes the issue.  I reproduced the issue in version 17.3, 18.4, and 19.3.  I need to upgrade because of an apparrent bug in 16.3 that affects scroll bars on server 2016 that the newer versions fix.

Here's what happens with TPM_LEFTALIGN  (Incorrect behavior)

And here's what happens with TPM_CENTERALIGN (This is the correct behavior)

Note that changing the application from LEFT to CENTER is not a desirable workaround because it changes where the popup appears relative to the mouse cursor (left, center or right aligned based on the mouse cursor's location).

Can I get a fix expedited for this?



[Edited to fix images]

Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 -
Copyright ©2001-2021 Web Wiz Ltd. -