태그 보관물: windows

windows

Windows 바탕 화면 배경을 강제로 업데이트하거나 새로 고치는 방법 이미지를 수동으로 변경하는 경우 로그

레지스트리에서 배경 이미지를 수동으로 변경하는 경우 로그 오프하지 않고 강제로 새로 고치려면 어떻게해야합니까?

나는 bginfo 가 그것을 한다는 것을 알고 있지만, 물건을 단순하게 유지하고 소프트웨어를 사용하고 싶지 않습니다.



답변

RUNDLL32.EXE USER32.DLL,UpdatePerUserSystemParameters 1, True

답변

  • 작업 관리자 열기
  • explorer.exe를 죽이십시오
  • 쉘이 즉시 다시 시작되지 않으면
  • 메뉴에서 파일> 새 작업을 선택하십시오.
  • “explorer.exe”를 입력하고 Enter 키를 누르십시오.

답변

시작 메뉴의 레지스트리 설정을 업데이트 한 다음 시작 메뉴에 변경 사항이 반영되도록 유사한 작업을 수행하려고했습니다.

이 MSDN 질문의 솔루션은 저에게 완벽하게 효과적이었습니다.

WM_SETTINGCHANGE메시지를 방송 할 수 있습니다. 예를 들면 다음과 같습니다.

class Program
{
    [DllImport("user32.dll", SetLastError = true)]
    private static extern IntPtr SendMessageTimeout(IntPtr hWnd, int Msg, IntPtr wParam, string lParam, uint fuFlags, uint uTimeout, IntPtr lpdwResult);

    private static readonly IntPtr HWND_BROADCAST = new IntPtr(0xffff);
    private const int WM_SETTINGCHANGE = 0x1a;
    private const int SMTO_ABORTIFHUNG = 0x0002;

    static void Main(string[] args)
    {
        SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, IntPtr.Zero, null, SMTO_ABORTIFHUNG, 100, IntPtr.Zero);
    }
}

답변

화면 해상도를 변경 한 다음 되돌리기 옵션을 선택하십시오. 해상도가 동일하게 유지되고 배경이 변경됩니다.

또는 디스플레이 케이블을 분리했다가 다시 연결하십시오.


답변

# first in powershell, second both. cmd.exe + powershell.exe

# Refresh Desktop Ability
$definition = @'
    [System.Runtime.InteropServices.DllImport("Shell32.dll")]
    private static extern int SHChangeNotify(int eventId, int flags, IntPtr item1, IntPtr item2);
    public static void Refresh() {
        SHChangeNotify(0x8000000, 0x1000, IntPtr.Zero, IntPtr.Zero);
    }
'@
Add-Type -MemberDefinition $definition -Namespace WinAPI -Name Explorer

# Set Safe within deleted days and get physical drive letters
$ignoreDeletedWithinDays = 2
$drives = (gwmi -Class Win32_LogicalDisk | ? {$_.drivetype -eq 3}).deviceid

# Process discovered drives
$drives | % {$drive = $_
    gci -Path ($drive+'\$Recycle.Bin\*\$I*') -Recurse -Force | ? {($_.LastWriteTime -lt [datetime]::Now.AddDays(-$ignoreDeletedWithinDays)) -and ($_.name -like "`$*.*")} | % {

        # Just a few calcs
        $infoFile         = $_
        $originalFile     = gi ($drive+"\`$Recycle.Bin\*\`$R$($infoFile.Name.Substring(2))") -Force
        $originalLocation = [regex]::match([string](gc $infoFile.FullName -Force -Encoding Unicode),($drive+'[^<>:"/|?*]+\.[\w\-_\+]+')).Value
        $deletedDate      = $infoFile.LastWriteTime
        $sid              = $infoFile.FullName.split('\') | ? {$_ -like "S-1-5*"}
        $user             = try{(gpv "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\ProfileList\$($sid)" -Name ProfileImagePath).replace("$(gpv 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion\ProfileList' -Name ProfilesDirectory)\",'')}catch{$Sid}

        #' Various info
        $originalLocation
        $deletedDate
        $user
        $sid
        $infoFile.Fullname
        ((gi $infoFile -force).length / 1mb).ToString('0.00MB')
        $originalFile.fullname
        ((gi $originalFile -force).length / 1mb).ToString('0.00MB')
        ""

        # Blow it all Away
        #ri $InfoFile -Recurse -Force -Confirm:$false -WhatIf
        #ri $OriginalFile -Recurse -Force -Confirm:$false- WhatIf
        # remove comment before two lines above and the '-WhatIf' statement to delete files
    }
}

# Refresh desktop icons
[WinAPI.Explorer]::Refresh()

or

ie4uinit.exe -ClearIconCache

end scripting enjoy.
#end

답변

받아 들여진 대답의 선은 매우 산발적으로 나를 위해 일했습니다. 백그라운드에서 코드를 자동으로 25 번 호출하기 위해 while 루프를 작성했습니다. 도움이 되었기를 바랍니다.

허용 된 답변의 코드 :

RUNDLL32.EXE USER32.DLL,UpdatePerUserSystemParameters 1, True

내 bash 스크립트 상단의 코드 :

desktop () {

i=0

# Tell the desktop to refresh 25 times.
while [ $i -le 25 ]
do
  echo "RUNDLL32.EXE USER32.DLL,UpdatePerUserSystemParameters, 1 True"| "C:/Windows/System32/WindowsPowerShell/v1.0/powershell"
  ((i++))
done

}


# This runs the function silently as a background process
desktop &>/dev/null &

답변