Results 1 to 2 of 2

Thread: Using Sendmessage API calls.. result in VB6 being closed when app "END"?

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 1999
    Location
    Singapore
    Posts
    32

    Post

    Hi,
    I've tried using the Sendmessage call found from www.thescarms.com
    The weird thing is when I used an END statement to terminate my app, it closes VB too!
    What did I do wrong?

    ------------------

  2. #2
    Hyperactive Member
    Join Date
    Nov 1999
    Posts
    363

    Post

    This works for me:

    In module:
    Code:
    Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    Public Const WM_CLOSE = &H10
    In your form:
    Code:
    Dim lRetVal As Long
    
    RetVal = PostMessage(lhwnd, WM_CLOSE, 0&, 0&)
    Set lhwnd to be the handle of the window that you're closing.
    Wade




    [This message has been edited by WadeD (edited 01-11-2000).]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width