2017-11-29 17 views
3

WPF 이벤트 발생 후 워크 스테이션 잠금을 자동화하려고합니다. 이 솔루션은 x64 및 x86 아키텍처 모두에서 작동해야합니다.WPF 잠금 워크 스테이션 프로그래밍 방식으로

나는() 접근 USER32.DLL을 통해 방법 LockWorkStation을 시도했지만 그것은 단지 x86 아키텍처에서 작동합니다. 두 아키텍처 모두에서 작동하도록하는 대안 또는 특정 구성이 있습니까? LWin + L 단축키를 보내 겠지만 SendKeys.Send 메서드는 WPF에서 사용할 수없는 것 같습니다. 내 win10의 64에

답변

4
string winDir = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Windows); 
string exec = [email protected]"{winDir}\System32\rundll32.exe"; 
string command = "user32.dll,LockWorkStation"; 

System.Diagnostics.Process.Start(exec, command); 

작품

enter image description here