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
URL: http://forum.codejock.com/forum_posts.asp?TID=24117
Printed Date: 29 April 2024 at 1:05am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


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.

Flags = TPM_RIGHTBUTTON + TPM_NONOTIFY + TPM_RETURNCMD
    
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?

Thanks

Ron

[Edited to fix images]




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net