How to get the position and size of the DD video panel

Module API help / support section for programmers.

Moderators: Dreamer, FredB, X05

chattana
Just can't stay away
Posts: 43
Joined: Sun Nov 04, 2007 3:49 pm

How to get the position and size of the DD video panel

Postby chattana » Fri Nov 09, 2007 4:05 pm

Hi Rel,

Please let me know how to get the position and size of the DD video panel, which is the window actually show the video.
I guess these events would provide the video panel information, please correct me if I am wrong:
DDEVENT_BEFORE_RESIZE
DDEVENT_AFTER_RESIZE
DDEVENT_BEFORE_DISPLAYMODE
DDEVENT_AFTER_DISPLAYMODE
DDEVENT_AFTER_INITIALITION

And how to get the position and size for the DD video panel from EventParams?

Thanks

Twinhand 1027
XP
AMD X2 5600
Geforce 8600
User avatar
rel
relocation
Posts: 2051
Joined: Fri Jun 16, 2006 9:50 am

Postby rel » Fri Nov 09, 2007 11:11 pm

To get window handle,
EventParams is a pointer to HWND for DDEVENT_AFTER_INITIALITION

hWindow = *((HWND *) (EventParams))

you can then get the window size with Windows API
RECT rWin;
GetWindowRect(hWindow, &rWin);


You must check and update this value after every DDEVENT_AFTER_RESIZE event.

---------------------

Alternatively you can use DDEVENT_AFTER_RESIZE to get the values:

EventParams is a pointer to a pointer of WINDOWPOS. (double reference)
DDEVENT_AFTER_RESIZE


typedef struct _WINDOWPOS { // wp
HWND hwnd;
HWND hwndInsertAfter;
int x;
int y;
int cx;
int cy;
UINT flags;
} WINDOWPOS;


usage must be something like following line in C
(WINDOWPOS *) ((void *)(*EventParams))


(WINDOWPOS *) ((void *)(*EventParams))->x
(WINDOWPOS *) ((void *)(*EventParams))->Y
(WINDOWPOS *) ((void *)(*EventParams))->cx (width)
(WINDOWPOS *) ((void *)(*EventParams))->cy (height)
DVB Dream - because I have to dream about having time to code it

Return to “Module / Plugin Programming”

Who is online

Users browsing this forum: No registered users and 1 guest