0

I added an activeX control that allows me to display an animated gif on a visual basic 6 form to show an ajax style progress spinner. When I run this application on Windows 8 Pro x64, the spinner image will not appear. If I run my application as Administrator, it then appears. I do have a manifest with this program which executes as invoker, I don't want to require this application to have admin rights.

Any ideas as to why an animated gif activeX control would require admin rights and if there is a better way to show something like a simple spinner animated gif?

Thank you.

Neal
  • 9,487
  • 15
  • 58
  • 101
  • 1
    It's pretty unlikely that VB has anything to do with it. It's the ActiveX control that dispalys the image, not VB. Which control? How does it do it? It would appear it's calling a restricted API. Can you check with the publisher of the ActiveX control? – Euro Micelli Mar 27 '13 at 17:37
  • Thanks - control from ancient times, doubt the publisher is in existence last I checked, freeware. Probably have to move to a browser control I guess. – Neal Mar 27 '13 at 19:09
  • I would get rid of the control and try to use the MS Animation ActiveX control; it will require you to convert the animation to AVI (uncompressed or RLE) but it should work ("Microsoft Windows Common Controls-2 5.0"). Alternatively, you could load each frame on a 'control array' of conventional image controls, and flip them around on a timer. It might end up being jerky - I don't know; I guess it depends on the animation, but it's not hard to try. – Euro Micelli Mar 27 '13 at 20:06
  • @EuroMicelli, well, while we're at it, why not just load each frame into a `HBITMAP` and select it into a compatible DC and use a timer to `BitBlt` them to the form's DC using `UpdateWindow` or `InvalidateRect` to refresh the form. That's how I am at least, when vb6 code shows signs of its age, que Win32 API. – Motomotes Mar 28 '13 at 00:04
  • @Motes, I think that's rather overkill when there are simpler alternatives. There is also little concern for performance; VB6's Image control is a windowless lightweight control that indeed does little more than `BitBlt` its selected bitmap to its parent's DC. – Euro Micelli Mar 28 '13 at 04:19
  • 1
    the problem could also be with the location of the gif file, maybe that folder is only accessible for users with administrator rights? – Hrqls Mar 28 '13 at 08:30
  • @Hrqls, really good thinking. I had assumed that the image was preloaded at design-time, but there is no guarantee of that. We don't know anything the ActiveX control. – Euro Micelli Mar 28 '13 at 11:00
  • I thought the same thing as the image is on C:\Program Files\AppName so I recoded it and moved it to the Windows Temp folder to get away from UAC and the same problem occurred. I'll try the user's working folder and see if that makes any difference. – Neal Mar 28 '13 at 12:02
  • 1
    Try using Process Monitor and run the program until it fails. Look for access denied errors in the log. – Euro Micelli Mar 29 '13 at 12:26
  • Euro Micelli - that helped find the problem, thank you. Go ahead and add a reply to this question if you want and I'll mark it as the answer for you. I do have the source to this ancient OCX come to find out so I'll code the fix myself. They are using Bitblt but using a temp path that's not UAC compliant it appears. – Neal Mar 30 '13 at 15:09

1 Answers1

1

Thank you Euro Micelli - the Process Monitor was a great idea. It was a UAC conflict that I was able to resolve by modifying the source of the ActiveX control which I discovered I had with the component used. The component was programmed to use App.Path which obviously didn't work when installed in the Windows System32 folder. I coded it to use the Windows Temp folder and it now works.

Neal
  • 9,487
  • 15
  • 58
  • 101