summaryrefslogtreecommitdiff
path: root/plugins/Pascal_Headers/reserve/helpers/m_snapping_windows.inc
blob: e3c513482a29d495b9ffd45a0ff3f33bd680c049 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{$IFNDEF SNAPPING_WINDOWS}
{$DEFINE SNAPPING_WINDOWS}

type
  PSnapWindowProc = ^TSnapWindowProc;
  TSnapWindowProc = record
    hWnd           : THWND;
    m_szMoveOffset : TSIZE;
    wParam         : WPARAM;
    lParam         : LPARAM;
    Reserved1      : int;
    Reserved2      : int;
    Reserved3      : int;
  end;

const
  MS_SNAPWINDOWPROC = 'Utils/SnapWindowProc';

function CallSnappingWindowProc(hwnd:hwnd; nMessage:int;
  wParam:WPARAM;lParam:LPARAM):int;// cdecl;
const
  SnapInfo:TSnapWindowProc=();
begin
  result:=0;
  if (nMessage=WM_MOVING) or (nMessage=WM_NCLBUTTONDOWN) or
     (nMessage=WM_SYSCOMMAND) or (nMessage=WM_SIZING) then
  begin
    SnapInfo.hWnd   := hwnd;
    SnapInfo.wParam := wParam;
    SnapInfo.lParam := lParam;
    CallService(MS_SNAPWINDOWPROC,WPARAM(@SnapInfo),nMessage);
    if nMessage=WM_SIZING then result:=1;
  end;
end;
{$ENDIF}