Hi all
I am using Windows10 and am struggling with sending a WM_SETTINGCHANGE message out.
According to the following article:
WM_SETTINGCHANGE message (Winuser.h) - Win32 apps | Microsoft Learn
I am supposed to use SendMessageTimeoutA
I can't seem to get my code to work without the application crashing.
Previously we have used SendMessageA , but since the desktop has upgraded to Win10 the application seems to hang when it gets to SendMessageA.
Does anyone have any example code of SendMessageTimeoutA for a WM_SETTINGCHANGE message. Specifically we are changing the international settings on the registry (dateformats, decimal places and so forth). This is a legacy application so I don't want to change the logic too drastically (# if it ain't broke) but I don't quite understand why the SendMessageA is no longer working. All I can think is that there has been a change to the user32.dll on microsoft so that WM_SETTINGCHANGE can no longer be broadcast using SendMessageA
Any advice would be gratefully received
https://learn.microsoft.com/en-us/windows/win32/winmsg/wm-settingchange
is this statement: This message cannot be sent directly to a window.
I don't know if this is a change from past Windows behavior or if Windows 7 and earlier allowed it while Windows 10 does not, but that statement seems pretty clear to me that you can't (or maybe more correrctly, can no longer) do what you are trying to do. The workaround described in the documentation is to use the SendMessageTimeoutA/W API function. The ANSI flavor of WinAPI functions should work OK, it just incurs unnecessary overhead for PB to perform translations between ANSI and Unicode when calling and returning from external functions.