Asked by duncanb7
at 2024-10-20 14:14:37
Point:500 Replies:2 POST_ID:828385USER_ID:11059
Topic:
VB Script;;Visual Basic Programming
I'am doing automation for download 100 files from one website, before
clicking save button after clicking download bar in the website, I would like
to see the filename is matched to my expect or not before I click the save button.
SO I try to read the filename in the download popup daiglog window's "Edit"(WM_Edit) box.
For example, the following simplify code, And I use SpY++ to check the download
diaglog windows 's HWND and found "edit" box 's HWND shown
on SPY++ too, but I could not extract the title name(it means the filename in edit box)
by getwindowtext with getwindowtextlength. I can get the title of "button" class name
in the download popup dialog window but always failed to get the title of the "edit" (WM_EDIT) classname
whose title name should be same as the default download filename sent or provided by the website
Sub test()
Dim hdlg as string
hdlg = findwinodw(vbnullstring, "Download files Window" ' That appears after clicking the
download bar in the webiste
hdlg2 =findwindowEx(hdlg, 0, "Edit", vbnullstring) ' There is edit box for users to change the filename
from the default filename but it is failed and hdlg2 alwayws is 0
debug.print Getwindowtextlength(hdgl2), but it also failed, it showed nothing
End Sub
PLease advise, what is wrong with the code, WHen I test the "button" class name that is
okay I can get the title of "SAVE" with debug.print but not for "Edit" class name
SPy++ show the title of the "Edit box" is same as filename in Edit box in the daiglog windows,
it should be really easy to extract but it is fail and I hung up here.
Duncan
clicking save button after clicking download bar in the website, I would like
to see the filename is matched to my expect or not before I click the save button.
SO I try to read the filename in the download popup daiglog window's "Edit"(WM_Edit) box.
For example, the following simplify code, And I use SpY++ to check the download
diaglog windows 's HWND and found "edit" box 's HWND shown
on SPY++ too, but I could not extract the title name(it means the filename in edit box)
by getwindowtext with getwindowtextlength. I can get the title of "button" class name
in the download popup dialog window but always failed to get the title of the "edit" (WM_EDIT) classname
whose title name should be same as the default download filename sent or provided by the website
Sub test()
Dim hdlg as string
hdlg = findwinodw(vbnullstring, "Download files Window" ' That appears after clicking the
download bar in the webiste
hdlg2 =findwindowEx(hdlg, 0, "Edit", vbnullstring) ' There is edit box for users to change the filename
from the default filename but it is failed and hdlg2 alwayws is 0
debug.print Getwindowtextlength(hdgl2), but it also failed, it showed nothing
End Sub
PLease advise, what is wrong with the code, WHen I test the "button" class name that is
okay I can get the title of "SAVE" with debug.print but not for "Edit" class name
SPy++ show the title of the "Edit box" is same as filename in Edit box in the daiglog windows,
it should be really easy to extract but it is fail and I hung up here.
Duncan