How to detect if my postmessage call fails?
I have a postmessage call which is
lngresult = PostMessage(GetTaskHwnd, WM_LBUTTONDOWN, 0&, ByVal lnglparam)
I wanted to know if postmessage have a return error. Because the above code only click the form with a handle of gettaskHwnd if it is in the top of the screen. If it is on the bottom of the screen, I the command will fail, but I have to programmed it so if it fails it will exit the subroutine and disregard the succeeding code statement.
Re: How to detect if my postmessage call fails?
I recommend use GetLastError.
Is german but you'll se the code :)
Re: How to detect if my postmessage call fails?
You won't need to use GetLastError unless you really want specific information about what happened.
If it failed, lngresult will contain the value 0. If it didn't fail, it will be another value.
chem