VB Code:
'the needed function
Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWndParent As Long, ByVal hWndChildAfter As Long, ByVal lpszClassName As String, ByVal lpszCaption As String) As Long
'for this to work you either need to know the window handle of the login window, or the classname of it if not
'assuming first you know the window handle (which I'll call hWnd)
Dim hWndFind As Long
'get the first child window with the class "Edit" (a textbox to VB)
hWndFind = FindWindowEx(hWnd, 0, "Edit", vbNullString)
'go through the rest of the children
Do Until hWndFind = 0
'if you get here, hWndFind is the handle to an edit control, so do something with it
'look for the next edit control
hWndFind = FindWindowEx(hWnd, hWndFind, "Edit", vbNullString)
Loop
'now if you don't know hWnd, you'll have to do this, which requires you to know the name of the dialog's class
Dim hWnd As Long
hWnd = FindWindowEx(0, 0, "dialogclassname", vbNullString)
'then you can use the above process