I have been trying various methods to destroy windows, but can't seem to make them work. I can set focus api correctly, and bring the application to the foregrounds, but destroywindow doesn't kill the window. Does anyone have an example for this that really works? Thanks. Scott Baxter Private Declare Function DestroyWindow Lib "user32" (ByVal hwnd As Long) As Long hHandle = FindWindowEx(0&, 0&, vbNullString, "File Download") Call DestroyWindow(hHandle)
"Web Search Store" wrote in message news:%23vvzqV%23OGHA.3360@TK2MSFTNGP09.phx.gbl... >I have been trying various methods to destroy windows, but can't seem to >make them work. I can set focus api correctly, and bring the application >to the foregrounds, but destroywindow doesn't kill the window. > > Does anyone have an example for this that really works? > > > Thanks. > > Scott Baxter > > Private Declare Function DestroyWindow Lib "user32" (ByVal hwnd As Long) > As Long > > hHandle = FindWindowEx(0&, 0&, vbNullString, "File Download") > Call DestroyWindow(hHandle) There's quite a few great samples here that may help. Process Related http://www.thescarms.com/vbasic/VBProcessRelated.asp Window Related Functions http://www.thescarms.com/vbasic/VBWindowFunctions.asp -- Ken Halter - MS-MVP-VB - Please keep all discussions in the groups.. DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm Freeware 4 color Gradient Frame? http://www.vbsight.com/GradFrameCTL.htm