Advertisement
Guest User

Untitled

a guest
Jan 20th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.60 KB | None | 0 0
  1. Dim procDelegate = New user32.WinEventDelegate(Sub(hWinEventHook As IntPtr, evettype As UInteger, hwnd As IntPtr, idObject As Integer, idChild As Integer, dwEventThread As UInteger, dwmsEventTyme As UInteger)
  2.      If idObject = 0 AndAlso idChild = 0 AndAlso hwnd = Application.MainWindow.Handle andalso mainform.Visible Then
  3.             mainForm.UpdateLocation()
  4.             user32.SetForegroundWindow(mainForm.Handle)
  5.      End If
  6.  End Sub)
  7. Dim hhook = user32.SetWinEventHook(user32.EVENT_OBJECT_LOCATIONCHANGE, user32.EVENT_OBJECT_LOCATIONCHANGE, Application.MainWindow.Handle, procDelegate, process.GetCurrentProcess.Id , 0, 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement