PDA

Click to See Complete Forum and Search --> : Using Sendmessage API calls.. result in VB6 being closed when app "END"?


Athenis
Jan 10th, 2000, 09:41 PM
Hi,
I've tried using the Sendmessage call found from www.thescarms.com (http://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?

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

WadeD
Jan 10th, 2000, 10:01 PM
This works for me:

In module:

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:

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).]