Hi,
I made a little spinner control recently, just uploaded it here:
http://masm32.com/board/index.php?topic=1179.msg11375#msg11375Whilst developing it i ran into a number of interesting issues.
First was the way in which i developed it originally as a new class. I added all my code, and ran it, nothing showed up. I realised that i would have to handle the painting as STM_SETIMAGE is handled by a static control with the SS_BITMAP style. So i changed the code to superclass it, letting the static control do the default handling of the STM_SETIMAGE for each call. All seemed good, so went ahead and make a 2nd example, and decided to add a manifest to it.
Running it with the manifest showed nothing. Disabling manifest and recompiling showed the spinner image spinning. Odd i thought. So added WM_PAINT handler to draw the bitmap. Recompiled with manifest - all working, happy days.
I thought, ok, so my STM_SETIMAGE code is now redundant, dont need it, so comment it out, leave the increment to next step code in, recompile, and... nothing showed up.
Short version: I needed both STM_SETIMAGE code calls and WM_PAINT handling of bitmaps to allow the example to work with or without a manifest.
I presume there is some change in the way statics are handled with the common controls with a manifest included vs the old way windows handled it?
Ideally i would like the custom control to be independent of sub or super classing, and handling the painting itself, but tbh, i dont know enough about that to do it justice. It does sort of work now - except i havent tested it on winxp - which does have a memory leak issue when using STM_SETIMAGE - only have win7 64bit at the mo.
So if anyone wants to help out fix it up or test it out for me or has some ideas of the above issue (maybe my coding is wrong somewhere) please feel free to add any thoughts, comments, code examples, ideas or whatnot. Otherwise enjoy, hopefully someone will find it useful.
Cheers.