如何为 Windows 构建 SystemTray 应用程序? [英] How to build a SystemTray app for Windows?

查看:37
本文介绍了如何为 Windows 构建 SystemTray 应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通常在 Linux 系统上工作,但我有一种情况需要编写一个客户端应用程序,该应用程序可以作为服务在 Windows 上运行.有人可以帮助我或指导如何为 Windows 环境构建系统托盘应用程序(例如 Dropbox),该应用程序在操作系统启动时启动,图标位于任务栏中,单击应用程序图标会显示一个菜单.

I usually work on a Linux system, but I have a situation where I need to write a client app that would run on windows as a service. Can someone help me or direct, on how to build a system tray app (for example like dropbox) for the windows environment, which gets started on OS startup and the icon sits in the TaskBar and on clicking the app icon presents a menu.

我的脚本语言是 python.谢谢.

My scripting language is python. Thanks.

推荐答案

您可以使用 pywin32(Python forWindows 扩展) 模块.

Python 2 示例代码

类似问题

为了让它在启动时运行,你可能会弄乱服务,但实际上在用户的启动文件夹"中安装指向 exe 的链接要容易得多.

To make it run at startup you could mess around with services but it's actually much easier to install a link to the exe in the users "Startup Folder".

Windows 7 和 Vista

c:\Users\[用户名]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

c:\Users\[username]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

Windows XP

c:\Documents and Settings\[用户名]\开始菜单\程序\启动

c:\Documents and Settings\[username]\Start Menu\Programs\Startup

这篇关于如何为 Windows 构建 SystemTray 应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆