Advertisement
sandunfx

hvk

Jun 9th, 2019
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.81 KB | None | 0 0
  1. using System;
  2. using System.Windows.Forms;
  3. using System.Runtime.InteropServices;
  4.  
  5. public const Int32 WM_USER = 1024;
  6. public const Int32 WM_CSKEYBOARD = WM_USER + 192;
  7. public const Int32 WM_CSKEYBOARDMOVE = WM_USER + 193;
  8. public const Int32 WM_CSKEYBOARDRESIZE = WM_USER + 197;
  9.  
  10. [DllImport("user32.dll", EntryPoint = "FindWindow")]
  11. private static extern Int32 FindWindow(string _ClassName, string _WindowName);
  12.  
  13. [DllImport("User32.DLL")]
  14. public static extern Boolean PostMessage(Int32 hWnd, Int32 Msg, Int32 wParam, Int32 lParam);
  15.  
  16.  
  17. Int32 hWnd = FindWindow("TFirstForm", "hvkFirstForm");
  18. PostMessage(hWnd, WM_CSKEYBOARD, 1, 0 ); // Show
  19. PostMessage(hWnd, WM_CSKEYBOARD, 2, 0); // Hide
  20. PostMessage(hWnd, WM_CSKEYBOARDMOVE, 0, 0); // Move to 0, 0
  21. PostMessage(hWnd, WM_CSKEYBOARDRESIZE, 600, 300); // Resize to 600, 300
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement