>
>Actually, I'm calling my own DLL which are wrapper functions of TAPI, one of the function need a HWND in oder to GetDC() and DrawIcon(). I've tried GetActiveWindow() before, but it always return a handle from VFP's main window or other window handle.
Hmm, sounds like you're trying to draw an icon from its handle rather than a file. Since this is part of the subject of an article in an upcoming issue of FoxPro Advisor, I'm limited by the publication agreement in what I can tell you. What I can say is this: One, I've already given you part of the answer (in the window handle) in this thread; and Two, you don't need to write a DLL to do it.
If you need it to be done as a DLL, however, look at the FindWindowEx()function. You might also look at the functions in the FoxPro API (in the regular help file) or those API functions that Foxtools exposes. The Extended Foxtools Help file is available in the download section under Coding, Syntax and Commands.
hth,
George
Ubi caritas et amor, deus ibi est