Files
PulsarK-main/Pulsar.Server/Helper/NativeMethodsHelper.cs
T
i2p 773d05f8f1
Pulsar .NET 9.0 Windows Release / build (push) Waiting to run
Mirror to Codeberg and Gitea / mirror (push) Waiting to run
initial commit
2026-08-27 10:57:58 -06:00

36 lines
1.0 KiB
C#

using Pulsar.Server.Utilities;
using System;
namespace Pulsar.Server.Helper
{
public static class NativeMethodsHelper
{
private const int LVM_FIRST = 0x1000;
private const int LVM_SETITEMSTATE = LVM_FIRST + 43;
private const int WM_VSCROLL = 277;
private static readonly IntPtr SB_PAGEBOTTOM = new IntPtr(7);
public static int MakeWin32Long(short wLow, short wHigh)
{
return (int)wLow << 16 | (int)(short)wHigh;
}
public static void SetItemState(IntPtr handle, int itemIndex, int mask, int value)
{
NativeMethods.LVITEM lvItem = new NativeMethods.LVITEM
{
stateMask = mask,
state = value
};
NativeMethods.SendMessageListViewItem(handle, LVM_SETITEMSTATE, new IntPtr(itemIndex), ref lvItem);
}
public static void ScrollToBottom(IntPtr handle)
{
NativeMethods.SendMessage(handle, WM_VSCROLL, SB_PAGEBOTTOM, IntPtr.Zero);
}
}
}