Falcondl
Jan 6th, 2001, 04:31 AM
How would i do something like that?
I've run into some problems trying to get the window handle of the "Enter Password" dialog box for Outlook when it starts up, as in it wont fricking work. ;)
its one of those windows that's not a child of "microsoft outlook" but "microsoft outlook" is the parent of the window. (to see what i mean go in SpyXX and find some window at the top level that has a parent.
i tried FindWindow(vbNullString, "Enter Password"), which didn't work, and then
hwnd = FindWindow(vbNullstring, "Microsoft Outlook"
tmphwnd = getWindow(getdesktopwindow(), GW_CHILD)
do while true
if getparent(tmphwnd)=hwnd
MSGBOX "SUCCESS"
tmphwnd = Getwindow(tmphwnd, GW_HWNDNEXT)
Loop
so that gets the handle of outlook, then gets the handle of the desktop, then find first child window. Checks to see if the parent of that child window is the handle of Microsoft Outlook, and if not, goes on to the next child window. rinse and repeat. ;)
The problem is, it never finds it. When i run this with notepad, or the calculator, and then have the About box open with them (the about box is a dialog box also, and isn't really a child window, but its parent is the calculator. It shows up on the same level as the calculator in SpyXX) it works fine. But it wont work with outlook, and its driving me crazy.
anyone run into any similiar problems, have any suggestions, or know how to do this without getwindow/findwindow? :)
I've run into some problems trying to get the window handle of the "Enter Password" dialog box for Outlook when it starts up, as in it wont fricking work. ;)
its one of those windows that's not a child of "microsoft outlook" but "microsoft outlook" is the parent of the window. (to see what i mean go in SpyXX and find some window at the top level that has a parent.
i tried FindWindow(vbNullString, "Enter Password"), which didn't work, and then
hwnd = FindWindow(vbNullstring, "Microsoft Outlook"
tmphwnd = getWindow(getdesktopwindow(), GW_CHILD)
do while true
if getparent(tmphwnd)=hwnd
MSGBOX "SUCCESS"
tmphwnd = Getwindow(tmphwnd, GW_HWNDNEXT)
Loop
so that gets the handle of outlook, then gets the handle of the desktop, then find first child window. Checks to see if the parent of that child window is the handle of Microsoft Outlook, and if not, goes on to the next child window. rinse and repeat. ;)
The problem is, it never finds it. When i run this with notepad, or the calculator, and then have the About box open with them (the about box is a dialog box also, and isn't really a child window, but its parent is the calculator. It shows up on the same level as the calculator in SpyXX) it works fine. But it wont work with outlook, and its driving me crazy.
anyone run into any similiar problems, have any suggestions, or know how to do this without getwindow/findwindow? :)