Log in

View Full Version : Vdub ifilterpreview handle


b2kguga
5th August 2016, 18:41
Hi guys

Someone knows how to retrieve the handle of ifilterpreview ?

IŽm trying to grab the coordinates of the preview window in order to make a mask that can be used with the mouse.

Example on the preview i draw a rectangle with dots representing the masked area, but this is only displayed when i settle the coordinates through a edit box control. I wanted to grab this mask with the mouse and make the mask be resizable also with the mouse and not only with the values settled on the keyboard (that are used inside the edit boxes)

Groucho2004
5th August 2016, 19:28
Google "EnumWindowsProc".

b2kguga
5th August 2016, 19:52
Thanks, but is there another way ?

On http://forum.doom9.org/showthread.php?t=172886 , shekh made a Lens Transform tool plugin whose preview has no controls, and it seem the handle was grabbed somehow. Do you know how he managed to remove the controls from the preview window ? On this way, it may be possible to get the handle without needing to enumerate the windows

shekh
5th August 2016, 20:00
As I understand you want to implement some mouse interaction within preview window? Like dragging control points.
I am not sure hacking with window names is clean way to do anything at all.

I have implemented a callback interface which allows to pick single point from viewport. This isnt much but already something.
You can see it in action with my fflayer filter: shift+click will put the layer where you clicked (just download entire pack, it is there).
If you want to see better new API, I had a plan to make something more tool-oriented.

b2kguga
5th August 2016, 20:08
Thanks, shekh. Your filter is this one ?
https://sourceforge.net/p/vdfiltermod/cch_input/ci/master/tree/fflayer_render.cpp

shekh
5th August 2016, 20:12
You are interested in this part: https://sourceforge.net/p/vdfiltermod/cch_input/ci/master/tree/fflayer.cpp
See PreviewZoomCallback

b2kguga
5th August 2016, 20:22
Thank you so much. IŽll take a look at it and see if i can implement the mouse interaction

b2kguga
5th August 2016, 20:44
Btw..If i didnŽt succeed, iŽll be forced to do the simpler way using FindWindow :(, such as: call 'USER32.FindWindowA' &NULL, {B$ 'Filter preview',0}

shekh
5th August 2016, 20:47
Here some hints:
you need updated files from vd2 subfolder (vdplugin.h,vdvideofilt.h etc)

you need updated entry point, see vfmain.cpp: there is new export FilterModModuleInit

All new interfaces come from new entry point, so you can run the same filter with old VD but all new interfaces will be nulled.

If in doubt what something will do, ask :)

shekh
5th August 2016, 20:55
Btw..If i didnŽt succeed, iŽll be forced to do the simpler way using FindWindow :(, such as: call 'USER32.FindWindowA' &NULL, {B$ 'Filter preview',0}

This can maybe work. Inside main preview window there is another borderless "display window" with actual image.