What's the difference between the TrackPopupMenuEx and TrackPopupMenu APIs?

I read about these APIs on this webpage: http://www.ex-designz.net/apicat.asp?apicat=34

I've tested the TrackPopupMenuEx and TrackPopupMenu APIs and they do the same thing: displaying the menu at the cursor position. The source codes are the same, you just need to add or remove "Ex" at the end of these API names. Why two APIs for the same action?

Note. TrackPopupMenu disconnects my app at runtime when used in an image control, while TrackPopupMenuEx works fine. TrackPopUpMenu doesn't seem to make sense.

+2


source to share


2 answers


They are pretty similar in functionality, but the big difference is that TrackPopupMenuEx allows you to specify a rectangle in which the popup menu will not appear (in order to have one that does not hide what you need to see). Something about this, as far as I can see.



0


source


According to the documentation, there are some subtle differences:

  • TrackPopupMenu has nReserved parameter
  • TrackPopupMenuEx takes LPTPMPARAMS for the last parameter, but TrackPopupMenu takes CONST RECT * (which is ignored)


So they have a different number and type of parameters with different values ​​- which explains why your application crashes when the call changes.

0


source







All Articles