borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (How do you simulate a right-click?)Next Topic (get macaddress from ip) New Topic New Poll Post Reply
AndreaVB Forum : API : How to say automatically "OK" when the prompt box "Save as" occurs ?
Poster Message
elaw
Level: Guest


icon How to say automatically "OK" when the prompt box "Save as" occurs ?

Hi everybody,
I used the api Public Declare Function DoFileDownload Lib \"shdocvw.dll\" (ByVal lpszFile As String) As Long to go to a specific http website to download a file but I don\'t know how to say \"OK\" to the windows dialog box caption\"Save as\".
Who knows how to say ok  or to send this specific key?
Thanks  

04-04-2004 at 06:57 AM
| Quote Reply
practrainee
Level: Sage

Registered: 26-01-2005
Posts: 68
icon Re: How to say automatically "OK" when the prompt box "Save as" occurs ?

i wan to create a button that can recall 'save as window' to save the form opened..

could u pass me de code that u used (api).
maybe it could hel me..ok

thanx

15-02-2005 at 04:35 AM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
omidk
Level: Protégé

Registered: 19-03-2005
Posts: 6
icon Re: How to say automatically "OK" when the prompt box "Save as" occurs ?

you have to know the caption of the saveas window that opens.
if this window opens (that u can check it  just by using getwindowtext and passing getforegroundwindow to it) then u use findwindowex function to get the handle of the button and then u use findwindowrect to have the coordinates of the button after that use sendinput to simulate clicking with it.
then ok is clicked automatically and the window disapears.

06-04-2005 at 01:39 PM
View Profile Send Email to User Show All Posts | Quote Reply
Asim-GDI GURU
Level: Sage

Registered: 29-07-2005
Posts: 54
icon 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.

12-08-2005 at 11:16 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : API : How to say automatically "OK" when the prompt box "Save as" occurs ?
Previous Topic (How do you simulate a right-click?)Next Topic (get macaddress from ip) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder