Ask Question Forum:
C
O
M
P
U
T
E
R
2
8
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Y-position of the mouse cursor
Attachment:===
What is BM_CLICK & button id in senddlgitemmessage in VBA

from http://www.experts-exchange.com/Programming/Automation/Q_24679312.html, find out the interesting
question for "Download file Dialog auotmation" , and I get the followng question to ask
Question-1 What is BM_Click meaning ? What is &H5& meaning ?
Question-2 Where I can find out the BM_Click code table and its definition before
I use API senddlgitemmessageW() function ?
Question-3 In Button_ID, where I can find all button_ID defination such assave, cancel but how baout open file button and file type in combbo box(MS excel file, XML file, Web file, *.*) like in saveas file dialog in MS Excel
Question-4 IN Private Declare Function SendDlgItemMessageW Lib "USER32" (ByVal hdlg As Long, ByVal nIDDlgItem As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long,
Could you provide website link or information to explain five variables defination in SendDigtemMessageW()
I just know first one is the window handle.
QUestion-5 Final question is ,sometime, they use ID as &H2 and &HF& what is different if putting
one more "&" in last charter , I mean what is differet &H2 and &H2& ?
That exchange link is good tutorial to start to control and autmation for Dialog box when donwload files
in VBA, if there is good link for this kind tutorial , welcome to send it me
Please advise
Duncan
Attatched for the thread codeOption ExplicitPrivate Const BM_CLICK = &HF5&'// ID on WindowsXP IE8Enum BUTTON_ID[Button_Save] = &H114B[Button_Run] = &H114A[Button_Cancel] = &H2End EnumPrivate Declare Function FindWindowW Lib "user32" (ByVal lpClassName As Long, ByVal lpWindowName As Long) As LongPrivate Declare Function SendDlgItemMessageW Lib "user32" (ByVal hDlg As Long, ByVal nIDDlgItem As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As LongPrivate Declare Function SetForegroundWindow Lib "user32" (ByVal hWnd As Long) As LongPrivate Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)Public Sub ClickButtonIEDlg(dwButton As BUTTON_ID) Dim hDlg As Long hDlg = FindWindowW(0, StrPtr("File Download - Security Warning")) SetForegroundWindow hDlg Sleep 1000 '// sleep here SendDlgItemMessageW hDlg, dwButton, BM_CLICK, 0, 0End SubPrivate Sub Command1_Click()ClickButtonIEDlg Button_SaveEnd Sub
1:2:3:4:5:6:7:8:9:10:11:12:13:14:15:16:17:18:19:20:21:22:23:24:25:26:27:28:
looks like homework...
Visual Basic Language Specification -- 2.2.1 Type Characters
http://msdn.microsoft.com/library/en-us/vbls7/html/vblrfVBSpec2_2_1.asp
x = &H8000
y = &H8000& 'Produces a different value
The trailing ampersand tells VB it's a Long value (4 byte)
#1 BM_Click
the user in that program is defining a message handler and the bm_click is the name of the message with the id being the hex number you see after it. its a constant and the code out from it is its value expressed as hex
#2 its in the code there is no table of them because they are programmer assigned
In windows users can define custom messages they can also override or intercept standard windows messages.
#3 you cant find all button id's he created the id's programmers assign ids to their resources although modern compilers do this for you you can also by hand create the resource file and assign id's and custom message handlers to those id's (that old school though)
ok addendum to 3 you can just get a resource editor and open the executable and you will see all of the id's and names etc.
#4
All windows messages have the same parameters.. and that is what you are seeing..
looks like homework...
Visual Basic Language Specification -- 2.2.1 Type Characters
http://msdn.microsoft.com/library/en-us/vbls7/html/vblrfVBSpec2_2_1.asp
x = &H8000
y = &H8000& 'Produces a different value
The trailing ampersand tells VB it's a Long value (4 byte)
#1 BM_Click
the user in that program is defining a message handler and the bm_click is the name of the message with the id being the hex number you see after it. its a constant and the code out from it is its value expressed as hex
#2 its in the code there is no table of them because they are programmer assigned
In windows users can define custom messages they can also override or intercept standard windows messages.
#3 you cant find all button id's he created the id's programmers assign ids to their resources although modern compilers do this for you you can also by hand create the resource file and assign id's and custom message handlers to those id's (that old school though)
ok addendum to 3 you can just get a resource editor and open the executable and you will see all of the id's and names etc.
#4
All windows messages have the same parameters.. and that is what you are seeing..
looks like homework...
Visual Basic Language Specification -- 2.2.1 Type Characters
http://msdn.microsoft.com/library/en-us/vbls7/html/vblrfVBSpec2_2_1.asp
x = &H8000
y = &H8000& 'Produces a different value
The trailing ampersand tells VB it's a Long value (4 byte)
#1 BM_Click
the user in that program is defining a message handler and the bm_click is the name of the message with the id being the hex number you see after it. its a constant and the code out from it is its value expressed as hex
#2 its in the code there is no table of them because they are programmer assigned
In windows users can define custom messages they can also override or intercept standard windows messages.
#3 you cant find all button id's he created the id's programmers assign ids to their resources although modern compilers do this for you you can also by hand create the resource file and assign id's and custom message handlers to those id's (that old school though)
ok addendum to 3 you can just get a resource editor and open the executable and you will see all of the id's and names etc.
#4
All windows messages have the same parameters.. and that is what you are seeing..
looks like homework...
Visual Basic Language Specification -- 2.2.1 Type Characters
http://msdn.microsoft.com/library/en-us/vbls7/html/vblrfVBSpec2_2_1.asp
x = &H8000
y = &H8000& 'Produces a different value
The trailing ampersand tells VB it's a Long value (4 byte)
#1 BM_Click
the user in that program is defining a message handler and the bm_click is the name of the message with the id being the hex number you see after it. its a constant and the code out from it is its value expressed as hex
#2 its in the code there is no table of them because they are programmer assigned
In windows users can define custom messages they can also override or intercept standard windows messages.
#3 you cant find all button id's he created the id's programmers assign ids to their resources although modern compilers do this for you you can also by hand create the resource file and assign id's and custom message handlers to those id's (that old school though)
ok addendum to 3 you can just get a resource editor and open the executable and you will see all of the id's and names etc.
#4
All windows messages have the same parameters.. and that is what you are seeing..
looks like homework...
Visual Basic Language Specification -- 2.2.1 Type Characters
http://msdn.microsoft.com/library/en-us/vbls7/html/vblrfVBSpec2_2_1.asp
x = &H8000
y = &H8000& 'Produces a different value
The trailing ampersand tells VB it's a Long value (4 byte)
#1 BM_Click
the user in that program is defining a message handler and the bm_click is the name of the message with the id being the hex number you see after it. its a constant and the code out from it is its value expressed as hex
#2 its in the code there is no table of them because they are programmer assigned
In windows users can define custom messages they can also override or intercept standard windows messages.
#3 you cant find all button id's he created the id's programmers assign ids to their resources although modern compilers do this for you you can also by hand create the resource file and assign id's and custom message handlers to those id's (that old school though)
ok addendum to 3 you can just get a resource editor and open the executable and you will see all of the id's and names etc.
#4
All windows messages have the same parameters.. and that is what you are seeing..