Jim Dettman
jimdettman at verizon.net
Fri Dec 10 14:52:22 CST 2010
Susan, <<FindWindow -- but I can't get it to return anything but 0???>> FindWindow() only returns top level windows and not child windows. So this will only fetch the main Access window. This: Function apicFindWindow() 'Get window handle. Dim hWnd As Long hWnd = FindWindow("oMAIN", vbNullString) Debug.Print hWnd End Function Will return the handle of the first Access window it finds. Jim. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Susan Harkins Sent: Friday, December 10, 2010 02:12 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Office API's > Private Declare Function BringWindowToTop Lib "user32" (ByVal lngHWnd As > Long) As Long ======This one begs the function, FindWindow -- but I can't get it to return anything but 0??? I can get the class Okay, but the window name/caption -- I must be passing the wrong strings. I really don't have a clue what to pass and I'm just guessing. I've tried several different strings, and everything returns 0 -- any help? Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _ (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Function apicFindWindow() 'Get window handle. Dim hWnd As Long hWnd = FindWindow("oMAIN", "Table2") Debug.Print hWnd End Function Susan H. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com