I have an application -- it has two timers in it -- when running in virutal pc;
it runs slow -- to the point most users kill it iwth the task manager


I would like to find a reliable way to detect vpc & disable the timers.

Anyone have any ideas?


--- AntiSpam/harvest ---
Remove X's to send email to me.

RE: Reliable way to detect VirtualPC by MichelRoy

MichelRoy
Sat May 20 10:21:02 CDT 2006

you could do
1. read the registry to find if the video card is a VM addition s3 trio....
2. check for the presence of a VMADD directory under windows or...
3.
PROCEDURE isVPC
LOCAL strComputer AS STRING, objWMIService AS OBJECT, colItems AS OBJECT
LOCAL objItem AS OBJECT, Manufacturer AS STRING, llisVPC AS Boolean
llisVPC = .F.
strComputer = "."
objWMIService = GETOBJECT("winmgmts:" ;
+ "{impersonationLevel=impersonate}!\\" + strComputer + "\root\cimv2")

colItems = objWMIService.ExecQuery("Select * from Win32_BaseBoard")

FOR EACH objItem IN colItems
Manufacturer = objItem.Manufacturer
IF Manufacturer = "Microsoft Corporation" THEN
llisVPC = .T.
EXIT
ENDIF
NEXT
RETURN llisVPC
ENDPROC



"Josh Assing" wrote:

> I have an application -- it has two timers in it -- when running in virutal pc;
> it runs slow -- to the point most users kill it iwth the task manager
>
>
> I would like to find a reliable way to detect vpc & disable the timers.
>
> Anyone have any ideas?
>
>
> --- AntiSpam/harvest ---
> Remove X's to send email to me.
>

Re: Reliable way to detect VirtualPC by Josh

Josh
Sat May 20 13:38:27 CDT 2006

Thanks
Those seem to rely on the vmadditions being added.

but you've given me an idea to look for specific hardware, still not reliable;
but probably better than nothing.

Thanks
-j

On Sat, 20 May 2006 08:21:02 -0700, Michel Roy
<MichelRoy@discussions.microsoft.com> wrote:

>you could do
>1. read the registry to find if the video card is a VM addition s3 trio....
>2. check for the presence of a VMADD directory under windows or...
>3.
>PROCEDURE isVPC
> LOCAL strComputer AS STRING, objWMIService AS OBJECT, colItems AS OBJECT
> LOCAL objItem AS OBJECT, Manufacturer AS STRING, llisVPC AS Boolean
> llisVPC = .F.
> strComputer = "."
> objWMIService = GETOBJECT("winmgmts:" ;
> + "{impersonationLevel=impersonate}!\\" + strComputer + "\root\cimv2")
>
> colItems = objWMIService.ExecQuery("Select * from Win32_BaseBoard")
>
> FOR EACH objItem IN colItems
> Manufacturer = objItem.Manufacturer
> IF Manufacturer = "Microsoft Corporation" THEN
> llisVPC = .T.
> EXIT
> ENDIF
> NEXT
> RETURN llisVPC
>ENDPROC
>
>
>
>"Josh Assing" wrote:
>
>> I have an application -- it has two timers in it -- when running in virutal pc;
>> it runs slow -- to the point most users kill it iwth the task manager
>>
>>
>> I would like to find a reliable way to detect vpc & disable the timers.
>>
>> Anyone have any ideas?
>>
>>
>> --- AntiSpam/harvest ---
>> Remove X's to send email to me.
>>


--- AntiSpam/harvest ---
Remove X's to send email to me.

Re: Reliable way to detect VirtualPC by MichelRoy

MichelRoy
Sat May 20 13:50:01 CDT 2006

the isVPC procedure does not need virtual machine additions
it checks the name of the motherboard manufacturer and runs on any PC

if it returns Microsoft, it's a virtual pc.


"Josh Assing" wrote:

> Thanks
> Those seem to rely on the vmadditions being added.
>
> but you've given me an idea to look for specific hardware, still not reliable;
> but probably better than nothing.
>
> Thanks
> -j
>
> On Sat, 20 May 2006 08:21:02 -0700, Michel Roy
> <MichelRoy@discussions.microsoft.com> wrote:
>
> >you could do
> >1. read the registry to find if the video card is a VM addition s3 trio....
> >2. check for the presence of a VMADD directory under windows or...
> >3.
> >PROCEDURE isVPC
> > LOCAL strComputer AS STRING, objWMIService AS OBJECT, colItems AS OBJECT
> > LOCAL objItem AS OBJECT, Manufacturer AS STRING, llisVPC AS Boolean
> > llisVPC = .F.
> > strComputer = "."
> > objWMIService = GETOBJECT("winmgmts:" ;
> > + "{impersonationLevel=impersonate}!\\" + strComputer + "\root\cimv2")
> >
> > colItems = objWMIService.ExecQuery("Select * from Win32_BaseBoard")
> >
> > FOR EACH objItem IN colItems
> > Manufacturer = objItem.Manufacturer
> > IF Manufacturer = "Microsoft Corporation" THEN
> > llisVPC = .T.
> > EXIT
> > ENDIF
> > NEXT
> > RETURN llisVPC
> >ENDPROC
> >
> >
> >
> >"Josh Assing" wrote:
> >
> >> I have an application -- it has two timers in it -- when running in virutal pc;
> >> it runs slow -- to the point most users kill it iwth the task manager
> >>
> >>
> >> I would like to find a reliable way to detect vpc & disable the timers.
> >>
> >> Anyone have any ideas?
> >>
> >>
> >> --- AntiSpam/harvest ---
> >> Remove X's to send email to me.
> >>
>
>
> --- AntiSpam/harvest ---
> Remove X's to send email to me.
>

Re: Reliable way to detect VirtualPC by Josh

Josh
Sat May 20 13:57:24 CDT 2006

>PROCEDURE isVPC
> LOCAL strComputer AS STRING, objWMIService AS OBJECT, colItems AS OBJECT
> LOCAL objItem AS OBJECT, Manufacturer AS STRING, llisVPC AS Boolean
> llisVPC = .F.
> strComputer = "."
> objWMIService = GETOBJECT("winmgmts:" ;
> + "{impersonationLevel=impersonate}!\\" + strComputer + "\root\cimv2")
>
> colItems = objWMIService.ExecQuery("Select * from Win32_BaseBoard")
>
> FOR EACH objItem IN colItems
> Manufacturer = objItem.Manufacturer
> IF Manufacturer = "Microsoft Corporation" THEN
> llisVPC = .T.
> EXIT
> ENDIF
> NEXT
> RETURN llisVPC
>ENDPROC

Just tried it on nt4 & win98 -- no go

But it does appear to work on win2k and above.

Thanks for the code.


--- AntiSpam/harvest ---
Remove X's to send email to me.