Page 1 of 1
HDC property
Posted: Wed Feb 12, 2025 4:31 pm
by Measure
Is there any way to access the HDC property of the control?
-Adam
Re: HDC property
Posted: Thu Feb 13, 2025 3:00 am
by Mike Zubovic
Not really, as far as I could find out.
HDC is kind of specific to a particular technology. We are trying to abstract from that.
But. It is handy for older native apps. We will give it another thought and will see what we can do in the next update.
Thanks for the good question.
Mike Zubovic
Developer
DInsight
Re: HDC property
Posted: Fri Feb 14, 2025 12:20 am
by Mike Zubovic
We have added access to it in today's update 5559.
There are two new integer properties in the control context. HDC has id 9. HWND has id 8. See also
Component Context.
We have tested it in a modified copy of C++ Light sample:
Code: Select all
IView_DGPtr iView = m_DGKern.GetViewDG();
IContext_DGPtr iCont;
iView->GetContext(&iCont);
int hwnd = 0;
iCont->GetInt(8, &hwnd);
HWND hWnd = (HWND)hwnd;
int hdc = 0;
iCont->GetInt(9, &hdc);
HDC hDC = (HDC)hdc;
This is backward compatibility functionality. It should be considered unsupported and not recommended.
The properties will not work for 64 bit apps. We will look at adding it in v7.3.
Regards