[V2-Beta.3] Sendmessage example Topic is solved

Report problems with documented functionality
AHK_user
Posts: 515
Joined: 04 Dec 2015, 14:52
Location: Belgium

[V2-Beta.3] Sendmessage example

30 Apr 2022, 15:17

I was testing out the Sendmessage example of V2, it seems to work fine, except when you hover over the notepad window with your mouse, the title changes back to the original. If I run the V1 example, the title stays changed. :think:

1. Can somebody else check this behaviour?
2. Is StrPtr maybe the wrong approach?

Code: Select all

Run "Notepad"
WinWait "Untitled - Notepad"
SendMessage 0x000C, 0, StrPtr("New Notepad Title")  ; 0X000C is WM_SETTEXT
V1 code that seems to work fine

Code: Select all

Run Notepad
WinWait Untitled - Notepad
SendMessage, 0x000C, 0, "New Notepad Title"  ; 0x000C is WM_SETTEXT
lexikos
Posts: 9635
Joined: 30 Sep 2013, 04:07
Contact:

Re: [V2-Beta.3] Sendmessage example  Topic is solved

30 Apr 2022, 18:29

That's impossible. If the title changes to the correct string, the string obviously came through. The parameters are correct. If the title changes back after the script exits, that's got nothing to do with the script.

I tested the v2 code on Windows 7, and the title did not revert, no matter what I did to the window.

I tested the v2 code on Windows 11, and it failed utterly. ;) Microsoft have replaced good old Notepad with a UWP app. UWP apps don't like SendMessage.

Edit: Tested in classic Notepad on Windows 11 (after removing the UWP version), and the title did not revert. Even if it did, it is impossible for this to be caused by a bug in SendMessage.
Last edited by lexikos on 24 May 2022, 05:50, edited 1 time in total.
Reason: More testing
AHK_user
Posts: 515
Joined: 04 Dec 2015, 14:52
Location: Belgium

Re: [V2-Beta.3] Sendmessage example

01 May 2022, 16:46

I was testing it on Windows 10.
I made the script persistant, but this did not changed the behaviour.

Strange that V1 works and V2 fails.

The command WinSetTitle gives the same problem, the title changes, but if you hover over it, it reverts to the old title.
(Probably this is the same code in the end.)

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 7 guests