About WMI ~~~, Find sanmaotuo (laifeng )......

Source: Internet
Author: User
About WMI ~~~, Find sanmaotuo (Lao Feng)... Delphi/Windows SDK/API
Http://www.delphi2007.net/DelphiAPI/html/delphi_20061122164538183.html
Sanmaotuo (old Feng) Haha, I thought there was no one to post, so I got it. Continue to consult

It doesn't matter. The old water is straight!
I used another method to obtain the running application.ProgramList. This method contains many useful things.

In particular, how to implement the for each statements that are not available in Delphi and how to manipulate COM.

WMI is a Windows Management Instrumentation, in which Ms defines many (should be full) system information classes, with it, you can obtain almost all the information (hard and soft) of the system, and use it for remote control and monitoring. Its syntax is very similar to the SQL syntax, so it is very convenient to operate. I am mainly working on an asset (computer system assets) management system recently. I am a bit enthusiastic about it to obtain information about a single machine :):)

Sanmaotuo (laifeng) recently, csdn is used every day. LZ is looking for the right person. I am looking at him from two underpants to four underpants. I am looking for a post to LZ. I have never used it for LZ reference.

Http://www.programfan.com/article/showarticle.asp? Id = 1364

For more information about WMI, see msdn
Http://msdn.microsoft.com/library/default.asp? Url =/library/en-US/dnanchor/html/anch_wmi.asp

How can I get the Application List through word? Code Post it again.

Procedure tform1.buttonclick (Sender: tobject );
VaR
_ Tasks: tasks;
Enum: ienumvariant;
Numelements: ulong;
_ Task: olevariant;
Begin
_ Tasks: = wordapplication. tasks;
Enum: = _ tasks. _ newenum as ienumvariant;
Enum. Next (1, _ task, numelements );
While succeeded (enum. Next (1, _ task, numelements) and (numelements> 0) Do
Begin
If (iunknown (_ task) as task). Visible then
ListBox. Items. Add (iunknown (_ task) as task). Name );
End;
End;

Learn together and make progress together!

PS: wmi wql syntax example
Select * From win32_process

Learning

Q: Which unit does ienumvariant belong?

In ActiveX Unit

To Lao Feng:
What is the definition of the task? The compiler does not pass.

Haha, I found it. I have never used word before, but there is still a problem _ tasks: = wordapplication. tasks;
However, if you want to view the wordapplication definition error message "unable to locate file" word2000.pas "", what is the problem?

You can find the server on the control board, and drag a wordapplication (Change name to wordapplication;
In addition, uses ActiveX is required.

1 Import Type Library path is c: \ winnt \ system32 \ WBEM \ wbemdisp. TLB
2 Use wbemscripting_tlb
3. For details about how to write WQL statements, search for the msdn reference.
I have someSource code, As needed. Y.walter@eyou.com

Haha, the network speed is too slow over the past two days. Thank you. I will close the post tomorrow. If you are interested, let's talk about it again :)

I'm not interested. I only hope LZ can publish it early ~~ Looking forward to ing !~~~~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.