Windows应用程序的使用频率

发布于 2024-08-09 07:16:25 字数 73 浏览 5 评论 0原文

我有一个主页需要统计记事本或计算器应用程序的使用频率。有没有什么Windows API可以让我知道Windows应用程序的使用频率?

I have a homepage need to count the usage frequency of Notepad or Calc application. Is there any Windows API that I can know the usage frequency of windows application?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

旧情勿念 2024-08-16 07:16:25

不。但是您可以编写一个服务来检查内存中的应用程序并进行适当的计算。几个链接:

此外,bua 的 shell 变体是相当现成的解决方案。您只需要一些解析和更新计数器(数据库中不需要)。

No. But you can write a service that will check applications in memory and do appropriate calculations. Few links:

Also, shell variant from bua is quite ready solution. You just need some parsing and updating the counter (not necessary in the database).

青春有你 2024-08-16 07:16:25

我不知道,但你可以很容易地通过以下方式实现这一目标:

例如:
使用

cmd.exe->任务列表

。 (这不会加载 CPU) - 一种好的解决方案是使用 python 调度程序。

import sched, time
from subprocess import *
s = sched.scheduler(time.time, time.sleep)
def get_task():
    f=open("log",'wt')
    p=Popen("tasklist",stdout=f)
    p.terminate()
    p.close()

def analise_logs():
    # do some analise here

def print_some_times():
    while(1):
        print time.time()
        s.enter(5, 1, get_tasks, ())
        analise_logs()
        s.run()

对该文件执行一些 awk (如果您有 cygwin)或 powershell awk 之类的处理。

计算您感兴趣的进程。将结果写入另一个包含更新信息的文件。

I don't know about one, but You could quite easily achieve that by:

ex:
using

cmd.exe -> tasklist

apply each 10 sec. (that would not load the CPU) - one good solution is to use python scheduler.

import sched, time
from subprocess import *
s = sched.scheduler(time.time, time.sleep)
def get_task():
    f=open("log",'wt')
    p=Popen("tasklist",stdout=f)
    p.terminate()
    p.close()

def analise_logs():
    # do some analise here

def print_some_times():
    while(1):
        print time.time()
        s.enter(5, 1, get_tasks, ())
        analise_logs()
        s.run()

do some awk (if you have cygwin), or powershell awk like processing on that file.

Count processes which interest you. Write result to another file with updated infos.

停顿的约定 2024-08-16 07:16:25

看看我对如何停止应用程序的回答打开并使用相同的技术。本质上,当应用程序启动时,您的程序就会运行,您可以记录所需的任何信息,然后打开应用程序。

Take a look at my answer to How Do I Stop An Application From Opening and use the same technique. In essence when the application is launched your program is run and you can log any information that you require and then open the app.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文