以编程方式定期更改桌面壁纸

以编程方式定期更改桌面壁纸,第1张

概述以编程方式定期更改桌面壁纸

什么是最好的方式去创build一个程序,定期更改桌面壁纸? 我还想在程序周围创build一个GUI。 我是一名计算机科学专业的学生,​​正因为如此,我了解了基本的Java编程和C ++等。 这将在windows 7 *** 作系统上完成。

什么是最好的语言来使用这样的项目?

理想情况下,我想用系统时钟触发更改。 这可能吗?

我在我的头上吗?

进程终止C ++

停止node.Js服务器的所有实例

deBUGging线程时无限循环

显示窗口后如何从Tkinter中删除canvas

单点login通过IE浏览器

任何答案将非常感激。 谢谢。

如何在.NET中确定cpucaching大小?

我如何在运行时编写Python文件?

windows缩放

如何让Python使用Assembly

如何从数据表中设置DataGrIDVIEwComboBoxColumn的值?

这是一个相当简单的项目,可以使用任何可以调用Win32 API函数的语言(例如C ++)轻松完成。 带有SPI_SETDESKWALLPAPER标志的SystemParametersInfo是非显而易见的更改壁纸的函数。 你给它一个新的图像的文件名,并改变壁纸。

在Java中:

import java.util.*; public class changer { public static native int SystemParametersInfo(int uiAction,int uiParam,String pvParam,int fWinIni); static { System.loadlibrary("user32"); } public int Change(String path) { return SystemParametersInfo(20,path,0); } public static voID main(String args[]) { String wallpaper_file = "c:\wallpaper.jpg"; changer mychanger = new changer(); mychanger.Change(wallpaper_file); } }

在Win32 C ++中,您可以使用SetTimer触发更改。

#define STRICT 1 #include <windows.h> #include <iostream.h> VOID CALLBACK TimerProc(HWND hWnd,UINT nMsg,UINT nIDEvent,DWORD DWTime) { LPWSTR wallpaper_file = L"C:\Wallpapers\wallpaper.png"; int return_value = SystemParametersInfo(SPI_SETDESKWALLPAPER,wallpaper_file,SPIF_UPDATEINIfile); cout << "Programmatically change the desktop wallpaper periodically: " << DWTime << 'n'; cout.flush(); } int main(int argc,char *argv[],char *envp[]) { int Counter=0; MSG Msg; UINT TimerID = SetTimer(NulL,2000,&TimerProc); //2000 milliseconds cout << "TimerID: " << TimerID << 'n'; if (!TimerID) return 16; while (GetMessage(&Msg,NulL,0)) { ++Counter; if (Msg.message == WM_TIMER) cout << "Counter: " << Counter << "; timer messagen"; else cout << "Counter: " << Counter << "; message: " << Msg.message << 'n'; dispatchMessage(&Msg); } KillTimer(NulL,TimerID); return 0; }

总结

以上是内存溢出为你收集整理的以编程方式定期更改桌面壁纸全部内容,希望文章能够帮你解决以编程方式定期更改桌面壁纸所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/1286095.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-09
下一篇 2022-06-09

发表评论

登录后才能评论

评论列表(0条)

保存