Ask Question Forum:
Model Library:2025-02-08:A.I. model is online auto reply
C
O
M
P
U
T
E
R
2
8
Show
#
ASK
RECENT
←
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Below area will not be traslated by Google,you can input code or other languages
Hint:If find spelling error, You need to correct it,1 by 1 or ignore it (code area won't be checked).
X-position of the mouse cursor
Y-position of the mouse cursor
Y-position of the mouse cursor
Testcursor
caretPos
Attachment:===
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
Author: duncanb7 replied at 2024-10-21 06:56:17
it works fine and thanks for all of you to reply
Accepted Solution
Expert: xxlc replied at 2024-10-20 17:23:28
500 points EXCELLENT