Solved

::TrackPopupMenu() and TPM_NOANIMATION

Posted on 2000-03-30
7
586 Views
Last Modified: 2012-05-04
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
Comment
Question by:mahno
  • 4
  • 3
7 Comments
 
LVL 30

Expert Comment

by:Zoppo
ID: 2669454
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
 
LVL 1

Author Comment

by:mahno
ID: 2672879
Hi ZOPPO,

Constants: SPI_SETMENUANIMATION, SPI_GETMENUANIMATION are not defined too.

May be U know it's numeric values?

mahno


0
 
LVL 30

Expert Comment

by:Zoppo
ID: 2672888
I found them defined in WinUser.h:

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

ZOPPO
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 1

Author Comment

by:mahno
ID: 2679440
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
 
LVL 30

Expert Comment

by:Zoppo
ID: 2679470
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
 
LVL 1

Author Comment

by:mahno
ID: 2679569
Thanks Zoppo, now it's worked.

regards,
  mahno
0
 
LVL 30

Accepted Solution

by:
Zoppo earned 50 total points
ID: 2679575
no problem, you're welcome               :)
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now