Device context handles are not valid when passed cross-process. So what you are attempting to do is not possible.
As for your other questions:
Is it possible to have an
HDC
that is not associated with anHWND
?
Yes that is perfectly possible. Plenty of device contexts are not associated with windows.
How I can get the
HWND
of the window which call DrawTextEx?
Windows do not call functions, code calls functions. So, the question does not really mean anything.