SendMessage not working.

Issue #36 closed
Winter Laite created an issue

Works in AHK:

Run("Notepad")
WinWait("Untitled - Notepad")
SendMessage(0x000C, 0, StrPtr("New Notepad Title"))  ; 0X000C is WM_SETTEXT

Still experimenting, but difficult to see how this could work in Keysharp without StrPtr().

Comments (4)

  1. Matt Feemster repo owner

    SendMessage() was indeed broken. I’ve fixed it so please test again.

    Note that you don’t need StrPtr(). The magic of p/invoke takes care of it for you, so just pass the string directly.

  2. Winter Laite reporter

    Tested with code below, works, thank you!

    Run("Notepad")
    WinWait("Untitled - Notepad")
    SendMessage(0x000C, 0, "New Notepad Title")  ; 0X000C is WM_SETTEXT
    

    Please mark resolved and close.

  3. Log in to comment