I don't understand this.
First of all, your code won't even compile because "i" is undeclared.
Your while loop will probably never exit, so your program will just get stuck once you call GetAniFrameCount().
Even if this somehow worked, it would not return the frame rate of your app. You'd just be timing how fast DrawIconEx() is, which has nothing to do with frame rate.
And lastly, Windows applications don't have a "frame rate" per se. They are only redrawn when they need to be redrawn (e.g. when you rescale the window), so the concept of "frame rate" doesn't exist.