To stop a connection Internet with AOL?
Posted: Mon Jun 09, 2003 10:51 am
Hi all,
How to make for To stop a connection Internet with AOL?
Thanks
How to make for To stop a connection Internet with AOL?

Thanks
http://www.purebasic.com
https://www.purebasic.fr/english/
Code: Select all
hInternetSession.l = InternetOpen_("FTP", #INTERNET_OPEN_TYPE_DIRECT, "", "", 0)
.... snip .....
hInternetConnect = InternetConnect_(hInternetSession.l, IPAddress, #INTERNET_DEFAULT_FTP_PORT, UserName, Password, #INTERNET_SERVICE_FTP, 0, 0)
--- snip ---
; Disconnect the Internet session.
If hInternetSession
If hInternetConnect
InternetCloseHandle_(hInternetConnect)
hInternetConnect = #FALSE
Else
TextGadget(13, 20, 230, 300, 20, "No network connection to close")
EndIf
InternetCloseHandle_(hInternetSession)
hInternetSession = #FALSE
Else
TextGadget(13, 20, 230, 400, 20, "No Internet access to close")
EndIf
If InternetAutodialHangup_(0)
Else
MessageRequester("Failure warning!","You will have to disconnect your internet connection manually!"+Chr(10)+Chr(10)+"Sorry, my automated attempt has failed...",0)
EndIf
Code: Select all
;-ini
Structure info
handle.l
process.l
class$
name$
EndStructure
#PROCESS_ALL_ACCESS=$FFF
NewList info.info()
NewList AllHandle()
Procedure.s GetClassName(handle)
class$=Space(1024)
GetClassName_(handle,@class$,Len(class$))
ProcedureReturn Left(class$,Len(class$))
EndProcedure
Procedure.s GetTitle(handle)
name$=Space(1024)
GetWindowText_(handle,@name$,Len(name$))
ProcedureReturn Left(name$,Len(name$))
EndProcedure
Procedure AddInfo(Handle)
process=0
GetWindowThreadProcessId_(handle,@process)
Class$=GetClassName(handle)
Name$=GetTitle(handle)
ResetList(info())
quit=0
i=0
Repeat
If NextElement(info())
If process < info()\process
quit=1
ElseIf process=info()\process
If class$ < info()\class$
quit=1
ElseIf UCase(class$)=UCase(info()\class$)
If name$ < info()\name$
quit=1
ElseIf UCase(name$)=UCase(info()\name$)
If handle < info()\handle
quit=1
ElseIf handle=info()\handle
quit=3
EndIf
EndIf
EndIf
EndIf
Else
quit=2
EndIf
Until quit
If quit<3
If quit=1
If PreviousElement(info())=0: ResetList(info()) :EndIf
EndIf
AddElement(info())
info()\handle=handle
info()\process=process
info()\class$=class$
info()\name$=name$
If class$ = "IEFrame"
postmessage_(info()\handle,#wm_close,0,0)
EndIf
EndIf
EndProcedure
Procedure TerminateProcess(processid)
process=OpenProcess_(#PROCESS_ALL_ACCESS,1,processid)
If process
terminateprocess_(process,0)
closehandle_(process)
EndIf
EndProcedure
Procedure RefreshList()
ClearGadgetItemList(0)
ClearList(allhandle())
ClearList(info())
handle=getwindow_(WindowID(),#GW_HWNDFIRST)
ClearList(allhandle())
quit=0
Repeat
AddInfo(handle)
x=getwindow_(handle,#GW_CHILD)
If x
AddElement(allhandle())
allhandle()=x
EndIf
x=getwindow_(handle,#GW_HWNDNEXT)
If x
handle=x
Else
If LastElement(allhandle())
handle=allhandle()
DeleteElement(allhandle())
Else
quit=1
EndIf
EndIf
Until quit
ResetList(info())
While NextElement(info())
If oldprocess<>info()\process
oldprocess=info()\process
a$=Hex(oldprocess)
Else
a$=" ''"
EndIf
AddGadgetItem(0,-1,a$+Chr(10)+info()\class$+Chr(10)+info()\name$+Chr(10)+Hex(info()\handle))
Wend
SetGadgetState(0,0)
EndProcedure
If OpenWindow(0,0,400,512,320,#PB_Window_SystemMenu,"Tasks")
If CreateGadgetList(WindowID())
ListIconGadget(0, 0,0,512,300, "Process",60)
AddGadgetColumn(0,1,"Class",220)
AddGadgetColumn(0,2,"Name",150)
AddGadgetColumn(0,3,"Handle",50)
ButtonGadget(1, 0,300, 128,20,"Send Quit")
ButtonGadget(2, 128,300, 128,20,"Send Close")
ButtonGadget(3, 256,300, 128,20,"Terminate Process")
ButtonGadget(4, 384,300, 128,20,"Refresh List")
RefreshList()
Repeat
event=WaitWindowEvent()
Select event
Case #pb_event_gadget
stat=GetGadgetState(0)
If stat>-1
SelectElement(info(),stat)
stat=1
Else
stat=0
EndIf
Select EventGadgetID()
; Case 0:
; If stat
; Debug Hex(info()\process)+" | "+info()\class$+" | "+info()\name$+" | "+Hex(info()\handle)
; EndIf
Case 1;quit
If stat: postmessage_(info()\handle,#wm_quit,0,0):EndIf
Case 2;close
If stat: postmessage_(info()\handle,#wm_close,0,0):EndIf
Case 3;Terminate
If stat: TerminateProcess(info()\process) :EndIf
Case 4
RefreshList()
EndSelect
EndSelect
Until event=#pb_event_Closewindow
EndIf
EndIf
Code: Select all
;-ini
Structure info
handle.l
process.l
class$
name$
EndStructure
#PROCESS_ALL_ACCESS=$FFF
NewList info.info()
NewList AllHandle()
Procedure.s GetClassName(handle)
class$=Space(1024)
GetClassName_(handle,@class$,Len(class$))
ProcedureReturn Left(class$,Len(class$))
EndProcedure
Procedure.s GetTitle(handle)
name$=Space(1024)
GetWindowText_(handle,@name$,Len(name$))
ProcedureReturn Left(name$,Len(name$))
EndProcedure
Procedure AddInfo(Handle)
process=0
GetWindowThreadProcessId_(handle,@process)
Class$=GetClassName(handle)
Name$=GetTitle(handle)
ResetList(info())
quit=0
i=0
Repeat
If NextElement(info())
If process < info()\process
quit=1
ElseIf process=info()\process
If class$ < info()\class$
quit=1
ElseIf UCase(class$)=UCase(info()\class$)
If name$ < info()\name$
quit=1
ElseIf UCase(name$)=UCase(info()\name$)
If handle < info()\handle
quit=1
ElseIf handle=info()\handle
quit=3
EndIf
EndIf
EndIf
EndIf
Else
quit=2
EndIf
Until quit
If quit<3
If quit=1
If PreviousElement(info())=0: ResetList(info()) :EndIf
EndIf
AddElement(info())
info()\handle=handle
info()\process=process
info()\class$=class$
info()\name$=name$
If class$ = "IEFrame"
postmessage_(info()\handle,#wm_close,0,0)
EndIf
EndIf
EndProcedure
Procedure RefreshList()
handle=getwindow_(WindowID(),#GW_HWNDFIRST)
quit=0
Repeat
AddInfo(handle)
x=getwindow_(handle,#GW_CHILD)
If x
AddElement(allhandle())
allhandle()=x
EndIf
x=getwindow_(handle,#GW_HWNDNEXT)
If x
handle=x
Else
If LastElement(allhandle())
handle=allhandle()
DeleteElement(allhandle())
Else
quit=1
EndIf
EndIf
Until quit
ResetList(info())
While NextElement(info())
If oldprocess<>info()\process
oldprocess=info()\process
a$=Hex(oldprocess)
Else
a$=" ''"
EndIf
; AddGadgetItem(0,-1,a$+Chr(10)+info()\class$+Chr(10)+info()\name$+Chr(10)+Hex(info()\handle))
Wend
; SetGadgetState(0,0)
EndProcedure
Procedure ResizeWebWindow()
ResizeGadget(10, -1, -1, WindowWidth(), WindowHeight())
EndProcedure
OpenWindow(0, 0, 0, 797, 550, #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget, "ACE the CSET Single Subject Math")
CreateGadgetList(WindowID(0))
; Frame3DGadget(6, 0, 30, 0, 2, "", 2) ; Nice little separator
appdir$=Space(255) : GetCurrentDirectory_(255,@appdir$) : If Right(appdir$,1)<>"\" : appdir$+"\" : EndIf
url$=appdir$+"MYLOCALHTMLPAGE.htm"
If WebGadget(10, 0, 0, 0, 0, url$) = 0 : MessageRequester("Error", "ATL.dll not found", 0) : End : EndIf
;AddKeyboardShortcut(0, #PB_Shortcut_Return, 0)
ResizeWebWindow()
RefreshList()
Repeat
RefreshList()
Event = WaitWindowEvent()
Select Event
Case #PB_Event_Gadget
Select EventGadgetID()
EndSelect
EndSelect
Until Event = #PB_Event_CloseWindow
;EndIf
;EndIf
RefreshList()
End