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
How to get the position and size of the DD video panel
Moderators: Dreamer, FredB, X05
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)
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