Asim-GDI GURU Level: Sage
 Registered: 29-07-2005 Posts: 54
|
Re: How to say automatically "OK" when the prompt box "Save as" occurs ?
Hello Folks,
I'm not sure my post will be of any help to you people now after so long.The solution to this problem is very simple.You may have seen that when a SaveAs window opens, you only need to press enter and then the respective file will be downloaded where the last file was saved.So what you've to do is to just press enter after the SaveAs window is opened.For doing so, there's a very simple example I'm showing.
' Declarations...
Private Const VK_SELECT As Long = &H29
Declare Sub keybd_event Lib "user32.dll" ( _
ByVal bVk As Byte, _
ByVal bScan As Byte, _
ByVal dwFlags As Long, _
ByVal dwExtraInfo As Long)
Declare Function MapVirtualKeyEx Lib "user32.dll" Alias "MapVirtualKeyExA" ( _
ByVal uCode As Long, _
ByVal uMapType As Long, _
ByVal dwhkl As Long) As Long
' Coding...
Scan = MapVirtualKeyEx(VK_SELECT,0)
Call keybd_event(VK_SELECT,Scan,0,0)
Call keybd_event(VK_SELECT,Scan,2,0)
' <- The End ->
So this coding will cause "Enter" to be pressed.Thats it.Infact this way you can press any key on your standard keyboard...
Acknowledge me if its useful...
Regards,
Asim Siddiqui.
|