Skip to content

Commit 2939433

Browse files
committed
Wait for VBE to fully load before loading keyhook.
1 parent 951550e commit 2939433

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

RetailCoder.VBE/App.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,11 @@ public void Startup()
196196
ParseAll();
197197
});
198198

199+
Task.Delay(1000).ContinueWith(t =>
200+
{
201+
_hooks.AddHook(new LowLevelKeyboardHook(_vbe));
202+
_hooks.Attach();
203+
});
199204
//_hooks.AddHook(new LowLevelKeyboardHook(_vbe));
200205
//_hooks.AddHook(new HotKey((IntPtr)_vbe.MainWindow.HWnd, "%^R", Keys.R));
201206
//_hooks.AddHook(new HotKey((IntPtr)_vbe.MainWindow.HWnd, "%^I", Keys.I));

0 commit comments

Comments
 (0)