{"id":352978,"date":"2024-05-20T22:18:56","date_gmt":"2024-05-20T22:18:56","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=352978"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=352978","title":{"rendered":"<span>\u0421\u043a\u0432\u043e\u0437\u044c \u043f\u043e\u043a\u0440\u044b\u0442\u044b\u0435 \u0442\u0430\u0439\u043d\u043e\u0439 \u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 \u043a\u043e\u0434\u0430: \u041a\u0430\u043a \u044f \u043e\u0436\u0438\u0432\u0438\u043b \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u0441\u0442\u043e\u043b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e P\/Invoke ?<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0423 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0438 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0435 \u0440\u0430\u0434\u043e\u0441\u0442\u0438, \u0434\u0430\u0436\u0435 \u043d\u0430 \u0444\u043e\u043d\u0435 \u0441\u0435\u0440\u043e\u0439 \u0440\u0443\u0442\u0438\u043d\u044b. \u0414\u043b\u044f \u043c\u0435\u043d\u044f, \u043a\u0430\u043a \u0434\u043b\u044f \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e \u0441\u043c\u0435\u0440\u0442\u043d\u043e\u0433\u043e, \u044d\u0442\u043e \u0431\u044b\u043b \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0444\u043e\u043d \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u0441\u0442\u043e\u043b\u0430 \u0432 Windows. \u041d\u043e, \u043a\u0430\u043a \u044d\u0442\u043e \u0431\u044b\u0432\u0430\u0435\u0442, \u043e\u0434\u043d\u0430\u0436\u0434\u044b \u043c\u043e\u044f \u0436\u0438\u0437\u043d\u044c \u043f\u043e\u0448\u043b\u0430 \u043f\u043e \u043d\u043e\u0432\u043e\u043c\u0443 \u043f\u0443\u0442\u0438, \u0438 \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u0447\u0443\u0434\u0435\u0441\u043d\u0435\u0439\u0448\u0435\u0439 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043b\u043e\u0432\u043d\u043e \u043f\u0440\u043e\u043d\u0438\u043a\u043b\u0430 \u0432 \u043c\u043e\u044e \u0434\u0443\u0448\u0443. \u041e\u043d\u0430 \u0441\u0442\u0430\u043b\u0430 \u043c\u043e\u0438\u043c \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u0435\u043d\u0438\u0435\u043c, \u043c\u043e\u0438\u043c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u043c \u043e\u0441\u0442\u0440\u043e\u0432\u043a\u043e\u043c \u0440\u0430\u0434\u0443\u0433\u0438 \u0432 \u043c\u043e\u0440\u0435 \u043f\u043e\u0432\u0441\u0435\u0434\u043d\u0435\u0432\u043d\u043e\u0439 \u0441\u043a\u0443\u043a\u0438. \u0418, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u044d\u0442\u043e \u0431\u044b\u043b\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430&#8230; \u043d\u0443, \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0435\u0433\u043e \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0430.<\/p>\n<p>\u0421\u0440\u0430\u0437\u0443 \u0436\u0435 \u0432 \u043c\u043e\u0435\u0439 \u0433\u043e\u043b\u043e\u0432\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0438\u0434\u0435\u044f: &#171;\u041f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043d\u0435 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u0443 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u043d\u0430 \u0444\u043e\u043d \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u0441\u0442\u043e\u043b\u0430?&#187;. \u0412\u0435\u0434\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0433\u043e\u0440\u044f\u0447\u0438\u0435 \u043a\u043b\u0430\u0432\u0438\u0448\u0438, \u043f\u0440\u0430\u0432\u0434\u0430? \u041d\u043e \u0432\u043e\u0442 \u0431\u0435\u0434\u0430 \u2013 \u043e\u0436\u0438\u0434\u0430\u0435\u0442\u0441\u044f \u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u043d\u0435\u0433\u043e\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u0432\u0437\u0433\u043b\u044f\u0434\u044b \u0443\u043a\u043e\u0440\u0438\u0437\u043d\u044b. \u0421\u043a\u0432\u043e\u0437\u044c \u0441\u0442\u0440\u0430\u0445\u0438 \u0438 \u0441\u043e\u043c\u043d\u0435\u043d\u0438\u044f \u0440\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u043d\u0435\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u0430\u044f \u0438\u0434\u0435\u044f: \u044f \u043d\u0430\u043f\u0438\u0448\u0443 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u0444\u043e\u043d \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u0441\u0442\u043e\u043b\u0430 \u043f\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u044e \u0433\u043e\u0440\u044f\u0447\u0438\u0445 \u043a\u043b\u0430\u0432\u0438\u0448! \u0414\u0430, \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a, \u0443\u0432\u0430\u0436\u0430\u0435\u043c\u044b\u0435 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438, \u044f \u0440\u0435\u0448\u0438\u043b \u0441\u043c\u0435\u043b\u043e \u043f\u043e\u0442\u0440\u044f\u0441\u0442\u0438 \u043c\u0438\u0440 \u0441\u0432\u043e\u0438\u043c \u0432\u044b\u0431\u043e\u0440\u043e\u043c \u043e\u0431\u043e\u0435\u0432.<\/p>\n<p>\u0418 \u0432\u043e\u0442, \u0432\u043d\u0435\u0437\u0430\u043f\u043d\u043e, \u043d\u0430 \u0441\u0446\u0435\u043d\u0435 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u0448 \u0433\u0435\u0440\u043e\u0439 \u2013 <strong>P\/Invoke<\/strong>! \u0415\u0441\u043b\u0438 \u0432\u044b, \u043a\u0430\u043a \u0438 \u044f, \u043d\u0435 \u0431\u044b\u043b\u0438 \u0432 \u043b\u0430\u0434\u0430\u0445 \u0441 C\/C++, \u043d\u0435 \u043e\u0442\u0447\u0430\u0438\u0432\u0430\u0439\u0442\u0435\u0441\u044c \u2013 P\/Invoke \u0441\u0442\u043e\u0438\u0442 \u043d\u0430 \u0441\u0442\u0440\u0430\u0436\u0435 \u0432\u0430\u0448\u0438\u0445 \u0438\u043d\u043d\u043e\u0432\u0430\u0446\u0438\u0439. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0443 \u043c\u0435\u043d\u044f \u043d\u0435 \u0431\u044b\u043b\u043e \u043d\u0438 \u043c\u0430\u043b\u0435\u0439\u0448\u0435\u0433\u043e \u043f\u043e\u043d\u044f\u0442\u0438\u044f \u043e C\/C++, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u043e \u043c\u0435\u043d\u044f. \u0421\u0438\u043b\u0430 P\/Invoke \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u0430\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0437 \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0442\u0430\u043a, \u0431\u0443\u0434\u0442\u043e \u043e\u043d\u0438 \u0431\u044b\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u043d\u0430 \u0447\u0438\u0441\u0442\u043e\u043c C#. \u0412\u043e\u0442 \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442:<\/p>\n<h4>\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0433\u043e\u0440\u044f\u0447\u0438\u0445 \u043a\u043b\u0430\u0432\u0438\u0448<\/h4>\n<p>\u041c\u044b \u043d\u0430\u0446\u0435\u043b\u0438\u043b\u0438\u0441\u044c \u043d\u0430 \u0434\u0432\u0435 \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438 \u043a\u043b\u0430\u0432\u0438\u0448: \u043e\u0434\u043d\u0443 \u0434\u043b\u044f \u044d\u0440\u043e\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0444\u043e\u043d\u0430 (\u0434\u0430-\u0434\u0430, \u044f \u0442\u0430\u043a \u0438 \u043d\u0430\u0437\u0432\u0430\u043b) \u0438 \u0434\u0440\u0443\u0433\u0443\u044e \u0434\u043b\u044f \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e. \u0418\u0442\u0430\u043a, <a href=\"https:\/\/learn.microsoft.com\/ru-ru\/windows\/win32\/api\/winuser\/nf-winuser-registerhotkey?redirectedfrom=MSDN\" rel=\"noopener noreferrer nofollow\"><strong>RegisterHotKey <\/strong><\/a>\u0438\u0437 &#171;user32.dll&#187; \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0430\u0448\u0438\u043c \u0432\u0435\u0440\u043d\u044b\u043c \u0441\u043f\u0443\u0442\u043d\u0438\u043a\u043e\u043c:  <\/p>\n<pre><code class=\"cs\">[DllImport(\"user32.dll\")] public static extern bool RegisterHotKey(IntPtr hWnd, int id, uint fsModifiers, uint vk);  \/\/ \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0434\u043b\u044f \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043a\u043b\u0430\u0432\u0438\u0448. public const int MOD_ALT = 0x0001; public const int MOD_CONTROL = 0x0002; public const int MOD_SHIFT = 0x0004;  \/\/ \u0417\u0430\u043a\u043b\u0438\u043d\u0430\u043d\u0438\u044f \u0432 \u0432\u0438\u0434\u0435 \u043a\u043b\u0430\u0432\u0438\u0448. \u041d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043c\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438 \"B\" \u0438 \"C\". public const int VK_B = 0x42; public const int VK_C = 0x43;  \/\/ \u0420\u0438\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u0437\u0430\u043a\u043b\u0438\u043d\u0430\u043d\u0438\u0439. \u041d\u0430\u0448\u0438 \u0447\u0438\u0441\u043b\u0430 \u0438\u043c\u0435\u044e\u0442 \u043e\u0441\u043e\u0431\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. public const int WallpaperErroticCommand = 11; \/\/ \u041f\u043e\u0440\u0430 \u043f\u0440\u0438\u0437\u0432\u0430\u0442\u044c \u044d\u0440\u043e\u0442\u0438\u043a\u0443! public const int WallpaperNormalCommand = 12; \/\/ \u0410 \u0437\u0434\u0435\u0441\u044c - \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u043e\u0431\u043e\u0438.  if (RegisterHotKey(IntPtr.Zero, WallpaperErroticCommand, MOD_ALT | MOD_CONTROL, VK_B)     &amp;&amp; RegisterHotKey(IntPtr.Zero, WallpaperNormalCommand, MOD_SHIFT, VK_C)) {     Console.WriteLine(\"\u0413\u043e\u0440\u044f\u0447\u0438\u0435 \u043a\u043b\u0430\u0432\u0438\u0448\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b. \u0412\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u0432\u043e\u043b\u0448\u0435\u0431\u0441\u0442\u0432\u0430!\");     Console.WriteLine(\"\u041d\u0430\u0436\u043c\u0438\u0442\u0435 Ctrl+Alt+B, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0433\u0440\u0443\u0437\u0438\u0442\u044c\u0441\u044f \u0432 \u043c\u0438\u0440 \u044d\u0440\u043e\u0442\u0438\u043a\u0438. \u042d\u0442\u043e \u043d\u0430\u0448 \u0441\u0435\u043a\u0440\u0435\u0442!\");     Console.WriteLine(\"\u041d\u0430\u0436\u043c\u0438\u0442\u0435 Shift+C, \u0447\u0442\u043e\u0431\u044b \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043a \u043e\u0431\u044b\u0447\u043d\u044b\u043c \u043e\u0431\u043e\u044f\u043c. \u041c\u0430\u0433\u0438\u044f \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0432\u0438\u0434\u0438\u043c\u043e\u0439.\"); } else {     Console.WriteLine(\"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0433\u043e\u0440\u044f\u0447\u0438\u0435 \u043a\u043b\u0430\u0432\u0438\u0448\u0438. \u041c\u0430\u0433\u0438\u044f \u0447\u0443\u0442\u044c \u043f\u043e\u0434\u0432\u0435\u043b\u0430 \u043d\u0430\u0441.\"); }<\/code><\/pre>\n<h4>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439<\/h4>\n<p>\u0418 \u0432\u043e\u0442 \u043e\u043d, \u0433\u0440\u044f\u0434\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442! \u041d\u0430\u0448 \u043a\u043e\u0434 \u0436\u0434\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u043a\u0442\u043e-\u0442\u043e \u043d\u0430\u0436\u043c\u0435\u0442 \u0433\u043e\u0440\u044f\u0447\u0438\u0435 \u043a\u043b\u0430\u0432\u0438\u0448\u0438. <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows\/win32\/api\/winuser\/nf-winuser-getmessage\" rel=\"noopener noreferrer nofollow\"><strong>GetMessage<\/strong><\/a>, \u0441\u043d\u043e\u0432\u0430 \u0438\u0437 &#171;user32.dll&#187;, \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0440\u043e\u043b\u0438 \u043f\u043e\u0447\u0442\u043e\u0432\u043e\u0433\u043e \u0433\u043e\u043b\u0443\u0431\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u043d\u043e\u0441\u0438\u0442 \u043d\u0430\u043c \u044d\u0442\u0438 \u0432\u0430\u0436\u043d\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f:  <\/p>\n<pre><code class=\"cs\">[DllImport(\"user32.dll\")] public static extern bool GetMessage(out MSG lpMsg, IntPtr hWnd, uint wMsgFilterMin, uint wMsgFilterMax);  public const int WM_HOTKEY = 0x0312;  MSG msg; while (GetMessage(out msg, IntPtr.Zero, 0, 0)) {     \/\/ \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u0438 \u0433\u043e\u0440\u044f\u0447\u0430\u044f \u043a\u043b\u0430\u0432\u0438\u0448\u0430 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u0442\u0441\u044f,      \/\/ \u043a\u043e\u0434 \u043e\u0449\u0443\u0449\u0430\u0435\u0442, \u0447\u0442\u043e \u0447\u0442\u043e-\u0442\u043e \u0432\u0430\u0436\u043d\u043e\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e. \u0412\u0441\u0435 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0442\u0430\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c\u0443 WM_HOTKEY,      \/\/ \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043a\u0430\u043a \u0431\u0443\u0434\u0442\u043e \u0448\u0435\u043f\u0447\u0435\u0442: \"\u0414\u0440\u0443\u0433 \u043c\u043e\u0439, \u043d\u0430\u0436\u0430\u0442\u0430 \u0433\u043e\u0440\u044f\u0447\u0430\u044f \u043a\u043b\u0430\u0432\u0438\u0448\u0430!\".     if (msg.message != WM_HOTKEY) continue;          \/\/ ... }<\/code><\/pre>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u043f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c, \u043a\u0430\u043a \u0437\u0430\u0436\u0435\u0447\u044c \u043e\u0433\u043e\u043d\u044c \u0444\u043e\u043d\u043e\u0432 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u0441\u0442\u043e\u043b\u0430, \u044f \u0432\u044b\u043d\u0443\u0436\u0434\u0435\u043d \u0431\u044b\u043b \u043f\u0440\u0438\u0437\u0432\u0430\u0442\u044c \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u0434\u0432\u0443\u0445 \u0432\u0435\u0440\u043d\u044b\u0445 \u0441\u043f\u0443\u0442\u043d\u0438\u043a\u043e\u0432 \u2013 <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows\/win32\/api\/winuser\/ns-winuser-msg\" rel=\"noopener noreferrer nofollow\"><strong>MSG<\/strong><\/a><strong> <\/strong>\u0438 <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows\/win32\/api\/windef\/ns-windef-point\" rel=\"noopener noreferrer nofollow\"><strong>POINT<\/strong><\/a>. <\/p>\n<pre><code class=\"cs\">\/\/ \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 MSG \u2013 \u044d\u0442\u043e \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u043f\u043e\u0441\u043b\u0430\u043d\u043d\u0438\u043a \u043c\u0435\u0436\u0434\u0443 \u043c\u0438\u0440\u0430\u043c\u0438. \/\/ \u041e\u043d\u0430 \u043f\u0440\u0438\u043d\u043e\u0441\u0438\u0442 \u0441 \u0441\u043e\u0431\u043e\u0439 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0432\u0430\u0436\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430 \u043d\u0438\u0445 \u0441\u0432\u043e\u0439 \u043e\u0442\u043f\u0435\u0447\u0430\u0442\u043e\u043a. [StructLayout(LayoutKind.Sequential)] public struct MSG {     public IntPtr hwnd;        \/\/ \u041e\u043a\u043d\u043e, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u043e\u043d\u0438\u043a\u0430\u044e\u0442 \u0442\u0430\u0439\u043d\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f.     public uint message;       \/\/ \u0421\u0435\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043a\u043e\u0434 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u043a\u0430\u043a \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0444\u043e\u0440\u043c\u0443\u043b\u0430.     public IntPtr wParam;      \/\/ \u0412\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0434\u043b\u044f \u0437\u0430\u043a\u043b\u0438\u043d\u0430\u043d\u0438\u0439.     public IntPtr lParam;      \/\/ \u0415\u0449\u0435 \u043e\u0434\u043d\u0430 \u0437\u0430\u0433\u0430\u0434\u043e\u0447\u043d\u0430\u044f \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0430\u044f.     public uint time;          \/\/ \u0412\u0440\u0435\u043c\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043c\u0430\u0433\u0438\u044f.     public POINT pt;           \/\/ \u0422\u043e\u0447\u043a\u0430, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0441\u0432\u043e\u0435 \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0443\u0442\u0435\u0448\u0435\u0441\u0442\u0432\u0438\u0435.     public uint lPrivate;      \/\/ \u0417\u0430\u0433\u0430\u0434\u043e\u0447\u043d\u043e\u0435 \u043b\u0438\u0447\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441\u044b.      \/\/ \u041c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0444\u043e\u0440\u043c\u0443\u043b\u0430, \u0440\u0430\u0441\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0430\u044f \u0441\u0443\u0442\u044c MSG.     public readonly override string ToString() =>         $\"hwnd: {hwnd}, message: {message}, wParam: {wParam}, lParam: {lParam}, time: {time}, pt: {pt}, lPrivate: {lPrivate}\"; }  \/\/ \u0410 \u0432\u043e\u0442 \u0438 \u043d\u0430\u0448 \u0434\u0440\u0443\u0433 POINT, \u0442\u043e\u0436\u0435 \u0441\u043e \u0441\u0432\u043e\u0438\u043c\u0438 \u0442\u0430\u0439\u043d\u0430\u043c\u0438. \/\/ \u041e\u043d \u0443\u043c\u0435\u0435\u0442 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u0441\u0430\u043c\u044b\u0435 \u0433\u043b\u0443\u0431\u043e\u043a\u0438\u0435 \u0441\u0435\u043a\u0440\u0435\u0442\u044b \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442. [StructLayout(LayoutKind.Sequential)] public struct POINT {     public int x;              \/\/ \u0421\u0435\u043a\u0440\u0435\u0442\u043d\u0430\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430 X, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u043c\u0430\u0433\u0438\u044f.     public int y;              \/\/ \u0418 Y, \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0437\u0430\u0433\u0430\u0434\u043e\u0447\u043d\u044b\u0439.      \/\/ \u0418\u043d\u0442\u0440\u0438\u0433\u0443\u044e\u0449\u0430\u044f \u0437\u0430\u0433\u0430\u0434\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e POINT \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0432 \u043d\u0430\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u043e.     public readonly override string ToString() =>         $\"x: {x}, y: {y}\"; }<\/code><\/pre>\n<h4>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043e\u0431\u043e\u0435\u0432<\/h4>\n<p>\u0414\u0430-\u0434\u0430, \u0441\u0430\u043c\u0430\u044f \u0432\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c! \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c, \u043a\u0430\u043a\u043e\u0439 \u0444\u043e\u043d \u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c, \u0438 <a href=\"https:\/\/%D0%94%D0%B0-%D0%B4%D0%B0,%20%D1%81%D0%B0%D0%BC%D0%B0%D1%8F%20%D0%B2%D0%BE%D0%BB%D0%BD%D0%B8%D1%82%D0%B5%D0%BB%D1%8C%D0%BD%D0%B0%D1%8F%20%D1%87%D0%B0%D1%81%D1%82%D1%8C!%20%D0%9E%D0%BF%D1%80%D0%B5%D0%B4%D0%B5%D0%BB%D1%8F%D0%B5%D0%BC,%20%D0%BA%D0%B0%D0%BA%D0%BE%D0%B9%20%D1%84%D0%BE%D0%BD%20%D1%81%D1%82%D0%BE%D0%B8%D1%82%20%D0%BF%D0%BE%D1%81%D1%82%D0%B0%D0%B2%D0%B8%D1%82%D1%8C,%20%D0%B8%20SystemParametersInfo%20%D0%B2%D0%BE%D0%B7%D0%B2%D1%80%D0%B0%D1%89%D0%B0%D0%B5%D1%82%20%D0%BD%D0%B0%D0%BC%20%D0%BF%D0%BE%D0%B1%D0%B5%D0%B4%D1%83%20%D0%B8%D0%BB%D0%B8%20%D0%BF%D0%B0%D1%82%D0%BE%D0%B2%D1%83%D1%8E%20%D1%81%D0%B8%D1%82%D1%83%D0%B0%D1%86%D0%B8%D1%8E:\" rel=\"noopener noreferrer nofollow\"><strong>SystemParametersInfo <\/strong><\/a>\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0430\u043c \u043f\u043e\u0431\u0435\u0434\u0443 \u0438\u043b\u0438 \u043f\u0430\u0442\u043e\u0432\u0443\u044e \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e:  <\/p>\n<pre><code class=\"cs\">[DllImport(\"user32.dll\", CharSet = CharSet.Auto)]     public static extern bool SystemParametersInfo(uint uiAction, uint uiParam, IntPtr pvParam, uint fWinIni);  \/\/ \u0413\u043e\u0442\u043e\u0432\u0438\u043c\u0441\u044f \u043a \u0432\u0435\u043b\u0438\u043a\u043e\u043c\u0443 \u0437\u0430\u043c\u0430\u0445\u0443 - \u0432\u044b\u0431\u043e\u0440\u0443 \u043e\u0431\u043e\u0435\u0432! var imagePath = msg.wParam switch {     WallpaperErroticCommand => WallpaperErroticPath,     WallpaperNormalCommand => WallpaperNormalPath,     _ => throw new InvalidOperationException($\"\u041d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b {nameof(msg.wParam)}:{msg.wParam}\") };  \/\/ \u041f\u043e\u0434\u043d\u0438\u043c\u0430\u0435\u043c \u043f\u0443\u0442\u0435\u0432\u043e\u0434\u043d\u044b\u0439 \u0444\u0430\u043a\u0435\u043b - \u0430\u0434\u0440\u0435\u0441 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f! var imagePtr = Marshal.StringToHGlobalUni(imagePath);  \/\/ \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0432\u043e\u0440\u043e\u0442\u0430 \u0432 \u043c\u0438\u0440 \u0444\u0430\u043d\u0442\u0430\u0437\u0438\u0439 - \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043e\u0431\u043e\u0435\u0432! if (!SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, imagePtr, 0)) {     Console.WriteLine(\"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0444\u043e\u043d \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u0441\u0442\u043e\u043b\u0430. \u0416\u0438\u0437\u043d\u044c \u043d\u0435 \u043f\u043e \u0434\u0435\u0442\u0441\u043a\u0438 \u0441\u043b\u043e\u0436\u043d\u0430, \u0432\u0435\u0440\u043d\u043e?\"); } else {     Console.WriteLine(\"\u0424\u043e\u043d \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d. \u041f\u043e\u043c\u043d\u0438\u0442\u0435, \u043e\u0431\u043e\u0438 \u2013 \u044d\u0442\u043e \u0432\u0430\u0448\u0435 \u0437\u0435\u0440\u043a\u0430\u043b\u043e \u0432 \u043c\u0438\u0440!\"); }  \/\/ \u041e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0430\u0435\u043c \u043c\u0435\u0441\u0442\u043e \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u0438\u0434\u0435\u0439 - \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438! Marshal.FreeHGlobal(imagePtr); <\/code><\/pre>\n<h2>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/h2>\n<p>\u0418 \u0432\u043e\u0442, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u043d\u0430\u0441\u0442\u0443\u043f\u0438\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u044c \u0437\u0430\u0432\u0435\u0441\u0443 \u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u0445 \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0432\u043e\u0437\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439!  <\/p>\n<p>\u0414\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u044f Ctrl+Alt+B:  <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/499\/b3f\/f78\/499b3ff7829f32ee30bf9ef0ec0e5ac4.png\" alt=\"\" title=\"\" width=\"1920\" height=\"1080\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/499\/b3f\/f78\/499b3ff7829f32ee30bf9ef0ec0e5ac4.png\"\/><\/figure>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043d\u0430\u0436\u0430\u0442\u0438\u0435 Ctrl+Alt+B<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/53d\/7d8\/636\/53d7d86367db101bec880c709c036af7.png\" width=\"1920\" height=\"1080\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/53d\/7d8\/636\/53d7d86367db101bec880c709c036af7.png\"\/><\/figure>\n<p>\u0418 \u0442\u0430\u043a, \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u044c\u0442\u0435\u0441\u044c \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0433\u043b\u0430\u0432\u0435 \u043c\u043e\u0435\u0439 \u0438\u0441\u0442\u043e\u0440\u0438\u0438.  \u041d\u0430\u0436\u0438\u043c\u0430\u044e Shift+C:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/499\/b3f\/f78\/499b3ff7829f32ee30bf9ef0ec0e5ac4.png\" alt=\"\" title=\"\" width=\"1920\" height=\"1080\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/499\/b3f\/f78\/499b3ff7829f32ee30bf9ef0ec0e5ac4.png\"\/><\/figure>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435, \u043a\u0430\u043a \u0431\u0443\u0434\u0442\u043e \u043c\u0438\u0440 \u0432\u043e\u043a\u0440\u0443\u0433 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0441 \u043a\u0430\u0436\u0434\u044b\u043c \u043d\u0430\u0436\u0430\u0442\u0438\u0435\u043c \u043a\u043b\u0430\u0432\u0438\u0448\u0438, \u043a\u0430\u043a \u0431\u0443\u0434\u0442\u043e \u043f\u0440\u0438\u043a\u043e\u0441\u043d\u043e\u0432\u0435\u043d\u0438\u0435 \u0432\u043e\u043b\u0448\u0435\u0431\u043d\u043e\u0439 \u043f\u0430\u043b\u043e\u0447\u043a\u0438!  <\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0418\u0442\u0430\u043a, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f? \u041d\u0435 \u0432\u043e\u043b\u043d\u0443\u0439\u0442\u0435\u0441\u044c, \u0435\u0441\u043b\u0438 \u043c\u0438\u0440 C\/C++ \u0432\u0430\u043c \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0434\u0430\u043b\u0435\u043a\u0438\u043c \u0438 \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c, \u044d\u0442\u043e \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u043f\u043e\u0432\u043e\u0434 \u043e\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0440\u0443\u043a\u0438! P\/Invoke \u2013 \u044d\u0442\u043e \u043d\u0430\u0448 \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0441\u043e\u044e\u0437\u043d\u0438\u043a \u0432 \u044d\u0442\u043e\u043c \u043c\u0438\u0440\u0435 \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a. \u0422\u0430\u043a \u0447\u0442\u043e \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0432\u044b \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0441 \u044d\u0442\u0438\u043c\u0438 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f\u043c\u0438, \u043d\u0435 \u0443\u043d\u044b\u0432\u0430\u0439\u0442\u0435! \u041d\u0435 \u0431\u043e\u0439\u0442\u0435\u0441\u044c \u043f\u0440\u0435\u0442\u0432\u043e\u0440\u044f\u0442\u044c \u0432\u0430\u0448\u0438 \u0438\u0434\u0435\u0438 \u0432 \u0436\u0438\u0437\u043d\u044c, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043e\u0431\u044b\u0434\u0435\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u0430\u043a \u0432\u044b\u0431\u043e\u0440 \u043e\u0431\u043e\u0435\u0432 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u0441\u0442\u043e\u043b\u0430. \u041f\u043e\u043c\u043d\u0438\u0442\u0435, \u043e\u0434\u043d\u0438\u043c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u043c \u0448\u0430\u0433\u043e\u043c \u0432 \u043a\u043e\u0434\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u0438\u0434\u0430\u0442\u044c \u0436\u0438\u0437\u043d\u044c \u0432\u0441\u0435\u043c\u0443 \u043e\u043a\u0440\u0443\u0436\u0430\u044e\u0449\u0435\u043c\u0443 \u043c\u0438\u0440\u0443!<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/756460\/\"> https:\/\/habr.com\/ru\/articles\/756460\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0423 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0438 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0435 \u0440\u0430\u0434\u043e\u0441\u0442\u0438, \u0434\u0430\u0436\u0435 \u043d\u0430 \u0444\u043e\u043d\u0435 \u0441\u0435\u0440\u043e\u0439 \u0440\u0443\u0442\u0438\u043d\u044b. \u0414\u043b\u044f \u043c\u0435\u043d\u044f, \u043a\u0430\u043a \u0434\u043b\u044f \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e \u0441\u043c\u0435\u0440\u0442\u043d\u043e\u0433\u043e, \u044d\u0442\u043e \u0431\u044b\u043b \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0444\u043e\u043d \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u0441\u0442\u043e\u043b\u0430 \u0432 Windows. \u041d\u043e, \u043a\u0430\u043a \u044d\u0442\u043e \u0431\u044b\u0432\u0430\u0435\u0442, \u043e\u0434\u043d\u0430\u0436\u0434\u044b \u043c\u043e\u044f \u0436\u0438\u0437\u043d\u044c \u043f\u043e\u0448\u043b\u0430 \u043f\u043e \u043d\u043e\u0432\u043e\u043c\u0443 \u043f\u0443\u0442\u0438, \u0438 \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u0447\u0443\u0434\u0435\u0441\u043d\u0435\u0439\u0448\u0435\u0439 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043b\u043e\u0432\u043d\u043e \u043f\u0440\u043e\u043d\u0438\u043a\u043b\u0430 \u0432 \u043c\u043e\u044e \u0434\u0443\u0448\u0443. \u041e\u043d\u0430 \u0441\u0442\u0430\u043b\u0430 \u043c\u043e\u0438\u043c \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u0435\u043d\u0438\u0435\u043c, \u043c\u043e\u0438\u043c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u043c \u043e\u0441\u0442\u0440\u043e\u0432\u043a\u043e\u043c \u0440\u0430\u0434\u0443\u0433\u0438 \u0432 \u043c\u043e\u0440\u0435 \u043f\u043e\u0432\u0441\u0435\u0434\u043d\u0435\u0432\u043d\u043e\u0439 \u0441\u043a\u0443\u043a\u0438. \u0418, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u044d\u0442\u043e \u0431\u044b\u043b\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430&#8230; \u043d\u0443, \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0435\u0433\u043e \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0430.<\/p>\n<p>\u0421\u0440\u0430\u0437\u0443 \u0436\u0435 \u0432 \u043c\u043e\u0435\u0439 \u0433\u043e\u043b\u043e\u0432\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0438\u0434\u0435\u044f: &#171;\u041f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043d\u0435 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u0443 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u043d\u0430 \u0444\u043e\u043d \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u0441\u0442\u043e\u043b\u0430?&#187;. \u0412\u0435\u0434\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0433\u043e\u0440\u044f\u0447\u0438\u0435 \u043a\u043b\u0430\u0432\u0438\u0448\u0438, \u043f\u0440\u0430\u0432\u0434\u0430? \u041d\u043e \u0432\u043e\u0442 \u0431\u0435\u0434\u0430 \u2013 \u043e\u0436\u0438\u0434\u0430\u0435\u0442\u0441\u044f \u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u043d\u0435\u0433\u043e\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u0432\u0437\u0433\u043b\u044f\u0434\u044b \u0443\u043a\u043e\u0440\u0438\u0437\u043d\u044b. \u0421\u043a\u0432\u043e\u0437\u044c \u0441\u0442\u0440\u0430\u0445\u0438 \u0438 \u0441\u043e\u043c\u043d\u0435\u043d\u0438\u044f \u0440\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u043d\u0435\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u0430\u044f \u0438\u0434\u0435\u044f: \u044f \u043d\u0430\u043f\u0438\u0448\u0443 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u0444\u043e\u043d \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u0441\u0442\u043e\u043b\u0430 \u043f\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u044e \u0433\u043e\u0440\u044f\u0447\u0438\u0445 \u043a\u043b\u0430\u0432\u0438\u0448! \u0414\u0430, \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a, \u0443\u0432\u0430\u0436\u0430\u0435\u043c\u044b\u0435 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438, \u044f \u0440\u0435\u0448\u0438\u043b \u0441\u043c\u0435\u043b\u043e \u043f\u043e\u0442\u0440\u044f\u0441\u0442\u0438 \u043c\u0438\u0440 \u0441\u0432\u043e\u0438\u043c \u0432\u044b\u0431\u043e\u0440\u043e\u043c \u043e\u0431\u043e\u0435\u0432.<\/p>\n<p>\u0418 \u0432\u043e\u0442, \u0432\u043d\u0435\u0437\u0430\u043f\u043d\u043e, \u043d\u0430 \u0441\u0446\u0435\u043d\u0435 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u0448 \u0433\u0435\u0440\u043e\u0439 \u2013 <strong>P\/Invoke<\/strong>! \u0415\u0441\u043b\u0438 \u0432\u044b, \u043a\u0430\u043a \u0438 \u044f, \u043d\u0435 \u0431\u044b\u043b\u0438 \u0432 \u043b\u0430\u0434\u0430\u0445 \u0441 C\/C++, \u043d\u0435 \u043e\u0442\u0447\u0430\u0438\u0432\u0430\u0439\u0442\u0435\u0441\u044c \u2013 P\/Invoke \u0441\u0442\u043e\u0438\u0442 \u043d\u0430 \u0441\u0442\u0440\u0430\u0436\u0435 \u0432\u0430\u0448\u0438\u0445 \u0438\u043d\u043d\u043e\u0432\u0430\u0446\u0438\u0439. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0443 \u043c\u0435\u043d\u044f \u043d\u0435 \u0431\u044b\u043b\u043e \u043d\u0438 \u043c\u0430\u043b\u0435\u0439\u0448\u0435\u0433\u043e \u043f\u043e\u043d\u044f\u0442\u0438\u044f \u043e C\/C++, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u043e \u043c\u0435\u043d\u044f. \u0421\u0438\u043b\u0430 P\/Invoke \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u0430\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0437 \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0442\u0430\u043a, \u0431\u0443\u0434\u0442\u043e \u043e\u043d\u0438 \u0431\u044b\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u043d\u0430 \u0447\u0438\u0441\u0442\u043e\u043c C#. \u0412\u043e\u0442 \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442:<\/p>\n<h4>\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0433\u043e\u0440\u044f\u0447\u0438\u0445 \u043a\u043b\u0430\u0432\u0438\u0448<\/h4>\n<p>\u041c\u044b \u043d\u0430\u0446\u0435\u043b\u0438\u043b\u0438\u0441\u044c \u043d\u0430 \u0434\u0432\u0435 \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438 \u043a\u043b\u0430\u0432\u0438\u0448: \u043e\u0434\u043d\u0443 \u0434\u043b\u044f \u044d\u0440\u043e\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0444\u043e\u043d\u0430 (\u0434\u0430-\u0434\u0430, \u044f \u0442\u0430\u043a \u0438 \u043d\u0430\u0437\u0432\u0430\u043b) \u0438 \u0434\u0440\u0443\u0433\u0443\u044e \u0434\u043b\u044f \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e. \u0418\u0442\u0430\u043a, <a href=\"https:\/\/learn.microsoft.com\/ru-ru\/windows\/win32\/api\/winuser\/nf-winuser-registerhotkey?redirectedfrom=MSDN\" rel=\"noopener noreferrer nofollow\"><strong>RegisterHotKey <\/strong><\/a>\u0438\u0437 &#171;user32.dll&#187; \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0430\u0448\u0438\u043c \u0432\u0435\u0440\u043d\u044b\u043c \u0441\u043f\u0443\u0442\u043d\u0438\u043a\u043e\u043c:  <\/p>\n<pre><code class=\"cs\">[DllImport(\"user32.dll\")] public static extern bool RegisterHotKey(IntPtr hWnd, int id, uint fsModifiers, uint vk);  \/\/ \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0434\u043b\u044f \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043a\u043b\u0430\u0432\u0438\u0448. public const int MOD_ALT = 0x0001; public const int MOD_CONTROL = 0x0002; public const int MOD_SHIFT = 0x0004;  \/\/ \u0417\u0430\u043a\u043b\u0438\u043d\u0430\u043d\u0438\u044f \u0432 \u0432\u0438\u0434\u0435 \u043a\u043b\u0430\u0432\u0438\u0448. \u041d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043c\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438 \"B\" \u0438 \"C\". public const int VK_B = 0x42; public const int VK_C = 0x43;  \/\/ \u0420\u0438\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u0437\u0430\u043a\u043b\u0438\u043d\u0430\u043d\u0438\u0439. \u041d\u0430\u0448\u0438 \u0447\u0438\u0441\u043b\u0430 \u0438\u043c\u0435\u044e\u0442 \u043e\u0441\u043e\u0431\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. public const int WallpaperErroticCommand = 11; \/\/ \u041f\u043e\u0440\u0430 \u043f\u0440\u0438\u0437\u0432\u0430\u0442\u044c \u044d\u0440\u043e\u0442\u0438\u043a\u0443! public const int WallpaperNormalCommand = 12; \/\/ \u0410 \u0437\u0434\u0435\u0441\u044c - \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u043e\u0431\u043e\u0438.  if (RegisterHotKey(IntPtr.Zero, WallpaperErroticCommand, MOD_ALT | MOD_CONTROL, VK_B)     &amp;&amp; RegisterHotKey(IntPtr.Zero, WallpaperNormalCommand, MOD_SHIFT, VK_C)) {     Console.WriteLine(\"\u0413\u043e\u0440\u044f\u0447\u0438\u0435 \u043a\u043b\u0430\u0432\u0438\u0448\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b. \u0412\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u0432\u043e\u043b\u0448\u0435\u0431\u0441\u0442\u0432\u0430!\");     Console.WriteLine(\"\u041d\u0430\u0436\u043c\u0438\u0442\u0435 Ctrl+Alt+B, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0433\u0440\u0443\u0437\u0438\u0442\u044c\u0441\u044f \u0432 \u043c\u0438\u0440 \u044d\u0440\u043e\u0442\u0438\u043a\u0438. \u042d\u0442\u043e \u043d\u0430\u0448 \u0441\u0435\u043a\u0440\u0435\u0442!\");     Console.WriteLine(\"\u041d\u0430\u0436\u043c\u0438\u0442\u0435 Shift+C, \u0447\u0442\u043e\u0431\u044b \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043a \u043e\u0431\u044b\u0447\u043d\u044b\u043c \u043e\u0431\u043e\u044f\u043c. \u041c\u0430\u0433\u0438\u044f \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0432\u0438\u0434\u0438\u043c\u043e\u0439.\"); } else {     Console.WriteLine(\"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0433\u043e\u0440\u044f\u0447\u0438\u0435 \u043a\u043b\u0430\u0432\u0438\u0448\u0438. \u041c\u0430\u0433\u0438\u044f \u0447\u0443\u0442\u044c \u043f\u043e\u0434\u0432\u0435\u043b\u0430 \u043d\u0430\u0441.\"); }<\/code><\/pre>\n<h4>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439<\/h4>\n<p>\u0418 \u0432\u043e\u0442 \u043e\u043d, \u0433\u0440\u044f\u0434\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442! \u041d\u0430\u0448 \u043a\u043e\u0434 \u0436\u0434\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u043a\u0442\u043e-\u0442\u043e \u043d\u0430\u0436\u043c\u0435\u0442 \u0433\u043e\u0440\u044f\u0447\u0438\u0435 \u043a\u043b\u0430\u0432\u0438\u0448\u0438. <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows\/win32\/api\/winuser\/nf-winuser-getmessage\" rel=\"noopener noreferrer nofollow\"><strong>GetMessage<\/strong><\/a>, \u0441\u043d\u043e\u0432\u0430 \u0438\u0437 &#171;user32.dll&#187;, \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0440\u043e\u043b\u0438 \u043f\u043e\u0447\u0442\u043e\u0432\u043e\u0433\u043e \u0433\u043e\u043b\u0443\u0431\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u043d\u043e\u0441\u0438\u0442 \u043d\u0430\u043c \u044d\u0442\u0438 \u0432\u0430\u0436\u043d\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f:  <\/p>\n<pre><code class=\"cs\">[DllImport(\"user32.dll\")] public static extern bool GetMessage(out MSG lpMsg, IntPtr hWnd, uint wMsgFilterMin, uint wMsgFilterMax);  public const int WM_HOTKEY = 0x0312;  MSG msg; while (GetMessage(out msg, IntPtr.Zero, 0, 0)) {     \/\/ \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u0438 \u0433\u043e\u0440\u044f\u0447\u0430\u044f \u043a\u043b\u0430\u0432\u0438\u0448\u0430 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u0442\u0441\u044f,      \/\/ \u043a\u043e\u0434 \u043e\u0449\u0443\u0449\u0430\u0435\u0442, \u0447\u0442\u043e \u0447\u0442\u043e-\u0442\u043e \u0432\u0430\u0436\u043d\u043e\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e. \u0412\u0441\u0435 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0442\u0430\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c\u0443 WM_HOTKEY,      \/\/ \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043a\u0430\u043a \u0431\u0443\u0434\u0442\u043e \u0448\u0435\u043f\u0447\u0435\u0442: \"\u0414\u0440\u0443\u0433 \u043c\u043e\u0439, \u043d\u0430\u0436\u0430\u0442\u0430 \u0433\u043e\u0440\u044f\u0447\u0430\u044f \u043a\u043b\u0430\u0432\u0438\u0448\u0430!\".     if (msg.message != WM_HOTKEY) continue;          \/\/ ... }<\/code><\/pre>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u043f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c, \u043a\u0430\u043a \u0437\u0430\u0436\u0435\u0447\u044c \u043e\u0433\u043e\u043d\u044c \u0444\u043e\u043d\u043e\u0432 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u0441\u0442\u043e\u043b\u0430, \u044f \u0432\u044b\u043d\u0443\u0436\u0434\u0435\u043d \u0431\u044b\u043b \u043f\u0440\u0438\u0437\u0432\u0430\u0442\u044c \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u0434\u0432\u0443\u0445 \u0432\u0435\u0440\u043d\u044b\u0445 \u0441\u043f\u0443\u0442\u043d\u0438\u043a\u043e\u0432 \u2013 <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows\/win32\/api\/winuser\/ns-winuser-msg\" rel=\"noopener noreferrer nofollow\"><strong>MSG<\/strong><\/a><strong> <\/strong>\u0438 <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows\/win32\/api\/windef\/ns-windef-point\" rel=\"noopener noreferrer nofollow\"><strong>POINT<\/strong><\/a>. <\/p>\n<pre><code class=\"cs\">\/\/ \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 MSG \u2013 \u044d\u0442\u043e \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u043f\u043e\u0441\u043b\u0430\u043d\u043d\u0438\u043a \u043c\u0435\u0436\u0434\u0443 \u043c\u0438\u0440\u0430\u043c\u0438. \/\/ \u041e\u043d\u0430 \u043f\u0440\u0438\u043d\u043e\u0441\u0438\u0442 \u0441 \u0441\u043e\u0431\u043e\u0439 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0432\u0430\u0436\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430 \u043d\u0438\u0445 \u0441\u0432\u043e\u0439 \u043e\u0442\u043f\u0435\u0447\u0430\u0442\u043e\u043a. [StructLayout(LayoutKind.Sequential)] public struct MSG {     public IntPtr hwnd;        \/\/ \u041e\u043a\u043d\u043e, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u043e\u043d\u0438\u043a\u0430\u044e\u0442 \u0442\u0430\u0439\u043d\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f.     public uint message;       \/\/ \u0421\u0435\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043a\u043e\u0434 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u043a\u0430\u043a \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0444\u043e\u0440\u043c\u0443\u043b\u0430.     public IntPtr wParam;      \/\/ \u0412\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0434\u043b\u044f \u0437\u0430\u043a\u043b\u0438\u043d\u0430\u043d\u0438\u0439.     public IntPtr lParam;      \/\/ \u0415\u0449\u0435 \u043e\u0434\u043d\u0430 \u0437\u0430\u0433\u0430\u0434\u043e\u0447\u043d\u0430\u044f \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0430\u044f.     public uint time;          \/\/ \u0412\u0440\u0435\u043c\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043c\u0430\u0433\u0438\u044f.     public POINT pt;           \/\/ \u0422\u043e\u0447\u043a\u0430, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0441\u0432\u043e\u0435 \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0443\u0442\u0435\u0448\u0435\u0441\u0442\u0432\u0438\u0435.     public uint lPrivate;      \/\/ \u0417\u0430\u0433\u0430\u0434\u043e\u0447\u043d\u043e\u0435 \u043b\u0438\u0447\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441\u044b.      \/\/ \u041c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0444\u043e\u0440\u043c\u0443\u043b\u0430, \u0440\u0430\u0441\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0430\u044f \u0441\u0443\u0442\u044c MSG.     public readonly override string ToString() =>         $\"hwnd: {hwnd}, message: {message}, wParam: {wParam}, lParam: {lParam}, time: {time}, pt: {pt}, lPrivate: {lPrivate}\"; }  \/\/ \u0410 \u0432\u043e\u0442 \u0438 \u043d\u0430\u0448 \u0434\u0440\u0443\u0433 POINT, \u0442\u043e\u0436\u0435 \u0441\u043e \u0441\u0432\u043e\u0438\u043c\u0438 \u0442\u0430\u0439\u043d\u0430\u043c\u0438. \/\/ \u041e\u043d \u0443\u043c\u0435\u0435\u0442 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u0441\u0430\u043c\u044b\u0435 \u0433\u043b\u0443\u0431\u043e\u043a\u0438\u0435 \u0441\u0435\u043a\u0440\u0435\u0442\u044b \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442. [StructLayout(LayoutKind.Sequential)] public struct POINT {     public int x;              \/\/ \u0421\u0435\u043a\u0440\u0435\u0442\u043d\u0430\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430 X, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u043c\u0430\u0433\u0438\u044f.     public int y;              \/\/ \u0418 Y, \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0437\u0430\u0433\u0430\u0434\u043e\u0447\u043d\u044b\u0439.      \/\/ \u0418\u043d\u0442\u0440\u0438\u0433\u0443\u044e\u0449\u0430\u044f \u0437\u0430\u0433\u0430\u0434\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e POINT \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0432 \u043d\u0430\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u043e.     public readonly override string ToString() =>         $\"x: {x}, y: {y}\"; }<\/code><\/pre>\n<h4>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043e\u0431\u043e\u0435\u0432<\/h4>\n<p>\u0414\u0430-\u0434\u0430, \u0441\u0430\u043c\u0430\u044f \u0432\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c! \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c, \u043a\u0430\u043a\u043e\u0439 \u0444\u043e\u043d \u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c, \u0438 <a href=\"https:\/\/%D0%94%D0%B0-%D0%B4%D0%B0,%20%D1%81%D0%B0%D0%BC%D0%B0%D1%8F%20%D0%B2%D0%BE%D0%BB%D0%BD%D0%B8%D1%82%D0%B5%D0%BB%D1%8C%D0%BD%D0%B0%D1%8F%20%D1%87%D0%B0%D1%81%D1%82%D1%8C!%20%D0%9E%D0%BF%D1%80%D0%B5%D0%B4%D0%B5%D0%BB%D1%8F%D0%B5%D0%BC,%20%D0%BA%D0%B0%D0%BA%D0%BE%D0%B9%20%D1%84%D0%BE%D0%BD%20%D1%81%D1%82%D0%BE%D0%B8%D1%82%20%D0%BF%D0%BE%D1%81%D1%82%D0%B0%D0%B2%D0%B8%D1%82%D1%8C,%20%D0%B8%20SystemParametersInfo%20%D0%B2%D0%BE%D0%B7%D0%B2%D1%80%D0%B0%D1%89%D0%B0%D0%B5%D1%82%20%D0%BD%D0%B0%D0%BC%20%D0%BF%D0%BE%D0%B1%D0%B5%D0%B4%D1%83%20%D0%B8%D0%BB%D0%B8%20%D0%BF%D0%B0%D1%82%D0%BE%D0%B2%D1%83%D1%8E%20%D1%81%D0%B8%D1%82%D1%83%D0%B0%D1%86%D0%B8%D1%8E:\" rel=\"noopener noreferrer nofollow\"><strong>SystemParametersInfo <\/strong><\/a>\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0430\u043c \u043f\u043e\u0431\u0435\u0434\u0443 \u0438\u043b\u0438 \u043f\u0430\u0442\u043e\u0432\u0443\u044e \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e:  <\/p>\n<pre><code class=\"cs\">[DllImport(\"user32.dll\", CharSet = CharSet.Auto)]     public static extern bool SystemParametersInfo(uint uiAction, uint uiParam, IntPtr pvParam, uint fWinIni);  \/\/ \u0413\u043e\u0442\u043e\u0432\u0438\u043c\u0441\u044f \u043a \u0432\u0435\u043b\u0438\u043a\u043e\u043c\u0443 \u0437\u0430\u043c\u0430\u0445\u0443 - \u0432\u044b\u0431\u043e\u0440\u0443 \u043e\u0431\u043e\u0435\u0432! var imagePath = msg.wParam switch {     WallpaperErroticCommand => WallpaperErroticPath,     WallpaperNormalCommand => WallpaperNormalPath,     _ => throw new InvalidOperationException($\"\u041d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b {nameof(msg.wParam)}:{msg.wParam}\") };  \/\/ \u041f\u043e\u0434\u043d\u0438\u043c\u0430\u0435\u043c \u043f\u0443\u0442\u0435\u0432\u043e\u0434\u043d\u044b\u0439 \u0444\u0430\u043a\u0435\u043b - \u0430\u0434\u0440\u0435\u0441 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f! var imagePtr = Marshal.StringToHGlobalUni(imagePath);  \/\/ \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0432\u043e\u0440\u043e\u0442\u0430 \u0432 \u043c\u0438\u0440 \u0444\u0430\u043d\u0442\u0430\u0437\u0438\u0439 - \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043e\u0431\u043e\u0435\u0432! if (!SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, imagePtr, 0)) {     Console.WriteLine(\"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0444\u043e\u043d \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u0441\u0442\u043e\u043b\u0430. \u0416\u0438\u0437\u043d\u044c \u043d\u0435 \u043f\u043e \u0434\u0435\u0442\u0441\u043a\u0438 \u0441\u043b\u043e\u0436\u043d\u0430, \u0432\u0435\u0440\u043d\u043e?\"); } else {     Console.WriteLine(\"\u0424\u043e\u043d \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d. \u041f\u043e\u043c\u043d\u0438\u0442\u0435, \u043e\u0431\u043e\u0438 \u2013 \u044d\u0442\u043e \u0432\u0430\u0448\u0435 \u0437\u0435\u0440\u043a\u0430\u043b\u043e \u0432 \u043c\u0438\u0440!\"); }  \/\/ \u041e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0430\u0435\u043c \u043c\u0435\u0441\u0442\u043e \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u0438\u0434\u0435\u0439 - \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438! Marshal.FreeHGlobal(imagePtr); <\/code><\/pre>\n<h2>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/h2>\n<p>\u0418 \u0432\u043e\u0442, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u043d\u0430\u0441\u0442\u0443\u043f\u0438\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u044c \u0437\u0430\u0432\u0435\u0441\u0443 \u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u0445 \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0432\u043e\u0437\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439!  <\/p>\n<p>\u0414\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u044f Ctrl+Alt+B:  <\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043d\u0430\u0436\u0430\u0442\u0438\u0435 Ctrl+Alt+B<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0418 \u0442\u0430\u043a, \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u044c\u0442\u0435\u0441\u044c \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0433\u043b\u0430\u0432\u0435 \u043c\u043e\u0435\u0439 \u0438\u0441\u0442\u043e\u0440\u0438\u0438.  \u041d\u0430\u0436\u0438\u043c\u0430\u044e Shift+C:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435, \u043a\u0430\u043a \u0431\u0443\u0434\u0442\u043e \u043c\u0438\u0440 \u0432\u043e\u043a\u0440\u0443\u0433 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0441 \u043a\u0430\u0436\u0434\u044b\u043c \u043d\u0430\u0436\u0430\u0442\u0438\u0435\u043c \u043a\u043b\u0430\u0432\u0438\u0448\u0438, \u043a\u0430\u043a \u0431\u0443\u0434\u0442\u043e \u043f\u0440\u0438\u043a\u043e\u0441\u043d\u043e\u0432\u0435\u043d\u0438\u0435 \u0432\u043e\u043b\u0448\u0435\u0431\u043d\u043e\u0439 \u043f\u0430\u043b\u043e\u0447\u043a\u0438!  <\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0418\u0442\u0430\u043a, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f? \u041d\u0435 \u0432\u043e\u043b\u043d\u0443\u0439\u0442\u0435\u0441\u044c, \u0435\u0441\u043b\u0438 \u043c\u0438\u0440 C\/C++ \u0432\u0430\u043c \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0434\u0430\u043b\u0435\u043a\u0438\u043c \u0438 \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c, \u044d\u0442\u043e \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u043f\u043e\u0432\u043e\u0434 \u043e\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0440\u0443\u043a\u0438! P\/Invoke \u2013 \u044d\u0442\u043e \u043d\u0430\u0448 \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0441\u043e\u044e\u0437\u043d\u0438\u043a \u0432 \u044d\u0442\u043e\u043c \u043c\u0438\u0440\u0435 \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a. \u0422\u0430\u043a \u0447\u0442\u043e \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0432\u044b \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0441 \u044d\u0442\u0438\u043c\u0438 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f\u043c\u0438, \u043d\u0435 \u0443\u043d\u044b\u0432\u0430\u0439\u0442\u0435! \u041d\u0435 \u0431\u043e\u0439\u0442\u0435\u0441\u044c \u043f\u0440\u0435\u0442\u0432\u043e\u0440\u044f\u0442\u044c \u0432\u0430\u0448\u0438 \u0438\u0434\u0435\u0438 \u0432 \u0436\u0438\u0437\u043d\u044c, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043e\u0431\u044b\u0434\u0435\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u0430\u043a \u0432\u044b\u0431\u043e\u0440 \u043e\u0431\u043e\u0435\u0432 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u0441\u0442\u043e\u043b\u0430. \u041f\u043e\u043c\u043d\u0438\u0442\u0435, \u043e\u0434\u043d\u0438\u043c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u043c \u0448\u0430\u0433\u043e\u043c \u0432 \u043a\u043e\u0434\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u0438\u0434\u0430\u0442\u044c \u0436\u0438\u0437\u043d\u044c \u0432\u0441\u0435\u043c\u0443 \u043e\u043a\u0440\u0443\u0436\u0430\u044e\u0449\u0435\u043c\u0443 \u043c\u0438\u0440\u0443!<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/756460\/\"> https:\/\/habr.com\/ru\/articles\/756460\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-352978","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/352978","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=352978"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/352978\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=352978"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=352978"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=352978"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}