如何使“显示/隐藏桌面图标”设置生效? [英] How do I make the "show/hide desktop icons" setting take effect?

查看:682
本文介绍了如何使“显示/隐藏桌面图标”设置生效?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面的代码调用SHGetSetSettings函数来隐藏桌面图标
,但它只是从视图菜单中取消选中显示桌面图标。

The code below calls SHGetSetSettings function to hide desktop icons but it just unchecked "Show desktop icons" from the view menu.

我打电话给code> SHChangeNotify(SHCNE_ASSOCCHANGED,SHCNF_FLUSHNOWAIT,nil,nil);
更新桌面但不起作用?

I called SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_FLUSHNOWAIT, nil, nil); to update the desktop but that doesn't work?

var
lpss: SHELLSTATE;
begin
  lpss.Data := High(cardinal);
  lpss.Data2 := Low(cardinal);
  SHGetSetSettings(lpss,SSF_HIDEICONS,true);
  SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_FLUSHNOWAIT, nil, nil);
end;


推荐答案

isa,刷新桌面可以发送F5 progman (程序管理器)窗口的关键

isa, to refresh the desktop you can send the F5 key to the progman (Program Manager) window

PostMessage(FindWindow('Progman', nil), WM_KEYDOWN, VK_F5, 3);

隐藏桌面图标的另一种方法是

another alternative to hide the desktop icons is

ShowWindow(FindWindow('Progman', nil),SW_HIDE); //hide the icons desktop and refresh the screen

再次显示

ShowWindow(FindWindow('Progman', nil),SW_SHOW); //show the icons of the desktop and refresh

这篇关于如何使“显示/隐藏桌面图标”设置生效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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