Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

VB - Close program

  • 15-01-2003 6:54pm
    #1
    Closed Accounts Posts: 219 ✭✭


    Visual Basic 6

    hi was just wondering if anyone can give me some advice
    i am trying to write a progam so that when i click a button it will close kazaa down but the thing is that when i click the button it just goes down into the system-tray. if i use the code for notepad or something it closes it stright away. so i guess the question is how to i close stuff from the system-tray.

    code below:

    'find the app
    Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
    (ByVal lpClassName As String, _
    ByVal lpWindowName As String) _
    As Long

    'send the app a close message

    Declare Function SendMessage _
    Lib "user32" Alias "SendMessageA" _
    (ByVal hwnd As Long, _
    ByVal wMsg As Long, _
    ByVal wParam As Long, _
    lParam As Long) _
    As Long


    Private Sub Command1_Click()
    Dim Handle As Long
    Const NILL = 0&
    Const WM_SYSCOMMAND = &H112
    Const SC_CLOSE = &HF060&



    Handle = FindWindow("kazaa", vbNullString)


    Handle = SendMessage(Handle, WM_SYSCOMMAND, SC_CLOSE, NILL)

    End Sub


Comments

  • Registered Users, Registered Users 2 Posts: 629 ✭✭✭str8_away


    Does Kasaa has an option that says "close to system tray"?
    I know some programs have that option.


Advertisement