?
Solved

Disconnecting a windows dialup connection?

Posted on 2003-03-23
11
Medium Priority
?
132 Views
Last Modified: 2010-05-01
how can i do this from within a program?

0
Comment
Question by:idlewilder
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 2
11 Comments
 

Author Comment

by:idlewilder
ID: 8191073
Ok i tried giving a shortcut to my ISP dialup a keyboard shortcut..
(this way i could just use a sendkey tab to the disconnect button)

CTRL + ALT + D

so i went into my program and used

SendKeys "^%{D}"

and it didnt work :(
but if i were to press it now (outside the program) it does work.. hmm???

i even tried

SendKeys "^%D"
and
SendKeys "^%(D)"

but no luck

what am i doing wrong??
many thanks
0
 

Author Comment

by:idlewilder
ID: 8191114
Ok i tried giving a shortcut to my ISP dialup a keyboard shortcut..
(this way i could just use a sendkey tab to the disconnect button)

CTRL + ALT + D

so i went into my program and used

SendKeys "^%{D}"

and it didnt work :(
but if i were to press it now (outside the program) it does work.. hmm???

i even tried

SendKeys "^%D"
and
SendKeys "^%(D)"

but no luck

what am i doing wrong??
many thanks
0
 

Author Comment

by:idlewilder
ID: 8191125
Ok i tried giving a shortcut to my ISP dialup a keyboard shortcut..
(this way i could just use a sendkey tab to the disconnect button)

CTRL + ALT + D

so i went into my program and used

SendKeys "^%{D}"

and it didnt work :(
but if i were to press it now (outside the program) it does work.. hmm???

i even tried

SendKeys "^%D"
and
SendKeys "^%(D)"

but no luck

what am i doing wrong??
many thanks
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:idlewilder
ID: 8191204
Ok i tried giving a shortcut to my ISP dialup a keyboard shortcut..
(this way i could just use a sendkey tab to the disconnect button)

CTRL + ALT + D

so i went into my program and used

SendKeys "^%{D}"

and it didnt work :(
but if i were to press it now (outside the program) it does work.. hmm???

i even tried

SendKeys "^%D"
and
SendKeys "^%(D)"

but no luck

what am i doing wrong??
many thanks
0
 

Author Comment

by:idlewilder
ID: 8191237
Ok i tried giving a shortcut to my ISP dialup a keyboard shortcut..
(this way i could just use a sendkey tab to the disconnect button)

CTRL + ALT + D

so i went into my program and used

SendKeys "^%{D}"

and it didnt work :(
but if i were to press it now (outside the program) it does work.. hmm???

i even tried

SendKeys "^%D"
and
SendKeys "^%(D)"

but no luck

what am i doing wrong??
many thanks
0
 

Author Comment

by:idlewilder
ID: 8191252
Ok i tried giving a shortcut to my ISP dialup a keyboard shortcut..
(this way i could just use a sendkey tab to the disconnect button)

CTRL + ALT + D

so i went into my program and used

SendKeys "^%{D}"

and it didnt work :(
but if i were to press it now (outside the program) it does work.. hmm???

i even tried

SendKeys "^%D"
and
SendKeys "^%(D)"

but no luck

what am i doing wrong??
many thanks
0
 

Author Comment

by:idlewilder
ID: 8191309
Ok i tried giving a shortcut to my ISP dialup a keyboard shortcut..
(this way i could just use a sendkey tab to the disconnect button)

CTRL + ALT + D

so i went into my program and used

SendKeys "^%{D}"

and it didnt work :(
but if i were to press it now (outside the program) it does work.. hmm???

i even tried

SendKeys "^%D"
and
SendKeys "^%(D)"

but no luck

what am i doing wrong??
many thanks
0
 

Author Comment

by:idlewilder
ID: 8191316
How the hell did that happen :(
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 8191858
You are using refresh button from  browser, use Reload this question's link at top left of the page.
0
 
LVL 16

Accepted Solution

by:
Richie_Simonetti earned 300 total points
ID: 8191872
Private Declare Function InternetAutodialHangup Lib "wininet.dll" (ByVal dwReserved As Long) As Long

To disconnect an automatically dial Internet connection use:

If InternetAutodialHangup(0) Then
   MsgBox "Disconnected"
End If
 
(from: http://www.developersdomain.com/vb/codesnippets/internet.htm)
0
 

Author Comment

by:idlewilder
ID: 8192093
wow that worked fantasticly!
and really easy too ;)

sorry for the mess though
thanks
idlewilder
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month13 days, 7 hours left to enroll

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question