|
-
Aug 4th, 2000, 01:38 PM
#1
Thread Starter
Fanatic Member
hi,
i know how to run a program using the shell line, but i am writing a program that shuts your computer down, after an alloted time, but i want to close winap first, what code do i use to close it.
Thanks
Merlin ?
Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
-- Linus Torvalds
[ Galahtech.com] | [ My Site] | [ Fishsponge] | [ UnixForum.co.uk]
-
Aug 4th, 2000, 01:42 PM
#2
_______
<?>
Code:
'bas module code
Public Declare Function ExitWindowsEx Lib "user32" _
(ByVal uflags As Long, ByVal dwReserved As Long) As Long
Public Const EXIT_LOGOFF = 0
Public Const EXIT_SHUTDOWN = 1
Public Const EXIT_REBOOT = 2
'shutdown windows
Public Sub ShutDown(uflags As Long)
Call ExitWindowsEx(uflags, 0)
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Aug 4th, 2000, 01:52 PM
#3
To close Winamp:
Code:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As Any, ByVal lpWindowName As Any) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Const WM_CLOSE = &H10
Private Sub Command1_Click()
'Get the handle of Winamp
Retval = FindWindow(0&, "Winamp 2.5e")
'Close Winamp
SendMessage Retval, WM_CLOSE, 0&, 0&
End Sub
-
Aug 4th, 2000, 01:57 PM
#4
Thread Starter
Fanatic Member
hi,
thanks for the info, but all this does is shutdown windows, i want to close the program first, if not i shall write my own mp3 player, do u have any infor on making one
Cheers
Merlin ?
Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
-- Linus Torvalds
[ Galahtech.com] | [ My Site] | [ Fishsponge] | [ UnixForum.co.uk]
-
Aug 4th, 2000, 02:06 PM
#5
_______
<?>
sorry, I figured if you close windows, windows will close winamp...
Megatron has supplied code to kill winamp.
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Aug 4th, 2000, 03:52 PM
#6
If you would like information on building your own MP3 player, see this link.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|