Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. TOOLINFO ti = m_toolInfo;
  2. ti.uFlags = (uint)TTF.TTF_TRACK;
  3.  
  4. IntPtr dwPos = (IntPtr)WindowsAPI.MAKELONG(position.X, position.Y);
  5.  
  6. WindowsAPI.SendMessage(hWnd, (int)TTM.TTM_TRACKPOSITION, 0, dwPos);
  7. WindowsAPI.SendMessage(hWnd, (int)TTM.TTM_ADDTOOLW, 0, ref ti);
  8. WindowsAPI.SendMessage(hWnd, (int)TTM.TTM_TRACKACTIVATE, 1, ref ti);
  9.  
  10. IntPtr hWnd = this.Handle;
  11.  
  12. TOOLINFO ti = new TOOLINFO();
  13. ti.cbSize = (uint)Marshal.SizeOf(ti);
  14.  
  15. if (WindowsAPI.SendMessage(hWnd, (int)TTM.TTM_GETCURRENTTOOLW, 0, ref ti) != 0)
  16. {
  17. if ((ti.uFlags & (uint)TTF.TTF_TRACK) != 0)
  18. {
  19. WindowsAPI.SendMessage(hWnd, (int)TTM.TTM_TRACKACTIVATE, 0, ref ti);
  20. WindowsAPI.SendMessage(hWnd, (int)TTM.TTM_DELTOOLW, 0, ref ti);
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement