Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detecting Vista Starter three-open-app limit

I'm working as a developer, curently mantaining a VB6 app that desperately needs to work fine under Vista. However, it must work fine under Vista Starter Edition, since is the version new computers here (Argentina) come with.

Now, onto the technical stuff: my app uses ImageMagick's convert to process images (resizing, black and white segmentation, rotation, etc), so the three-apps limit is a real pain in the... well, somewhere. Worst: the failure in running convert is not (currently?) detected, so when this happens the program hangs up.

Can anyone tell me how to:

a_ Detect the number of open apps, so I can ask the user to close something before retrying? An API call, maybe? or

b_ Detect that convert (currently running with the "Shell" function) wasn't launched properly?

Please, comments like "you should migrate your app to x" should be sent to my boss (not me), are not welcome and will make me travel to your place and bite your toe. It will take me some time to get the visa, though, but I assure you that one day a stranger will knock on your door, ask your StackOverflow username and then he WILL bite your toe.

Thanks for your consideration

like image 601
Martin Avatar asked May 17 '09 01:05

Martin


2 Answers

Why aren't you using the ImageMagickObject COM+ interface? I've never used it, but the documentation claims it can do everything the command-line utilities can, without running an extra app.

like image 115
Daniel Martin Avatar answered Nov 02 '22 06:11

Daniel Martin


Sigh

Disregard, I need to read beyond the subject line in the future!

Call GetSystemMetrics() passing SM_STARTER (a Const = 88).

Option Explicit

Private Const SM_STARTER = 88&

Private Declare Function GetSystemMetrics Lib "user32" ( _
    ByVal nIndex As Long) As Long

Private Sub Form_Load()
    MsgBox CStr(GetSystemMetrics(SM_STARTER)) 'Zero (0) means False.
End Sub

This is defined for XP, and ought to be the same for Vista. Easy enough to try, right?

like image 37
Bob Avatar answered Nov 02 '22 04:11

Bob