消息类后台发送
提示:这里可以添加技术概要
核心源码
uses commctrl;
function HeaderProc(wnd: HWND; Msg: Cardinal; wParam: wParam; lParam: lParam): Longint;
stdcall;
var
hti: THDHitTestInfo;
begin
Result := CallWindowProc(Pointer(GetWindowLong(wnd, GWL_USERDATA)),
wnd, Msg, wParam, lParam);
if Msg = WM_LBUTTONDBLCLK then
begin
FillChar(hti, SizeOf(hti), 0);
hti.Point := SmallPointToPoint(TSmallPoint(lParam));
if SendMessage(wnd, HDM_HITTEST, 0, Longint(@hti)) >= 0 then
if hti.Flags = HHT_ONHEADER then
// would usually send a custom notification to GetParent(wnd) here
Form1.Memo1.Lines.Add(Format(‘doubleclick on header item %d’, [hti.Item]));
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
wnd: HWND;
buffer: array [0…80] of Char;
oldProc: