- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我已经有链接了 http://cam.sheratonamsterdamairportview.com/view_live1.jpg .此链接链接到史基浦机场的相机,每 20 秒拍摄一张照片。
我真的很想每 20 秒更新一次这张照片作为我的桌面背景。这可能吗?
我需要制作一个程序还是可以将它与技巧联系起来?顺便说一句,我运行的是 Windows 7。
最佳答案
如果您使用的是 Windows XP,您只需在桌面上添加 Activity 内容即可。
Right Mouse Button on Desktop -> Properties -> Desktop tab -> Customize Desktop -> Web tab -> New -> Location "www"
设置您的 URL 并激活内容。您将在桌面上看到一个小窗口,其中包含来自相机的图片。如果它不会自动刷新,则创建一个简单的页面,元刷新 20 秒,并为您的链接设置带有 src 属性的 img 标签。
我不确定以上是否适用于 Vista/7。
否则
这可能对您有用:
'Set the wallpaper
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_VideoController",,48)
Set WshShell = WScript.CreateObject("WScript.Shell")
Set WshSysEnv = WshShell.Environment("Process")
Set objFSO = CreateObject("Scripting.FileSystemObject")
WinPath = WshSysEnv("SystemRoot") & "\YourWallpaper.bmp"
If Not objFSO.FileExists(winpath) then
'If the file does not exist then copy it
For Each objItem in colItems
sourcePath = "\\path\here\"
rightSize = "NameHere" & objItem.CurrentHorizontalResolution & "x" & objItem.CurrentVerticalResolution & ".bmp"
objFSO.CopyFile sourcePath & rightSize, WSHShell.ExpandEnvironmentStrings ("%SystemRoot%") & "\NameYourWallpaper.bmp", overwrite = True
Next
End If
'************************************************************************************************************************************************
'Set Wallpaper Bitmap to Default
Set WshShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
sWinDir = objFSO.GetSpecialFolder(0)
sWallPaper = sWinDir & "\NameYourWallpaper.bmp"
' update in registry
WshShell.RegWrite "HKCU\Control Panel\Desktop\Wallpaper", sWallPaper
WshShell.Regwrite "HKCU\Software\Microsoft\Internet Explorer\Desktop\General\Wallpaper", sWallPaper
WshShell.Regwrite "HKCU\Software\Microsoft\Internet Explorer\Desktop\General\BackupWallpaper", sWallPaper
' let the system know about the change
WshShell.Run "%windir%\System32\RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters", 1, True
这是 VBscript,它将更改桌面背景并在之后重新加载您的配置文件以让您看到更改。
或者,如果您想要更多,这里有一段代码,您应该看看:
此示例演示了许多有用的技术,包括:从随机列表中选择一个文件。设置桌面墙纸。设置桌面墙纸样式(居中、平铺或拉伸(stretch))。编写注册表项。将文件移入废纸篓。使用系统默认的编辑器编辑文件。当程序启动时(以及当您单击 Apply 按钮时),程序调用 ReadFiles。该例程读取指定目录中文件的名称,并保存以 BMP、GIF、JPG 和 JPEG 结尾的文件。加载所有文件名后,例程调用 RandomizeNames 来随机化列表。
Sub ReadFiles()
Dim file As String
Dim ext As String
' Create the new file name collection.
Set FileNames = New Collection
' Get the file names.
file = Dir(DirName & "\*.*")
Do While file <> ""
If LCase$(file) <> "temp.bmp" Then
ext = UCase$(Right$(file, 4))
If ext = ".BMP" Or ext = ".GIF" Or _
ext = ".JPG" Or ext = "JPEG" _
Then _
FileNames.Add file
End If
file = Dir()
Loop
NumNames = FileNames.Count
RandomizeNames
End Sub
子例程 RandomizeNames 创建一个索引数组,其中一个条目对应 FileNames 集合中的每个名称。对于 i = 1 到 NumNames - 1,例程选择一个随机索引并将其交换到位置 i。
Private Sub RandomizeNames()
Dim idx As Integer
Dim tmp As Integer
Dim i As Integer
ReDim Indexes(1 To NumNames)
For i = 1 To NumNames
Indexes(i) = i
Next i
' Randomize them.
For i = 1 To NumNames - 1
idx = Int((NumNames - i + 1) * Rnd + i)
tmp = Indexes(i)
Indexes(i) = Indexes(idx)
Indexes(idx) = tmp
Next i
' Point to the index to display.
NextIndex = 1
End Sub
当定时器触发时,程序调用 ShowFile 以显示随机列表中的下一个文件。
Private Sub SwitchTimer_Timer()
Dim secs As Long
Dim pic As Integer
' See if it's time yet.
secs = DateDiff("s", Now, NextTime)
If secs <= 1 Then
If FileNames.Count > 1 Then
pic = Indexes(NextIndex)
NextIndex = NextIndex + 1
If NextIndex > NumNames Then RandomizeNames
ShowFile FileNames(pic)
End If
NextTime = DateAdd("s", Pause, Now)
secs = Pause
End If
If secs <= 60 Then
SwitchTimer.Interval = secs * 1000
Else
SwitchTimer.Interval = 60000
End If
SwitchTimer.Enabled = True
End Sub
子例程 ShowFile 检查样式组合框并设置注册表项以使桌面图像居中、平铺或拉伸(stretch)。接下来,如果文件是位图文件,程序只需调用 SystemParametersInfo API 函数来设置桌面背景图像。
如果文件不是位图文件,程序会将其加载到隐藏的 PictureBox 中,然后将图像保存为位图文件。然后调用 SystemParametersInfo。
Private Sub ShowFile(ByVal file_name As String)
Const STYLE_CENTERED As String = "0"
Const STYLE_TILED As String = "1"
Const STYLE_STRETCHED As String = "2"
Const TILE_NO As String = "0"
Const TILE_YES As String = "1"
Dim had_error As Boolean
' Set the display style.
had_error = False
Select Case cboStyle.Text
Case "Centered"
If SetRegistryValue(HKEY_CURRENT_USER, _
"Control Panel\Desktop", "TileWallpaper", _
TILE_NO) _
Then had_error = True
If SetRegistryValue(HKEY_CURRENT_USER, _
"Control Panel\Desktop", "WallpaperStyle", _
STYLE_CENTERED) _
Then had_error = True
Case "Tiled"
If SetRegistryValue(HKEY_CURRENT_USER, _
"Control Panel\Desktop", "TileWallpaper", _
TILE_YES) _
Then had_error = True
If SetRegistryValue(HKEY_CURRENT_USER, _
"Control Panel\Desktop", "WallpaperStyle", _
STYLE_TILED) _
Then had_error = True
Case "Stretched"
If SetRegistryValue(HKEY_CURRENT_USER, _
"Control Panel\Desktop", "TileWallpaper", _
TILE_NO) _
Then had_error = True
If SetRegistryValue(HKEY_CURRENT_USER, _
"Control Panel\Desktop", "WallpaperStyle", _
STYLE_STRETCHED) _
Then had_error = True
End Select
If had_error Then
MsgBox "Error saving desktop style to registry.", _
vbOKOnly, "Registry Error"
End If
' Display the file.
FileLabel.Caption = file_name
m_CurrentFile = DirName & "\" & file_name
If UCase$(Right$(file_name, 4)) = ".BMP" Then
SystemParametersInfo SPI_SETDESKWALLPAPER, _
0, m_CurrentFile, SPIF_UPDATEINIFILE
Else
HiddenPict.Picture = LoadPicture(m_CurrentFile)
SavePicture HiddenPict.Picture, DirName & _
"\temp.bmp"
SystemParametersInfo SPI_SETDESKWALLPAPER, _
0, DirName & "\temp.bmp", _
SPIF_UPDATEINIFILE
End If
End Sub
当您点击编辑按钮时,程序使用ShellExecute API函数来编辑当前图片文件。
Private Sub cmdEdit_Click()
ShellExecute ByVal 0&, "edit", m_CurrentFile, _
vbNullString, vbNullString, SW_SHOWMAXIMIZED
End Sub
当您单击“删除”按钮时,程序会调用子例程 DeleteFile 将文件移入废纸篓。然后它会显示下一张图片。
Private Sub cmdDelete_Click()
' Delete the file.
DeleteFile m_CurrentFile, False
' Display the next file.
cmdNext_Click
End Sub
子例程 DeleteFile 使用 SHFileOperation API 函数将文件移动到废纸篓,可选择要求用户确认。
Public Sub DeleteFile(ByVal file_name As String, ByVal _
user_confirm As Boolean)
Dim op As SHFILEOPSTRUCT
With op
.wFunc = FO_DELETE
.pFrom = file_name
If user_confirm Then
' Make the user confirm.
.fFlags = FOF_ALLOWUNDO
Else
' Do not make the user confirm.
.fFlags = FOF_ALLOWUNDO Or FOF_NOCONFIRMATION
End If
End With
SHFileOperation op
End Sub
取自here
关于java - 通过链接更新桌面背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11719160/
这显然有可能导致一场激烈的 war ,但无论如何,我试一试……(目前)还没有任何明确的答案。 在我的一台机器上,我确实被切换/升级到 Matlab 2012b。这是一个漂亮的新桌面,好吧。但出于很多原
当我的 Docker 容器启动时,我收到以下通知: Docker Desktop has detected that you shared a Windows file into a WSL 2 co
我希望能够(从服务器)连接到远程 PC 并能够访问其文件。我正在尝试使用 PHP 或 JavaScript 来完成此操作。 所以我想知道 1) 是否可能以及 2) 如何做到。 有人有任何示例/解决方案
我想使用 DirectX 为 Windows 7 制作动画桌面背景。我正在使用 C#、SlimDX 和几个 Windows API 函数的 P/Invoke 导入。我对 native Windows
是否可以为 Mac 开发动态桌面?我所说的“动态”是指其图像采用系统参数(例如时间和作业信息)并使用此信息来更新图像的桌面。有关图像状态的信息也将在 session 之间保留。我不是在谈论电影或随机但
我正在 LibGDX 中构建一个仅限桌面的应用程序。该游戏内置了一个 map 编辑器,您可以切换到并更改游戏 map 。我想添加一个功能,如果用户单击关闭窗口并且有未保存的编辑,它会提示您是否要在关闭
有没有像样的Windows桌面JSON lines (JSONL)格式查看器? 这种格式也称为: 行分隔的 JSON (LDJSON) 换行符分隔的 JSON (NDJSON) 我正在寻找至少能够从
我有一个UITableView,它在单元格中显示大量图像,并且我对滚动性能并不满意。我的 UITableView 类似于 iPhone 上的照片应用程序。有谁知道为什么 iphone 照片应用程序滚动
let img1 = document.createElement('img'); img1.setAttribute('src', 'https://caniuse.com/img/browsers
我在同一窗体上有两个不同的网格控件。它们共享相同的上下文菜单。当我选择上下文菜单项时,我无法确定哪个控件是所有者。 最佳答案 ContextMenuStrip 类的 SourceControl 属性将
我已经安装了 Docker Desktop ( version : 2.3.0.4 ) 并启用了 Kubernetes . 我部署了几个 PODS,一切正常,从昨天开始,我遇到了下面提到的一个奇怪的问
我正在制作需要实现TableView的应用程序。 我想将背景图像应用到桌面 View 。 谁能帮我解决这个问题。我正在使用下面的代码来创建 TableView Titanium.UI.setBackg
我在同一窗体上有两个不同的网格控件。它们共享相同的上下文菜单。当我选择上下文菜单项时,我无法确定哪个控件是所有者。 最佳答案 ContextMenuStrip 类的 SourceControl 属性将
您能建议一些库在我的桌面 Java 应用程序中创建雷达图吗? 谢谢 最佳答案 似乎JFreeChart提供了SpiderWebPlot 。 images for which看起来像雷达图。 关于jav
这个问题已经有答案了: 已关闭10 年前。 Possible Duplicate: Not possible to launch a file on a network using Java Desk
就目前情况而言,这个问题不太适合我们的问答形式。我们希望答案得到事实、引用资料或专业知识的支持,但这个问题可能会引发辩论、争论、民意调查或扩展讨论。如果您觉得这个问题可以改进并可能重新开放,visit
我想知道是否可以(使用JAVA)识别用于发出请求的计算机类型,例如:服务器、台式机、PDA(平板电脑、手机等)? 谢谢! 最佳答案 取决于您使用什么来接受请求。对于 http 请求,信息位于请求 he
我添加了一个事件处理程序,用于滚动到我的桌面 View ,但它仅在我使用滚轮滚动时才起作用,但我也需要它在您单击并拖动滚动条时起作用。任何想法有什么问题吗?我尝试使用不同的方法来处理该事件,但没有一个
我想开始开发桌面 Java 应用程序,并且我想知道 Java 社区使用什么。 我从 Swing 开始,但发现它非常初级。 我习惯于在 Visual Studio 2010 中使用 .net c# WP
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 要求我们推荐或查找工具、库或最喜欢的场外资源的问题对于 Stack Overflow 来说是偏离主题的,
我是一名优秀的程序员,十分优秀!