Notifications
Clear all

[Closed] Low level mouse hooк Action

(
	fn GetSMEWindowHandle = 
	(	
		max_hwnd = windows.getMAXHWND()
		for m in windows.getChildrenHWND 0 where m[4] == "NodeJoeMainWindow" and m[5] == "Slate Material Editor" and m[6] == max_hwnd do exit with m[1]		
	)
	
	fn makeparam w l = bit.or (bit.and w 0xFFFF) (bit.shift l 16)
	
	-- todo: check that sme is active
	-- todo: check that sme has at least one tab
	
	sme_active_view_name = if SME.activeView > 0 then (SME.GetView SME.activeView).Name else undefined
	
	sme_hwnd = GetSMEWindowHandle()
	sme_view_hwnd = for data in windows.getChildrenHWND sme_hwnd where data[4] == "DragDropWindow" and data[5] == sme_active_view_name do
	(
		exit with data[1]
	)

	sme_window_pos = windows.getWindowPos sme_view_hwnd -- mxs2014+
	relative_position = [ mouse.screenpos.x - sme_window_pos.x, mouse.screenpos.y - sme_window_pos.y]

	windows.postMessage sme_view_hwnd 0x201 0 (makeparam relative_position.x relative_position.y)
	windows.postMessage sme_view_hwnd 0x202 0 (makeparam relative_position.x relative_position.y)

)

Yes, this is the way I did. Thank you so much for your help )))

Page 2 / 2