Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Skin Framework
  New Posts New Posts RSS Feed - Problem with TrackPopupMenu/TPM_LEFTALIGN
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Problem with TrackPopupMenu/TPM_LEFTALIGN

 Post Reply Post Reply
Author
Message
rdefulio View Drop Down
Newbie
Newbie


Joined: 03 October 2014
Location: United States
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdefulio Quote  Post ReplyReply Direct Link To This Post Topic: Problem with TrackPopupMenu/TPM_LEFTALIGN
    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]

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

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

This page was generated in 0.156 seconds.