Link to home
Start Free TrialLog in
Avatar of visexpert
visexpert

asked on

Get Monitor Serial via WMI

Hi.

Has someone a code for Delphi to get the Monitor Serial via WMI
or something else used to get it?

Attached is an app that can get it, but it's VB code :(

http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=59528&lngWId=1

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of shaneholmes
shaneholmes

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of visexpert
visexpert

ASKER

How to get it remotely?
Remotely? That wasn't in your original question.

"Has someone a code for Delphi to get the Monitor Serial via WMI
or something else used to get it?"

<SMILE>

Sorry - dont have a clue!

sholmes
Yes via WMI is enough. Do you think this demo is taken it from WMI?
Both components in their descriptions mention info extracted using the WMI. Although, I haven't tested either of them. I suggest you look at them, maybe install the components and test the demo apps to see how they work and if they do wahat your looking to do.

sholmes
Here is also an exampl eof Using the WMI (delphi code), which uses the WbemScripting_TLB type library.

http://www.swissdelphicenter.ch/torry/showcode.php?id=2135

shaneholmes
NOTE:

You need the WbemScripting_TLB unit, which you can create by installing the type library (located in the  Windows\System32\wbem\wbemdisp.tlb

using the "Project|Import type library" menu option


shaneholmes
Dear shaneholmes.

All i can see from this link is it fetching Processes, not Monitor Serial?
http://www.swissdelphicenter.ch/torry/showcode.php?id=2135
Sorry, my intentions (with my last two post) were to show you how they import  the type library and use that access the WMI - not one particularly region of it.

shaneholmes
I see no simple demo that can show me how this is possible in Delphi.
No, its not a simple solution by any means. It will take some research and work to write this. Thats why i was pushing you towards components all ready written. If you decided to write your own, I was showing you where others have looked!

shaneholmes
Is it possible to get similar Delphi demo get Monitor Serial?
http://www.swissdelphicenter.ch/torry/showcode.php?id=2135
I do not know. I have not seen any. Im sure someone has done it - I just dont know who or when.

Here is what i would do. Go to MSDN (microsoft's developer network pages) and get the SDK info on this WMI. Learn what the constants, and routines are for what you are trying to do. Then compare it with  that code in that Link:

http://www.swissdelphicenter.ch/torry/showcode.php?id=2135

Im sure it is just a matter of replacing it with the appropriate calls & constants for getting the monitor serial


Sorry I couldn't help you more

You could ask that this question be deleted if you like - i wont object to it.

You could also post the  question again. I wont respond to it.
Sometimes, experts see a response already, they stay away from it, cause they think that one expert might have already solved it, and therefore it would be a waste of their time attempting.


Good Luck!

shaneholmes

The VB sample only get information from registry(HKLM\SYSTEM\CurrentControlSet\Enum\DISPLAY or HKLM\ENUM\Monitor).
You can use RegConnectRegistry to get it from remote site.