Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Disconnecting a windows dialup connection?

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

0
Comment
Question by:idlewilder
  • 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month11 days, 8 hours left to enroll

564 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