Help much appreciated.
Thanks in advance.
--
Derrick Guest
CompTIA A+ Certified Professional
MCP
Set Service = GetObject("winmgmts:").execquery("SELECT * FROM
Win32_DesktopMonitor")
For Each Obj In Service
Debug.Print Obj.GetObjectText_
Next
Win32_DesktopMonitor
instance of Win32_DesktopMonitor
{
Availability = 3;
Caption = "ViewSonic 17GS-2";
ConfigManagerErrorCode = 0;
ConfigManagerUserConfig = FALSE;
CreationClassName = "Win32_DesktopMonitor";
Description = "ViewSonic 17GS-2";
DeviceID = "DesktopMonitor1";
MonitorManufacturer = "ViewSonic";
MonitorType = "ViewSonic 17GS-2";
Name = "ViewSonic 17GS-2";
PixelsPerXLogicalInch = 96;
PixelsPerYLogicalInch = 96;
PNPDeviceID = "DISPLAY\\VSC394A\\5&32C08D19&1&22446688&01&00";
ScreenHeight = 1024;
ScreenWidth = 1280;
Status = "OK";
SystemCreationClassName = "Win32_ComputerSystem";
SystemName = "MICROSOF-ANXK7N";
};
You can then respond appropriately.
HTH
"Derrick Guest" <derric...@blueyonder.co.uk> wrote in message
news:uQEU6w0gCHA.3708@tkmsftngp08...
Thanks for that - and yes it was a help - though unfortunately I'm not
looking at using WMI (well, not at the stage of deployment that I require a
screen center)
Thanks again though.
Degs
"Richard T. Edwards" <r.t.e...@attbi.com> wrote in message
news:6Xcx9.56024$bt.8...@rwcrnsc52.ops.asp.att.net...
I'm not sure what you're after. If you just want
raw size from which to determine coordinates,
you can use HTML. Just initiate an
InternetExplorer.Application, get the size, and
never open the window.
Try this:
----start-script----
Set oIEApp= CreateObject("InternetExplorer.Application")
oIEApp.Navigate("about:blank")
Do
WScript.Sleep 50
Loop Until oIEApp.ReadyState=4
With oIEApp.Document.ParentWindow
vWid= .Screen.AvailWidth: vHt= .Screen.AvailHeight
End With
Set oIEApp= Nothing
WScript.Echo vWid, vHt
----end-script----
Regards,
Joe Earnest
"Derrick Guest" <derric...@blueyonder.co.uk> wrote in message
news:uQEU6w0gCHA.3708@tkmsftngp08...
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.410 / Virus Database: 231 - Release Date: 10-31-02
With CreateObject("htmlfile").ParentWindow.Screen
vWid= .AvailWidth: vHt= .AvailHeight
End With
WScript.Echo "Width: ", vWid, "Height: ", vHt
Tom Lavedas
===========
Been using some of your posted code for
awhile (always try to give credit when passing
it on). It's good to finally "meet" you in a thread.
So, I'm obviously still learning ...
Just what the devil is the "htmlfile" object? I
can't find a solid mention of it in an MSDN
search. Got a reference?
Regards,
Joe Earnest
"Tom Lavedas" <lav...@pressroom.com> wrote in message
news:3DC5845A...@pressroom.com...
Thanks for that, but no, I'm not looking at an IE instance - the vbscript is
to center a dialog 'form', and all I'm after is the center point of the
screen..
ie...if I was to use VB it would be a case of screen.width and screen.height
etc..etc.....but this isn't working in vbs.
The vbs is being called 'synchronously' from a custom exe that I wrote in VB
as a logon script - simply because the environment that I'm working in is
all NT4 (I'm working towards hopefully upgrading to 2000 so that I can run
the vbs scripts as a logon without the synchronous exe call)
As there will be on-going additions to the logon scripts - various
customisations etc... for the users - I'm "locking out" the running of apps
until the logon process has finished - hence why I'm not making a call to
IE.
I'm then looking at 'wrapping' the scripts in a 'management console' - which
I've already started and which so far is working fine.
Kinda strange that I can't figure out how to get the center co-ords of the
screen without using 'convential' methods - ie wmi etc.. :))
As I said - just a simple thing - but its got me puzzled !!!
degs :)
"Joe Earnest" <joeea...@qwest.net> wrote in message
news:e#ZWbc4gCHA.2460@tkmsftngp10...
Joe Earnest
You may be locking out my call to IE,
but are you locking out Tom's method?
His method accesses mshtml.dll as the
processor directly, using the dll code to
provide the information. IE is never
started.
If you can't use Tom's method, can you
get the current screen size setting directly
from the registry? (Running a RegEdit find,
there appear to be a couple of odd places
to grab it on my WinXP, but I don't know
what corresponds to WinNT).
Regards,
Joe Earnest
"Derrick Guest" <derric...@blueyonder.co.uk> wrote in message
news:u9LwiD5gCHA.2592@tkmsftngp12...
I'll re-visit the use of mshtml methinks.
Thanks to Tom as well.
degs
"Joe Earnest" <joeea...@qwest.net> wrote in message
news:ujWwq76gCHA.2364@tkmsftngp08...