如何在Windows启动时以高优先级启动exe(就像壁纸引擎一样)

发布于 2025-01-10 06:21:41 字数 1754 浏览 0 评论 0原文

所以基本上我找到了一张动画计算机启动过程的壁纸,输入内容(看起来像这样:https://www.youtube.com/watch?v=Wnj34q-8IPA)(归功于 Bemuse)

一开始它显示了一些文本,一个接着一个另一个..最后它说“完成”,

在我的情况下,我编辑了壁纸js脚本并添加了要在开始时显示的启动程序(当文本出现时..如下所示)

图1

之后,弹出此屏幕

图片2

我想要的..是只要显示图片1上的文本就隐藏我的桌面图标,并在显示图2中的屏幕时取消隐藏它们。

如果您在视频中看到.. 在显示“完成”文本后.. 在左侧,时钟和淡蓝色淡出边框闪烁了一下,然后停留在屏幕上.. 当发生这种情况时.. 我想要我的图标取消隐藏

,所以我找到了一个名为 AutoHotkey 的工具,它可以使用快捷键隐藏桌面的图标。在这种情况下,我使用了 f10

我用 python 制作了一个脚本,基本上只是自动执行此操作

  1. 启动 AutoHotkey 脚本(让我用 F10 隐藏壁纸)
  2. 按 F10(隐藏我的桌面图标)
  3. 等待 32 秒(这正是壁纸完成显示所有文本所需的时间)
  4. 按 F10(取消隐藏我的桌面图标)
  5. 停止 AutoHotkey 程序

运行脚本,

import keyboard, time, os

os.startfile(r"C:\Users\peter\Documents\Programming\Python\Python Projects\Random\Hide Icons\HideIconsScript.ahk")

keyboard.press("f10")
keyboard.release("f10")

time.sleep(32)

keyboard.press("f10")
keyboard.release("f10")

os.system("taskkill /im AutoHotkey.exe")

所以我将此程序的快捷方式放在我的启动文件夹中,

问题是,虽然壁纸引擎比启动应用程序启动得早,因为它有一个特定的Windows服务,可以让它在启动时以高优先级运行..所以作为一个结果我的python脚本(上面提到的)具有默认优先级(正常)..延迟启动太多,以至于当它最终运行时..壁纸已经在文本阶段播放了..所以它有点无用,

所以我想要什么要做的就是在壁纸引擎启动的同时启动我的 python 脚本..

我尝试使用任务调度程序..我将其使用 xml 脚本以优先级 0(实时)运行,但它似乎对

我尝试过的 没有帮助编辑注册表,这样我就可以创建像壁纸引擎这样的 Windows 服务有..但这也不起作用..因为我不知道注册表到底是如何工作的..而且没有很多好的教程来告诉我我想要什么..

最后我最后的希望是尝试解决Bemuse(那个家伙制作了壁纸)js文件..从壁纸内部向我的python脚本添加了一个运行命令,但仍然..不能因为我不知道js的好处,此外..无法从他的代码中理解很多(显然)

我知道我没那么好在解释时,但如果有人理解我的意思..以及我想做什么..请帮助我..我花了很多时间却一无所获..

So basically i have found a wallpaper that animates the proccess of a computer starting, type thing (it looks like this: https://www.youtube.com/watch?v=Wnj34q-8IPA)(Credits to Bemuse)

At the begining it shows some texts , one after the other.. and at the end it says "complete"

in my case i edited the wallpaper js script and added my startup programs to be shown at the start (when the texts appear.. as shown below)

Picture 1

after that, this screen pops up

Picture 2

what i want.. is to hide my desktop icons for as long as the texts on picture 1 are shown and unhide them when the screen in picture 2 is shown.

if you see in the video.. right after the text "complete" is shown.. on the left side, the clock and a light blue fading border flickers for a bit, and then stays on screen.. when this happens.. i want my icons to unhide

so i found a tool called AutoHotkey which can hide icons of your desktop with a shortcut key.. in this case i went with f10

i made a script with python that basically just automates this action

  1. Starts the AutoHotkey script (which lets me hide wallpapers with f10)
  2. Presses f10 (hides my desktop icons)
  3. Waits 32 sec (which is exactly the time the wallpaper takes to finish showing all the texts)
  4. Presses f10 (unhides my desktop icons)
  5. Stops the AutoHotkey program from running

heres the script

import keyboard, time, os

os.startfile(r"C:\Users\peter\Documents\Programming\Python\Python Projects\Random\Hide Icons\HideIconsScript.ahk")

keyboard.press("f10")
keyboard.release("f10")

time.sleep(32)

keyboard.press("f10")
keyboard.release("f10")

os.system("taskkill /im AutoHotkey.exe")

so i put this programs shortcut on my startup folder

the problem is though that Wallpaper engine starts way earlier than the startup apps because it has a specific windows service that lets it run in high priority on startup.. so as a result my python script (mentioned above) which has the default priority (normal).. delays to start so much that when it finally runs.. the wallpaper has already played through the text phase.. so its a bit useless

so what i want to do is start my python script at the same time as wallpaper engine starts..

i have tried using task scheduler.. i put it to run with priority 0 (real time) with an xml script but it didnt seem to help

i have tried editing the registry so i can make a windows service like wallpaper engine has.. but that didnt work either.. cause i dont know how registry works exactly.. and there arent many good tutorials to show me what i want..

and finally my last hope was to try and work around Bemuse (the guy who made the wallpaper) js files.. to add a run command to my python script from inside the wallpaper but still.. couldnt cause i dont know that good of js and besides.. couldnt understand a lot from his code (obviously)

I know that im not that good on explaining but if someone understands what i mean.. and what i want to do.. please help me.. i 've spent so many hours and got nothing..

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文