[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 613
  • Last Modified:

::TrackPopupMenu() and TPM_NOANIMATION

Hi,

I want to use Popup menu without animation. In MSDN (January 1999) I'm find:

Windows 98, Windows NT 5.0 and later: Use one of the following flags to modify the animation of a menu. Value Meaning
TPM_HORNEGANIMATION Animates the menu from left to right.
TPM_HORPOSANIMATION Animates the menu from right to left.
TPM_NOANIMATION Displays menu without animation.
TPM_VERNEGANIMATION Animates the menu from bottom to top.
TPM_VERPOSANIMATION Animates the menu from top to bottom.

I want to use TMP_NOANIMATION, but I can't find where this constant defined (There is no *.h file where this constant defined).

Q: How can I get OS version and disable animation (For W98 or NT50)?

I'm using VC60 with SP3.

Thanks
0
mahno
Asked:
mahno
  • 4
  • 3
1 Solution
 
ZoppoCommented:
Hi mahno,

to get state of or disable menu animation you can use SystemParametersInfo(SPI_SETMENUANIMATION) // or SPI_GETMENUANIMATION ...

Unfortunately I didn't found one of these 5 TPM_* defines...

ZOPPO
0
 
mahnoAuthor Commented:
Hi ZOPPO,

Constants: SPI_SETMENUANIMATION, SPI_GETMENUANIMATION are not defined too.

May be U know it's numeric values?

mahno


0
 
ZoppoCommented:
I found them defined in WinUser.h:

#if(WINVER >= 0x0500)
....
#define SPI_GETMENUANIMATION                0x1002
#define SPI_SETMENUANIMATION                0x1003
....
#endif /* WINVER >= 0x0500 */

ZOPPO
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
mahnoAuthor Commented:
Hi Zoppo,

I'm found these define too. But, it does not work:

BOOL bAnim = FALSE;
int rc = SystemParametersInfo(0x1003/*SPI_SETMENUANIMATION*/, 0, (PVOID)&bAnim, 0);

If I try to get animation state:

int rc = SystemParametersInfo(0x1002/*SPI_GETMENUANIMATION*/, 0, (PVOID)&bAnim, 0);

I still recieve TRUE. I'm working over W98. Any ideas?

regards,
  mahno
0
 
ZoppoCommented:
To set the state pass the value directly, not via pointer:

BOOL bAnim = FALSE;
int rc = SystemParametersInfo(0x1003/*SPI_SETMENUANIMATION*/, 0, (PVOID)bAnim, 0);

hope that helps,

ZOPPO
0
 
mahnoAuthor Commented:
Thanks Zoppo, now it's worked.

regards,
  mahno
0
 
ZoppoCommented:
no problem, you're welcome               :)
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now