得到windows聚焦图片(windows 10)
有些Windows聚焦图片确实很漂亮,很希望保留下来,但是Windows聚焦图片总更好,网上有得到聚焦图片的方法,每次都手动去弄真麻烦,于是自己编了一个小程序,自动得到Windows聚焦图片,下面是运行这个小程序得到Windows聚焦图片的效果!
小工具以及源码下载:http://download.csdn.net/detail/sunylat/9741756
解压缩下载文件后,小工具在解压缩后的文件夹中:“Win32\Debug”,文件名:“Project1.exe”。
运行效果截图:

我用这个小工具保存下来的Windows聚焦图片:

全部源码:
unit Unit1; interface uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls; type
TForm2 = class(TForm)
Panel1: TPanel;
Panel2: TPanel;
clearLogBtn: TButton;
logMemo: TMemo;
Splitter1: TSplitter;
Panel3: TPanel;
Button2: TButton;
procedure clearLogBtnClick(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations } // 得到特殊目录
function GetSpecialDir(SpecialDirID: Integer): string; // 得到用户目录
function GetAppdataLocal: string; //重命名所有文件扩展名
procedure Rename(filePath: string); public
{ Public declarations }
procedure MyLog(tempLog: string); // log方法
end; var
Form2: TForm2; logInfo: string; // log信息 implementation {$R *.dfm} uses
ShlObj, {GetSpecialDir用单元}
System.IOUtils,
shellapi; procedure TForm2.Button2Click(Sender: TObject);
const
pictureDir =
'\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets';
var
picturePath: string;
pictureTempPath: string;
begin //windows聚焦图片存放目录
picturePath := self.GetAppdataLocal + pictureDir; //存放得到图片的目录
pictureTempPath := ExtractFilePath(paramstr()) + 'picture'; //删除先前处理图片的目录
if TDirectory.Exists(pictureTempPath) = true then
begin
TDirectory.Delete(pictureTempPath,true);
end;
//拷贝windows聚焦图片到临时目录
TDirectory.Copy(picturePath, pictureTempPath); //如果临时存放图片目录不为空,则继续处理
if TDirectory.IsEmpty(pictureTempPath) = false then
begin
//重命名所有文件为扩展名是"jpg"的图片类型文件
self.Rename(pictureTempPath); //打开存放图片目录
ShellExecute(Handle, 'open', 'Explorer.exe', PChar(pictureTempPath), nil,
SW_NORMAL);
end; end; procedure TForm2.clearLogBtnClick(Sender: TObject);
begin
logMemo.Clear;
end; procedure TForm2.FormCreate(Sender: TObject);
begin end; // log方法
procedure TForm2.MyLog(tempLog: string);
var
temp: string;
oldLog: string;
begin
if Trim(tempLog) <> '' then
begin oldLog := Trim(logMemo.Text);
logMemo.Clear; temp := FormatDateTime('yyyy-mm-dd hh:mm:ss', now) + ' ' + Trim(tempLog);
if oldLog = '' then
begin
logMemo.Lines.Add(temp);
logMemo.Lines.Add('');
end
else
begin
logMemo.Lines.Add(temp);
logMemo.Lines.Add('');
logMemo.Lines.Add(oldLog);
end; end; end; // 得到特殊目录
function TForm2.GetSpecialDir(SpecialDirID: Integer): string;
var
pidl: PItemIDList;
Path: array [ .. MAX_PATH] of Char;
begin
SHGetSpecialFolderLocation(, SpecialDirID, pidl);
SHGetPathFromIDList(pidl, Path);
Result := Path;
end; // 得到用户目录
function TForm2.GetAppdataLocal: string;
begin
Result := GetSpecialDir(CSIDL_LOCAL_APPDATA);
end; procedure TForm2.Rename(filePath: string);
const
batFile = 'tmp.cmd'; // 保存各种要执行命令的bat文件名
var
tempList: TStringList;
begin try // 进入当前目录
ChDir(filePath); tempList := TStringList.Create;
with tempList do
begin
Add('ren *.* *.jpg');
Add('del ' + batFile);
SaveToFile(batFile); SaveToFile(batFile);
end; finally tempList.Free; // 执行bat文件
WinExec(batFile, SW_HIDE);
end; end; end.
参考:http://www.iplaysoft.com/save-win10-spotlight-wallpapers.html
得到windows聚焦图片(windows 10)的更多相关文章
- 使用 Python 获取 Windows 聚焦图片
Windows 聚焦图片会定期更新,拿来做壁纸不错,它的目录是: %localappdata%\Packages\Microsoft.Windows.ContentDeliveryManager_cw ...
- windows聚焦图片文件重命名bash脚本
win10聚焦路径为: %localappdata%\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalStat ...
- Windows聚焦转为图片
1.windows聚焦图片目录路径: C:\Users\Er\AppData\Local\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1 ...
- 如何获得Windows聚焦壁纸0726
Windows聚焦壁纸缓存位置,绿色部分是你的用户名: (1)找到之后,一般是大于100K的 (2)将图片复制到另一个文件夹img,要用到路径 (3)在改文件夹下新建一个txt; txt文档里写:re ...
- Windows 聚焦的锁屏壁纸设置为桌面壁纸
需求: Windows的锁屏壁纸偶尔遇到非常喜欢的壁纸,想设置为桌面壁纸. 步骤如下: 1. “Windows 聚焦”的锁屏壁纸都保存在隐藏文件夹 --- Assets里. a. 打开“资源管理器 b ...
- Windows聚焦失效问题的解决办法
1. 设置Windows聚焦 步骤:任务栏右键 → 任务栏设置 → 锁屏界面 → 背景选择Windows聚焦 2. 解决Windows聚焦失效问题 设置完Windows聚焦之后,锁屏界面却没有变. 尝 ...
- Windows Phone开发(10):常用控件(上)
原文:Windows Phone开发(10):常用控件(上) Windows Phone的控件有几个来源,和传统的桌面应用程序开发或Web开发一样,有默认提供的控件和第三方开者发布的控件.一般而言,如 ...
- 重新想象 Windows 8 Store Apps (10) - 控件之 ScrollViewer 特性: Chaining, Rail, Inertia, Snap, Zoom
原文:重新想象 Windows 8 Store Apps (10) - 控件之 ScrollViewer 特性: Chaining, Rail, Inertia, Snap, Zoom [源码下载] ...
- 使用“万能数据库查询分析器”的Windows 7、Windows 8、Windows 10的用户须知
与以前的Windows操作系统版本(包括WinXP/VISTA/Windows2000/WindowsNt/Win98)不同,Windows 7.Windows 8.Windows 10短日期采用的分 ...
随机推荐
- No serializer found for class org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer解决方法
org.codehaus.jackson.map.JsonMappingException: No serializer found for class org.hibernate.proxy.poj ...
- iOS学习之Xcode 的Debug技巧
在Xcode中,Debug时,不能像eclipse ,或VS那些集成开发那样,能直接查看变量的值.那怎么在调试的时候查看XCode的变量呢? 有一些方法的. 1.新建一个Single View App ...
- [iOS]隐藏导航栏把右滑退出操作保留
项目因为用到上面导航栏样式多变,就隐藏了导航栏自己用View代替了,但手势却不见了,后来发现问题解决.操作如下: 千万不要取消 Shows Navigation Bar 这个选项否则手势会消失 应该是 ...
- 新手C#ListView使用记录2018.08.03
在使用C#的ListView时,感觉有一些部分需要自己注意. ListView1.Clear()这条指令在使用时,用于Click后在ListView中显示数据,应该放在输入数据的前面. 在ListVi ...
- java算法 蓝桥杯 摆花
问题描述 小明的花店新开张,为了吸引顾客,他想在花店的门口摆上一排花,共m盆.通过调查顾客的喜好,小明列出了顾客最喜欢的n种花,从1到n标号.为了在门口展出更多种花,规定第i种花不能超过ai盆,摆花时 ...
- Spring中Aspect的切入点的表达式定义细节
用过很多次切面aspect了,对于表达式总是记得很模糊,今天总结一下. 1.切面做如下设置则只会拦截返回值为String类型的方法 @Aspect public class MyInterceptor ...
- Hibernate多对多操作
---------------------siwuxie095 Hibernate 多对多操作 以用户和角色为例 (一)多对多映射配置 第一步:创建两个实体类,用户和角色 第二步:让两个实体类之间互相 ...
- Opencv 发现轮廓 findContours
vector<vector<Point>> vec_p; vector<Vec4i> vec_4f; findContours(img_canny1, vec_p, ...
- Linux下Maven的安装与使用
pache Maven,是一个软件(特别是Java软件)项目管理及自动构建工具,由Apache软件基金会所提供.基于项目对象模型(POM)概念,Maven利 用一个中央信息片断能管理一个项目的构建.报 ...
- spring之IOC容器创建对象
1.术语了解 1.1组件/框架设计 侵入式设计 引入了框架,对现有的类的结构有影响:即需要实现或继承某些特定类. 例如: Struts框架非侵入式设计 引入了框架,对现有的类结构没有影响. 例如:Hi ...