Solved

::TrackPopupMenu() and TPM_NOANIMATION

Posted on 2000-03-30
7
596 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 31

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 31

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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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 31

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 31

Accepted Solution

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

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

791 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