Enenra
Enenra
CC#
Created by Enenra on 8/1/2023 in #help
❔ Using System Colors
2 replies
CC#
Created by Enenra on 12/17/2022 in #help
❔ WM_FONTCHANGE
Hi, I was recommended to give WM_FONTCHANGE a try yesterday but after reading through mcs docs and watching a video I still have no idea how I'd implement this. https://learn.microsoft.com/en-us/windows/win32/gdi/wm-fontchange https://learn.microsoft.com/en-us/previous-versions/dd398104(v=vs.100) I tried implementing it by pasting somebody else's code but I've failed even at that:
public const int WM_FONTCHANGE = 0x001D;

[DllImport("user32.dll", CharSet = CharSet.Auto)]
private static extern int SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
void Test()
{
long msg = SendMessage(IntPtr.Zero, WM_FONTCHANGE, IntPtr.Zero, IntPtr.Zero);
MessageBox.Show(msg.ToString());
}
public const int WM_FONTCHANGE = 0x001D;

[DllImport("user32.dll", CharSet = CharSet.Auto)]
private static extern int SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
void Test()
{
long msg = SendMessage(IntPtr.Zero, WM_FONTCHANGE, IntPtr.Zero, IntPtr.Zero);
MessageBox.Show(msg.ToString());
}
https://stackoverflow.com/questions/19453516/c-sharp-font-able-to-be-used-after-loading I couldn't find where they declared and assigned to HWND_BROADCAST so I passed IntPtr.Zero like I've seen in a youtube video(although it was not related to this function). I am not getting any errors but when I MB.Show(msg.ToString()) it shows 0 and my font isn't updated. There is a possibility that this function is not working but I don't have an idea how I'd test it.
4 replies
CC#
Created by Enenra on 12/16/2022 in #help
❔ Log out and in without password
2 replies