Results 1 to 3 of 3

Thread: How to detect if my postmessage call fails?

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2007
    Posts
    15

    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.

  2. #2
    Addicted Member Kal-El's Avatar
    Join Date
    Jun 2007
    Location
    Fortress of solitude
    Posts
    179

    Re: How to detect if my postmessage call fails?

    I recommend use GetLastError.
    Is german but you'll se the code

    «Source Code»«plugins»«skin»«fav apps»«Winamp en español»«Nsis en español»
    So what if your signature move is driving a tractor? I think it's adorable. - Lois ("Crimson")
    Don't forget to when your question is resolved ...and the people who help

  3. #3
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    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

    Visual Studio 6, Visual Studio.NET 2005, MASM

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