21 lines
595 B
C#
21 lines
595 B
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace Szmedi.Toolkit.Assists
|
|
{
|
|
public static class KeyPressAssists
|
|
{
|
|
public static IntPtr RevitWindowPtr = Autodesk.Windows.ComponentManager.ApplicationWindow;
|
|
|
|
[DllImport("user32.dll")]
|
|
internal static extern bool SetForegroundWindow(IntPtr hWnd);
|
|
|
|
[DllImport("user32.dll")]
|
|
internal static extern void keybd_event(byte bVk, byte bScan, int dwFlags, int dwExtraInfo);
|
|
|
|
public static void SetFocusRVT()
|
|
{
|
|
SetForegroundWindow(RevitWindowPtr);
|
|
}
|
|
}
|
|
} |