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]
|