Please help with executing shortcuts from VB4 Enterprise 
Author Message
 Please help with executing shortcuts from VB4 Enterprise

Howdy all,  hope you have time for a question for a newbie.

Specific question:  Why won't VB execute a shortcut, just like any other
program with the Shell function and AppActivate?

Application:  I'm trying to write a program to use to close down faxworks
and open dial-up networking to get on the Internet, and then do the
opposite when I log off.  To close faxworks, I have put the focus on that
window and SendKeys Alt F4 to faxworks.  Then I should be able to open
dial-up networking by executing the shortcut on my desktop to my internet
connection:

MyAppID = Shell("c:\windows\desktop\isp.lnk", 1)    
AppActivate MyAppID

where isp.lnk is the name of the shortcut to the internet connection in the
dial-up networking system folder.

Unfortunately when I try this, I get a Run-time error 5:  Invalid procedure
call.

Any help will be greatly appreciated.  Please send all mail to

Dan Magidson



Wed, 20 Oct 1999 03:00:00 GMT  
 Please help with executing shortcuts from VB4 Enterprise

Dan-
        Try either one of these.
_____snip-____________________________________
Option Explicit

Private Declare Function ShellExecute Lib "shell32.dll" Alias _
    "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
    ByVal lpFile As String, ByVal lpParameters As String, _
    ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Private Sub Command1_Click()
    Dim ret&
    ret = ShellExecute(Me.hwnd, "", _
        "c:\windows\desktop\isp.lnk", _
        "", "", 1)
    ' This should work, too
    'ret = Shell("rundll32.exe rnaui.dll,RnaDial " & "ISP", 1)
End Sub
_____________________________snip_________________
--
***********************************************************

http://www.tiac.net/users/lvasseur/freeware.html
Resume, etc:
http://www.tiac.net/users/lvasseur/index.html
"Recompense injury with justice, and recompense
kindness with kindness."   Confucius
**********************************************************



Quote:
> Howdy all,  hope you have time for a question for a newbie.

> Specific question:  Why won't VB execute a shortcut, just like any other
> program with the Shell function and AppActivate?

> Application:  I'm trying to write a program to use to close down faxworks
> and open dial-up networking to get on the Internet, and then do the
> opposite when I log off.  To close faxworks, I have put the focus on that
> window and SendKeys Alt F4 to faxworks.  Then I should be able to open
> dial-up networking by executing the shortcut on my desktop to my internet
> connection:

> MyAppID = Shell("c:\windows\desktop\isp.lnk", 1)    
> AppActivate MyAppID

> where isp.lnk is the name of the shortcut to the internet connection in
the
> dial-up networking system folder.

> Unfortunately when I try this, I get a Run-time error 5:  Invalid
procedure
> call.

> Any help will be greatly appreciated.  Please send all mail to

> Dan Magidson



Thu, 21 Oct 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Executing shortcuts from VB4 code (newbie needs help)

2. Problems with MSSQL and VB4 Enterprise...PLEASE HELP!! :)

3. How to Execute a Shortcut in VB4 ?

4. PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP,

5. Migration from vb4.0 Enterprise to Vb 6.0 Enterprise

6. Help executing shortcuts from VB

7. VB4 Enterprise or VB4 Pro + OO4O

8. VB4 Enterprise or VB4 Pro + OO4O

9. Help VB4 Enterprise

10. PLEASE HELP, buy VB 5.0 Enterprise or Profesionnal

11. Can anyone HELP me PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE

12. Could you help me please about my shortcut

 

 
Powered by phpBB® Forum Software