MCPcopy Create free account
hub / github.com/xpf0000/FlyEnv / buildNotifyEnvironmentChangedScript

Function buildNotifyEnvironmentChangedScript

src/shared/WindowsHelperFallback.ts:442–457  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

440}
441
442function buildNotifyEnvironmentChangedScript(): string {
443 return `Add-Type -Namespace FlyEnvFallback -Name NativeMethods -MemberDefinition @'
444[System.Runtime.InteropServices.DllImport("user32.dll", CharSet = System.Runtime.InteropServices.CharSet.Unicode, SetLastError = true)]
445public static extern System.IntPtr SendMessageTimeout(System.IntPtr hWnd, uint Msg, System.UIntPtr wParam, string lParam, uint fuFlags, uint uTimeout, out System.UIntPtr lpdwResult);
446'@
447$notifyResult = [System.UIntPtr]::Zero
448[FlyEnvFallback.NativeMethods]::SendMessageTimeout(
449 [System.IntPtr]0xffff,
450 0x001A,
451 [System.UIntPtr]::Zero,
452 'Environment',
453 0x0002,
454 5000,
455 [ref]$notifyResult
456) | Out-Null`
457}
458
459function validateWriteFileArgs(args: unknown[]): ValidatedWriteFileArgs {
460 ensureArgCount(args, 2, 'writeFileByRoot')

Callers 2

buildSetSystemPathScriptFunction · 0.85
buildSetSystemEnvScriptFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected