Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Windows.Forms;
- using System.Runtime.InteropServices;
- public const Int32 WM_USER = 1024;
- public const Int32 WM_CSKEYBOARD = WM_USER + 192;
- public const Int32 WM_CSKEYBOARDMOVE = WM_USER + 193;
- public const Int32 WM_CSKEYBOARDRESIZE = WM_USER + 197;
- [DllImport("user32.dll", EntryPoint = "FindWindow")]
- private static extern Int32 FindWindow(string _ClassName, string _WindowName);
- [DllImport("User32.DLL")]
- public static extern Boolean PostMessage(Int32 hWnd, Int32 Msg, Int32 wParam, Int32 lParam);
- Int32 hWnd = FindWindow("TFirstForm", "hvkFirstForm");
- PostMessage(hWnd, WM_CSKEYBOARD, 1, 0 ); // Show
- PostMessage(hWnd, WM_CSKEYBOARD, 2, 0); // Hide
- PostMessage(hWnd, WM_CSKEYBOARDMOVE, 0, 0); // Move to 0, 0
- PostMessage(hWnd, WM_CSKEYBOARDRESIZE, 600, 300); // Resize to 600, 300
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement