JwaWinUser.pas
上传用户:davidchvip
上传日期:2009-07-28
资源大小:1749k
文件大小:670k
源码类别:

Windows编程

开发平台:

Delphi

  1. {******************************************************************************}
  2. {                                                                       }
  3. { Windows User API interface Unit for Object Pascal                            }
  4. {                                                                       }
  5. { Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft          }
  6. { Corporation. All Rights Reserved.                                            }
  7. {                 }
  8. { The original file is: winuser.h, released June 2000. The original Pascal     }
  9. { code is: WinUser.pas, released December 2000. The initial developer of the   }
  10. { Pascal code is Marcel van Brakel (brakelm@chello.nl).                        }
  11. {                                                                              }
  12. { Portions created by Marcel van Brakel are Copyright (C) 1999-2001            }
  13. { Marcel van Brakel. All Rights Reserved.                                      }
  14. {                 }
  15. { Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI)        }
  16. {                }
  17. { You may retrieve the latest version of this file at the Project JEDI home    }
  18. { page, located at http://delphi-jedi.org or my personal homepage located at   }
  19. { http://members.chello.nl/m.vanbrakel2                                        }
  20. {                }
  21. { The contents of this file are used with permission, subject to the Mozilla   }
  22. { Public License Version 1.1 (the "License"); you may not use this file except }
  23. { in compliance with the License. You may obtain a copy of the License at      }
  24. { http://www.mozilla.org/MPL/MPL-1.1.html                                      }
  25. {                                                                              }
  26. { Software distributed under the License is distributed on an "AS IS" basis,   }
  27. { WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
  28. { the specific language governing rights and limitations under the License.    }
  29. {                                                                              }
  30. { Alternatively, the contents of this file may be used under the terms of the  }
  31. { GNU Lesser General Public License (the  "LGPL License"), in which case the   }
  32. { provisions of the LGPL License are applicable instead of those above.        }
  33. { If you wish to allow use of your version of this file only under the terms   }
  34. { of the LGPL License and not to allow others to use your version of this file }
  35. { under the MPL, indicate your decision by deleting  the provisions above and  }
  36. { replace  them with the notice and other provisions required by the LGPL      }
  37. { License.  If you do not delete the provisions above, a recipient may use     }
  38. { your version of this file under either the MPL or the LGPL License.          }
  39. {                 }
  40. { For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
  41. {                 }
  42. {******************************************************************************}
  43. unit JwaWinUser;
  44. {$WEAKPACKAGEUNIT}
  45. {$HPPEMIT ''}
  46. {$HPPEMIT '#include "WinUser.h"'}
  47. {$HPPEMIT ''}
  48. {$I WINDEFINES.INC}
  49. interface
  50. uses
  51.   JwaWinBase, JwaWinGDI, JwaWinNT, JwaWinType;
  52. const
  53.   UINT_MAX = UINT($FFFFFFFF); // from limits.h TODO
  54.   {$EXTERNALSYM UINT_MAX}
  55. type
  56.   HDWP = HANDLE;
  57.   {$EXTERNALSYM HDWP}
  58.   MENUTEMPLATEA = Pointer;
  59.   {$EXTERNALSYM MENUTEMPLATEA}
  60.   MENUTEMPLATEW = Pointer;
  61.   {$EXTERNALSYM MENUTEMPLATEW}
  62. {$IFDEF UNICODE}
  63.   MENUTEMPLATE = MENUTEMPLATEW;
  64.   {$EXTERNALSYM MENUTEMPLATE}
  65. {$ELSE}
  66.   MENUTEMPLATE = MENUTEMPLATEA;
  67.   {$EXTERNALSYM MENUTEMPLATE}
  68. {$ENDIF}
  69.   LPMENUTEMPLATEA = PVOID;
  70.   {$EXTERNALSYM LPMENUTEMPLATEA}
  71.   LPMENUTEMPLATEW = PVOID;
  72.   {$EXTERNALSYM LPMENUTEMPLATEW}
  73. {$IFDEF UNICODE}
  74.   LPMENUTEMPLATE = LPMENUTEMPLATEW;
  75.   {$EXTERNALSYM LPMENUTEMPLATE}
  76. {$ELSE}
  77.   LPMENUTEMPLATE = LPMENUTEMPLATEA;
  78.   {$EXTERNALSYM LPMENUTEMPLATE}
  79. {$ENDIF}
  80.   WNDPROC = function (hWnd: HWND; uMsg: UINT; lParam: WPARAM; wParam: LPARAM): LRESULT;
  81.   {$EXTERNALSYM WNDPROC}
  82.   DLGPROC = function (hwndDlg: HWND; wMsg: UINT; wParam: WPARAM; lParam: LPARAM): INT_PTR; stdcall;
  83.   {$EXTERNALSYM DLGPROC}
  84.   TIMERPROC = procedure (hwnd: HWND; uMsg: UINT; idEvent: UINT_PTR; dwTime: DWORD); stdcall;
  85.   {$EXTERNALSYM TIMERPROC}
  86.   GRAYSTRINGPROC = function (hdc: HDC; lpData: LPARAM; cchData: Integer): BOOL; stdcall;
  87.   {$EXTERNALSYM GRAYSTRINGPROC}
  88.   WNDENUMPROC = function (hwnd: HWND; lParam: LPARAM): BOOL; stdcall;
  89.   {$EXTERNALSYM WNDENUMPROC}
  90.   HOOKPROC = function (nCode: Integer; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
  91.   {$EXTERNALSYM HOOKPROC}
  92.   SENDASYNCPROC = procedure (hwnd: HWND; uMsg: UINT; dwData: ULONG_PTR; lResult: LRESULT); stdcall;
  93.   {$EXTERNALSYM SENDASYNCPROC}
  94.   PROPENUMPROCA = function (hwnd: HWND; lpszString: LPCSTR; hData: HANDLE): BOOL; stdcall;
  95.   {$EXTERNALSYM PROPENUMPROCA}
  96.   PROPENUMPROCW = function (hwnd: HWND; lpszString: LPCWSTR; hData: HANDLE): BOOL; stdcall;
  97.   {$EXTERNALSYM PROPENUMPROCW}
  98.   PROPENUMPROCEXA = function (hwnd: HWND; lpszString: LPSTR; hData: HANDLE; dwData: ULONG_PTR): BOOL; stdcall;
  99.   {$EXTERNALSYM PROPENUMPROCEXA}
  100.   PROPENUMPROCEXW = function (hwnd: HWND; lpszString: LPWSTR; hData: HANDLE; dwData: ULONG_PTR): BOOL; stdcall;
  101.   {$EXTERNALSYM PROPENUMPROCEXW}
  102.   EDITWORDBREAKPROCA = function (lpch: LPSTR; ichCurrent: Integer; cch, code: Integer): Integer; stdcall;
  103.   {$EXTERNALSYM EDITWORDBREAKPROCA}
  104.   EDITWORDBREAKPROCW = function (lpch: LPWSTR; ichCurrent: Integer; cch, code: Integer): Integer; stdcall;
  105.   {$EXTERNALSYM EDITWORDBREAKPROCW}
  106.   DRAWSTATEPROC = function (hdc: HDC; lData: LPARAM; wData: WPARAM; cx, cy: Integer): BOOL; stdcall;
  107.   {$EXTERNALSYM DRAWSTATEPROC}
  108. {$IFDEF UNICODE}
  109.   PROPENUMPROC = PROPENUMPROCW;
  110.   {$EXTERNALSYM PROPENUMPROC}
  111.   PROPENUMPROCEX = PROPENUMPROCEXW;
  112.   {$EXTERNALSYM PROPENUMPROCEX}
  113.   EDITWORDBREAKPROC = EDITWORDBREAKPROCW;
  114.   {$EXTERNALSYM EDITWORDBREAKPROC}
  115. {$ELSE}
  116.   PROPENUMPROC = PROPENUMPROCA;
  117.   {$EXTERNALSYM PROPENUMPROC}
  118.   PROPENUMPROCEX = PROPENUMPROCEXA;
  119.   {$EXTERNALSYM PROPENUMPROCEX}
  120.   EDITWORDBREAKPROC = EDITWORDBREAKPROCA;
  121.   {$EXTERNALSYM EDITWORDBREAKPROC}
  122. {$ENDIF}
  123.   NAMEENUMPROCA = function (lpstr: LPSTR; lParam: LPARAM): BOOL; stdcall;
  124.   {$EXTERNALSYM NAMEENUMPROCA}
  125.   NAMEENUMPROCW = function (lpstr: LPWSTR; lParam: LPARAM): BOOL; stdcall;
  126.   {$EXTERNALSYM NAMEENUMPROCW}
  127.   WINSTAENUMPROCA = NAMEENUMPROCA;
  128.   {$EXTERNALSYM WINSTAENUMPROCA}
  129.   DESKTOPENUMPROCA = NAMEENUMPROCA;
  130.   {$EXTERNALSYM DESKTOPENUMPROCA}
  131.   WINSTAENUMPROCW = NAMEENUMPROCW;
  132.   {$EXTERNALSYM WINSTAENUMPROCW}
  133.   DESKTOPENUMPROCW = NAMEENUMPROCW;
  134.   {$EXTERNALSYM DESKTOPENUMPROCW}
  135. {$IFDEF UNICODE}
  136.   WINSTAENUMPROC = WINSTAENUMPROCW;
  137.   {$EXTERNALSYM WINSTAENUMPROC}
  138.   DESKTOPENUMPROC = DESKTOPENUMPROCW;
  139.   {$EXTERNALSYM DESKTOPENUMPROC}
  140. {$ELSE}
  141.   WINSTAENUMPROC = WINSTAENUMPROCA;
  142.   {$EXTERNALSYM WINSTAENUMPROC}
  143.   DESKTOPENUMPROC = DESKTOPENUMPROCA;
  144.   {$EXTERNALSYM DESKTOPENUMPROC}
  145. {$ENDIF}
  146. function IS_INTRESOURCE(wInteger: WORD): BOOL;
  147. {$EXTERNALSYM IS_INTRESOURCE}
  148. type
  149.   MAKEINTRESOURCEA = LPSTR;
  150.   {$EXTERNALSYM MAKEINTRESOURCEA}
  151.   MAKEINTRESOURCEW = LPWSTR;
  152.   {$EXTERNALSYM MAKEINTRESOURCEW}
  153. {$IFDEF UNICODE}
  154.   MAKEINTRESOURCE = MAKEINTRESOURCEW;
  155.   {$EXTERNALSYM MAKEINTRESOURCE}
  156. {$ELSE}
  157.   MAKEINTRESOURCE = MAKEINTRESOURCEA;
  158.   {$EXTERNALSYM MAKEINTRESOURCE}
  159. {$ENDIF}
  160. //
  161. // Predefined Resource Types
  162. //
  163. const
  164.   RT_CURSOR       = MAKEINTRESOURCE(1);
  165.   {$EXTERNALSYM RT_CURSOR}
  166.   RT_BITMAP       = MAKEINTRESOURCE(2);
  167.   {$EXTERNALSYM RT_BITMAP}
  168.   RT_ICON         = MAKEINTRESOURCE(3);
  169.   {$EXTERNALSYM RT_ICON}
  170.   RT_MENU         = MAKEINTRESOURCE(4);
  171.   {$EXTERNALSYM RT_MENU}
  172.   RT_DIALOG       = MAKEINTRESOURCE(5);
  173.   {$EXTERNALSYM RT_DIALOG}
  174.   RT_STRING       = MAKEINTRESOURCE(6);
  175.   {$EXTERNALSYM RT_STRING}
  176.   RT_FONTDIR      = MAKEINTRESOURCE(7);
  177.   {$EXTERNALSYM RT_FONTDIR}
  178.   RT_FONT         = MAKEINTRESOURCE(8);
  179.   {$EXTERNALSYM RT_FONT}
  180.   RT_ACCELERATOR  = MAKEINTRESOURCE(9);
  181.   {$EXTERNALSYM RT_ACCELERATOR}
  182.   RT_RCDATA       = MAKEINTRESOURCE(10);
  183.   {$EXTERNALSYM RT_RCDATA}
  184.   RT_MESSAGETABLE = MAKEINTRESOURCE(11);
  185.   {$EXTERNALSYM RT_MESSAGETABLE}
  186.   DIFFERENCE = 11;
  187.   {$EXTERNALSYM DIFFERENCE}
  188.   RT_GROUP_CURSOR = MAKEINTRESOURCE(ULONG_PTR(RT_CURSOR) + DIFFERENCE);
  189.   {$EXTERNALSYM RT_GROUP_CURSOR}
  190.   RT_GROUP_ICON = MAKEINTRESOURCE(ULONG_PTR(RT_ICON) + DIFFERENCE);
  191.   {$EXTERNALSYM RT_GROUP_ICON}
  192.   RT_VERSION    = MAKEINTRESOURCE(16);
  193.   {$EXTERNALSYM RT_VERSION}
  194.   RT_DLGINCLUDE = MAKEINTRESOURCE(17);
  195.   {$EXTERNALSYM RT_DLGINCLUDE}
  196.   RT_PLUGPLAY   = MAKEINTRESOURCE(19);
  197.   {$EXTERNALSYM RT_PLUGPLAY}
  198.   RT_VXD        = MAKEINTRESOURCE(20);
  199.   {$EXTERNALSYM RT_VXD}
  200.   RT_ANICURSOR  = MAKEINTRESOURCE(21);
  201.   {$EXTERNALSYM RT_ANICURSOR}
  202.   RT_ANIICON    = MAKEINTRESOURCE(22);
  203.   {$EXTERNALSYM RT_ANIICON}
  204.   RT_HTML       = MAKEINTRESOURCE(23);
  205.   {$EXTERNALSYM RT_HTML}
  206.   RT_MANIFEST   = MAKEINTRESOURCE(24);
  207.   CREATEPROCESS_MANIFEST_RESOURCE_ID = MAKEINTRESOURCE(1);
  208.   {$EXTERNALSYM CREATEPROCESS_MANIFEST_RESOURCE_ID}
  209.   ISOLATIONAWARE_MANIFEST_RESOURCE_ID = MAKEINTRESOURCE(2);
  210.   {$EXTERNALSYM ISOLATIONAWARE_MANIFEST_RESOURCE_ID}
  211.   ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID = MAKEINTRESOURCE(3);
  212.   {$EXTERNALSYM ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID}
  213.   MINIMUM_RESERVED_MANIFEST_RESOURCE_ID = MAKEINTRESOURCE(1{inclusive});
  214.   {$EXTERNALSYM MINIMUM_RESERVED_MANIFEST_RESOURCE_ID}
  215.   MAXIMUM_RESERVED_MANIFEST_RESOURCE_ID = MAKEINTRESOURCE(16{inclusive});
  216.   {$EXTERNALSYM MAXIMUM_RESERVED_MANIFEST_RESOURCE_ID}
  217. type
  218.   va_list = PChar;
  219.   {$EXTERNALSYM va_list}
  220. function wvsprintfA(Output: LPSTR; Format: LPCSTR; arglist: va_list): Integer; stdcall;
  221. {$EXTERNALSYM wvsprintfA}
  222. function wvsprintfW(Output: LPWSTR; Format: LPCWSTR; arglist: va_list): Integer; stdcall;
  223. {$EXTERNALSYM wvsprintfW}
  224. {$IFDEF UNICODE}
  225. function wvsprintf(Output: LPWSTR; Format: LPCWSTR; arglist: va_list): Integer; stdcall;
  226. {$EXTERNALSYM wvsprintf}
  227. {$ELSE}
  228. function wvsprintf(Output: LPSTR; Format: LPCSTR; arglist: va_list): Integer; stdcall;
  229. {$EXTERNALSYM wvsprintf}
  230. {$ENDIF}
  231. function wsprintfA(Output: LPSTR; Format: LPCSTR): Integer; stdcall;
  232. {$EXTERNALSYM wsprintfA}
  233. function wsprintfW(Output: LPWSTR; Format: LPCWSTR): Integer; stdcall;
  234. {$EXTERNALSYM wsprintfW}
  235. {$IFDEF UNICODE}
  236. function wsprintf(Output: LPWSTR; Format: LPCWSTR): Integer; stdcall;
  237. {$EXTERNALSYM wsprintf}
  238. {$ELSE}
  239. function wsprintf(Output: LPSTR; Format: LPCSTR): Integer; stdcall;
  240. {$EXTERNALSYM wsprintf}
  241. {$ENDIF}
  242. //
  243. // SPI_SETDESKWALLPAPER defined constants
  244. //
  245. const
  246.   SETWALLPAPER_DEFAULT = LPWSTR(-1);
  247.   {$EXTERNALSYM SETWALLPAPER_DEFAULT}
  248. //
  249. // Scroll Bar Constants
  250. //
  251.   SB_HORZ = 0;
  252.   {$EXTERNALSYM SB_HORZ}
  253.   SB_VERT = 1;
  254.   {$EXTERNALSYM SB_VERT}
  255.   SB_CTL  = 2;
  256.   {$EXTERNALSYM SB_CTL}
  257.   SB_BOTH = 3;
  258.   {$EXTERNALSYM SB_BOTH}
  259. //
  260. // Scroll Bar Commands
  261. //
  262.   SB_LINEUP        = 0;
  263.   {$EXTERNALSYM SB_LINEUP}
  264.   SB_LINELEFT      = 0;
  265.   {$EXTERNALSYM SB_LINELEFT}
  266.   SB_LINEDOWN      = 1;
  267.   {$EXTERNALSYM SB_LINEDOWN}
  268.   SB_LINERIGHT     = 1;
  269.   {$EXTERNALSYM SB_LINERIGHT}
  270.   SB_PAGEUP        = 2;
  271.   {$EXTERNALSYM SB_PAGEUP}
  272.   SB_PAGELEFT      = 2;
  273.   {$EXTERNALSYM SB_PAGELEFT}
  274.   SB_PAGEDOWN      = 3;
  275.   {$EXTERNALSYM SB_PAGEDOWN}
  276.   SB_PAGERIGHT     = 3;
  277.   {$EXTERNALSYM SB_PAGERIGHT}
  278.   SB_THUMBPOSITION = 4;
  279.   {$EXTERNALSYM SB_THUMBPOSITION}
  280.   SB_THUMBTRACK    = 5;
  281.   {$EXTERNALSYM SB_THUMBTRACK}
  282.   SB_TOP           = 6;
  283.   {$EXTERNALSYM SB_TOP}
  284.   SB_LEFT          = 6;
  285.   {$EXTERNALSYM SB_LEFT}
  286.   SB_BOTTOM        = 7;
  287.   {$EXTERNALSYM SB_BOTTOM}
  288.   SB_RIGHT         = 7;
  289.   {$EXTERNALSYM SB_RIGHT}
  290.   SB_ENDSCROLL     = 8;
  291.   {$EXTERNALSYM SB_ENDSCROLL}
  292. //
  293. // ShowWindow() Commands
  294. //
  295.   SW_HIDE            = 0;
  296.   {$EXTERNALSYM SW_HIDE}
  297.   SW_SHOWNORMAL      = 1;
  298.   {$EXTERNALSYM SW_SHOWNORMAL}
  299.   SW_NORMAL          = 1;
  300.   {$EXTERNALSYM SW_NORMAL}
  301.   SW_SHOWMINIMIZED   = 2;
  302.   {$EXTERNALSYM SW_SHOWMINIMIZED}
  303.   SW_SHOWMAXIMIZED   = 3;
  304.   {$EXTERNALSYM SW_SHOWMAXIMIZED}
  305.   SW_MAXIMIZE        = 3;
  306.   {$EXTERNALSYM SW_MAXIMIZE}
  307.   SW_SHOWNOACTIVATE  = 4;
  308.   {$EXTERNALSYM SW_SHOWNOACTIVATE}
  309.   SW_SHOW            = 5;
  310.   {$EXTERNALSYM SW_SHOW}
  311.   SW_MINIMIZE        = 6;
  312.   {$EXTERNALSYM SW_MINIMIZE}
  313.   SW_SHOWMINNOACTIVE = 7;
  314.   {$EXTERNALSYM SW_SHOWMINNOACTIVE}
  315.   SW_SHOWNA          = 8;
  316.   {$EXTERNALSYM SW_SHOWNA}
  317.   SW_RESTORE         = 9;
  318.   {$EXTERNALSYM SW_RESTORE}
  319.   SW_SHOWDEFAULT     = 10;
  320.   {$EXTERNALSYM SW_SHOWDEFAULT}
  321.   SW_FORCEMINIMIZE   = 11;
  322.   {$EXTERNALSYM SW_FORCEMINIMIZE}
  323.   SW_MAX             = 11;
  324.   {$EXTERNALSYM SW_MAX}
  325. //
  326. // Old ShowWindow() Commands
  327. //
  328.   HIDE_WINDOW         = 0;
  329.   {$EXTERNALSYM HIDE_WINDOW}
  330.   SHOW_OPENWINDOW     = 1;
  331.   {$EXTERNALSYM SHOW_OPENWINDOW}
  332.   SHOW_ICONWINDOW     = 2;
  333.   {$EXTERNALSYM SHOW_ICONWINDOW}
  334.   SHOW_FULLSCREEN     = 3;
  335.   {$EXTERNALSYM SHOW_FULLSCREEN}
  336.   SHOW_OPENNOACTIVATE = 4;
  337.   {$EXTERNALSYM SHOW_OPENNOACTIVATE}
  338. //
  339. // Identifiers for the WM_SHOWWINDOW message
  340. //
  341.   SW_PARENTCLOSING = 1;
  342.   {$EXTERNALSYM SW_PARENTCLOSING}
  343.   SW_OTHERZOOM     = 2;
  344.   {$EXTERNALSYM SW_OTHERZOOM}
  345.   SW_PARENTOPENING = 3;
  346.   {$EXTERNALSYM SW_PARENTOPENING}
  347.   SW_OTHERUNZOOM   = 4;
  348.   {$EXTERNALSYM SW_OTHERUNZOOM}
  349. //
  350. // AnimateWindow() Commands
  351. //
  352.   AW_HOR_POSITIVE = $00000001;
  353.   {$EXTERNALSYM AW_HOR_POSITIVE}
  354.   AW_HOR_NEGATIVE = $00000002;
  355.   {$EXTERNALSYM AW_HOR_NEGATIVE}
  356.   AW_VER_POSITIVE = $00000004;
  357.   {$EXTERNALSYM AW_VER_POSITIVE}
  358.   AW_VER_NEGATIVE = $00000008;
  359.   {$EXTERNALSYM AW_VER_NEGATIVE}
  360.   AW_CENTER       = $00000010;
  361.   {$EXTERNALSYM AW_CENTER}
  362.   AW_HIDE         = $00010000;
  363.   {$EXTERNALSYM AW_HIDE}
  364.   AW_ACTIVATE     = $00020000;
  365.   {$EXTERNALSYM AW_ACTIVATE}
  366.   AW_SLIDE        = $00040000;
  367.   {$EXTERNALSYM AW_SLIDE}
  368.   AW_BLEND        = $00080000;
  369.   {$EXTERNALSYM AW_BLEND}
  370. //
  371. // WM_KEYUP/DOWN/CHAR HIWORD(lParam) flags
  372. //
  373.   KF_EXTENDED = $0100;
  374.   {$EXTERNALSYM KF_EXTENDED}
  375.   KF_DLGMODE  = $0800;
  376.   {$EXTERNALSYM KF_DLGMODE}
  377.   KF_MENUMODE = $1000;
  378.   {$EXTERNALSYM KF_MENUMODE}
  379.   KF_ALTDOWN  = $2000;
  380.   {$EXTERNALSYM KF_ALTDOWN}
  381.   KF_REPEAT   = $4000;
  382.   {$EXTERNALSYM KF_REPEAT}
  383.   KF_UP       = $8000;
  384.   {$EXTERNALSYM KF_UP}
  385. //
  386. // Virtual Keys, Standard Set
  387. //
  388.   VK_LBUTTON = $01;
  389.   {$EXTERNALSYM VK_LBUTTON}
  390.   VK_RBUTTON = $02;
  391.   {$EXTERNALSYM VK_RBUTTON}
  392.   VK_CANCEL  = $03;
  393.   {$EXTERNALSYM VK_CANCEL}
  394.   VK_MBUTTON = $04; // NOT contiguous with L & RBUTTON
  395.   {$EXTERNALSYM VK_MBUTTON}
  396.   VK_XBUTTON1 = $05; // NOT contiguous with L & RBUTTON
  397.   {$EXTERNALSYM VK_XBUTTON1}
  398.   VK_XBUTTON2 = $06; // NOT contiguous with L & RBUTTON
  399.   {$EXTERNALSYM VK_XBUTTON2}
  400. //
  401. // 0x07 : unassigned
  402. //
  403.   VK_BACK = $08;
  404.   {$EXTERNALSYM VK_BACK}
  405.   VK_TAB  = $09;
  406.   {$EXTERNALSYM VK_TAB}
  407. //
  408. // 0x0A - 0x0B : reserved
  409. //
  410.   VK_CLEAR  = $0C;
  411.   {$EXTERNALSYM VK_CLEAR}
  412.   VK_RETURN = $0D;
  413.   {$EXTERNALSYM VK_RETURN}
  414.   VK_SHIFT   = $10;
  415.   {$EXTERNALSYM VK_SHIFT}
  416.   VK_CONTROL = $11;
  417.   {$EXTERNALSYM VK_CONTROL}
  418.   VK_MENU    = $12;
  419.   {$EXTERNALSYM VK_MENU}
  420.   VK_PAUSE   = $13;
  421.   {$EXTERNALSYM VK_PAUSE}
  422.   VK_CAPITAL = $14;
  423.   {$EXTERNALSYM VK_CAPITAL}
  424.   VK_KANA    = $15;
  425.   {$EXTERNALSYM VK_KANA}
  426.   VK_HANGEUL = $15; // old name - should be here for compatibility
  427.   {$EXTERNALSYM VK_HANGEUL}
  428.   VK_HANGUL  = $15;
  429.   {$EXTERNALSYM VK_HANGUL}
  430.   VK_JUNJA   = $17;
  431.   {$EXTERNALSYM VK_JUNJA}
  432.   VK_FINAL   = $18;
  433.   {$EXTERNALSYM VK_FINAL}
  434.   VK_HANJA   = $19;
  435.   {$EXTERNALSYM VK_HANJA}
  436.   VK_KANJI   = $19;
  437.   {$EXTERNALSYM VK_KANJI}
  438.   VK_ESCAPE = $1B;
  439.   {$EXTERNALSYM VK_ESCAPE}
  440.   VK_CONVERT    = $1C;
  441.   {$EXTERNALSYM VK_CONVERT}
  442.   VK_NONCONVERT = $1D;
  443.   {$EXTERNALSYM VK_NONCONVERT}
  444.   VK_ACCEPT     = $1E;
  445.   {$EXTERNALSYM VK_ACCEPT}
  446.   VK_MODECHANGE = $1F;
  447.   {$EXTERNALSYM VK_MODECHANGE}
  448.   VK_SPACE    = $20;
  449.   {$EXTERNALSYM VK_SPACE}
  450.   VK_PRIOR    = $21;
  451.   {$EXTERNALSYM VK_PRIOR}
  452.   VK_NEXT     = $22;
  453.   {$EXTERNALSYM VK_NEXT}
  454.   VK_END      = $23;
  455.   {$EXTERNALSYM VK_END}
  456.   VK_HOME     = $24;
  457.   {$EXTERNALSYM VK_HOME}
  458.   VK_LEFT     = $25;
  459.   {$EXTERNALSYM VK_LEFT}
  460.   VK_UP       = $26;
  461.   {$EXTERNALSYM VK_UP}
  462.   VK_RIGHT    = $27;
  463.   {$EXTERNALSYM VK_RIGHT}
  464.   VK_DOWN     = $28;
  465.   {$EXTERNALSYM VK_DOWN}
  466.   VK_SELECT   = $29;
  467.   {$EXTERNALSYM VK_SELECT}
  468.   VK_PRINT    = $2A;
  469.   {$EXTERNALSYM VK_PRINT}
  470.   VK_EXECUTE  = $2B;
  471.   {$EXTERNALSYM VK_EXECUTE}
  472.   VK_SNAPSHOT = $2C;
  473.   {$EXTERNALSYM VK_SNAPSHOT}
  474.   VK_INSERT   = $2D;
  475.   {$EXTERNALSYM VK_INSERT}
  476.   VK_DELETE   = $2E;
  477.   {$EXTERNALSYM VK_DELETE}
  478.   VK_HELP     = $2F;
  479.   {$EXTERNALSYM VK_HELP}
  480. //
  481. // VK_0 - VK_9 are the same as ASCII '0' - '9' (0x30 - 0x39)
  482. // 0x40 : unassigned
  483. // VK_A - VK_Z are the same as ASCII 'A' - 'Z' (0x41 - 0x5A)
  484. //
  485.   VK_LWIN = $5B;
  486.   {$EXTERNALSYM VK_LWIN}
  487.   VK_RWIN = $5C;
  488.   {$EXTERNALSYM VK_RWIN}
  489.   VK_APPS = $5D;
  490.   {$EXTERNALSYM VK_APPS}
  491. //
  492. // 0x5E : reserved
  493. //
  494.   VK_SLEEP = $5F;
  495.   {$EXTERNALSYM VK_SLEEP}
  496.   VK_NUMPAD0   = $60;
  497.   {$EXTERNALSYM VK_NUMPAD0}
  498.   VK_NUMPAD1   = $61;
  499.   {$EXTERNALSYM VK_NUMPAD1}
  500.   VK_NUMPAD2   = $62;
  501.   {$EXTERNALSYM VK_NUMPAD2}
  502.   VK_NUMPAD3   = $63;
  503.   {$EXTERNALSYM VK_NUMPAD3}
  504.   VK_NUMPAD4   = $64;
  505.   {$EXTERNALSYM VK_NUMPAD4}
  506.   VK_NUMPAD5   = $65;
  507.   {$EXTERNALSYM VK_NUMPAD5}
  508.   VK_NUMPAD6   = $66;
  509.   {$EXTERNALSYM VK_NUMPAD6}
  510.   VK_NUMPAD7   = $67;
  511.   {$EXTERNALSYM VK_NUMPAD7}
  512.   VK_NUMPAD8   = $68;
  513.   {$EXTERNALSYM VK_NUMPAD8}
  514.   VK_NUMPAD9   = $69;
  515.   {$EXTERNALSYM VK_NUMPAD9}
  516.   VK_MULTIPLY  = $6A;
  517.   {$EXTERNALSYM VK_MULTIPLY}
  518.   VK_ADD       = $6B;
  519.   {$EXTERNALSYM VK_ADD}
  520.   VK_SEPARATOR = $6C;
  521.   {$EXTERNALSYM VK_SEPARATOR}
  522.   VK_SUBTRACT  = $6D;
  523.   {$EXTERNALSYM VK_SUBTRACT}
  524.   VK_DECIMAL   = $6E;
  525.   {$EXTERNALSYM VK_DECIMAL}
  526.   VK_DIVIDE    = $6F;
  527.   {$EXTERNALSYM VK_DIVIDE}
  528.   VK_F1        = $70;
  529.   {$EXTERNALSYM VK_F1}
  530.   VK_F2        = $71;
  531.   {$EXTERNALSYM VK_F2}
  532.   VK_F3        = $72;
  533.   {$EXTERNALSYM VK_F3}
  534.   VK_F4        = $73;
  535.   {$EXTERNALSYM VK_F4}
  536.   VK_F5        = $74;
  537.   {$EXTERNALSYM VK_F5}
  538.   VK_F6        = $75;
  539.   {$EXTERNALSYM VK_F6}
  540.   VK_F7        = $76;
  541.   {$EXTERNALSYM VK_F7}
  542.   VK_F8        = $77;
  543.   {$EXTERNALSYM VK_F8}
  544.   VK_F9        = $78;
  545.   {$EXTERNALSYM VK_F9}
  546.   VK_F10       = $79;
  547.   {$EXTERNALSYM VK_F10}
  548.   VK_F11       = $7A;
  549.   {$EXTERNALSYM VK_F11}
  550.   VK_F12       = $7B;
  551.   {$EXTERNALSYM VK_F12}
  552.   VK_F13       = $7C;
  553.   {$EXTERNALSYM VK_F13}
  554.   VK_F14       = $7D;
  555.   {$EXTERNALSYM VK_F14}
  556.   VK_F15       = $7E;
  557.   {$EXTERNALSYM VK_F15}
  558.   VK_F16       = $7F;
  559.   {$EXTERNALSYM VK_F16}
  560.   VK_F17       = $80;
  561.   {$EXTERNALSYM VK_F17}
  562.   VK_F18       = $81;
  563.   {$EXTERNALSYM VK_F18}
  564.   VK_F19       = $82;
  565.   {$EXTERNALSYM VK_F19}
  566.   VK_F20       = $83;
  567.   {$EXTERNALSYM VK_F20}
  568.   VK_F21       = $84;
  569.   {$EXTERNALSYM VK_F21}
  570.   VK_F22       = $85;
  571.   {$EXTERNALSYM VK_F22}
  572.   VK_F23       = $86;
  573.   {$EXTERNALSYM VK_F23}
  574.   VK_F24       = $87;
  575.   {$EXTERNALSYM VK_F24}
  576. //
  577. // 0x88 - 0x8F : unassigned
  578. //
  579.   VK_NUMLOCK = $90;
  580.   {$EXTERNALSYM VK_NUMLOCK}
  581.   VK_SCROLL  = $91;
  582.   {$EXTERNALSYM VK_SCROLL}
  583. //
  584. // NEC PC-9800 kbd definitions
  585. //
  586.   VK_OEM_NEC_EQUAL = $92; // '=' key on numpad
  587.   {$EXTERNALSYM VK_OEM_NEC_EQUAL}
  588. //
  589. // Fujitsu/OASYS kbd definitions
  590. //
  591.   VK_OEM_FJ_JISHO   = $92; // 'Dictionary' key
  592.   {$EXTERNALSYM VK_OEM_FJ_JISHO}
  593.   VK_OEM_FJ_MASSHOU = $93; // 'Unregister word' key
  594.   {$EXTERNALSYM VK_OEM_FJ_MASSHOU}
  595.   VK_OEM_FJ_TOUROKU = $94; // 'Register word' key
  596.   {$EXTERNALSYM VK_OEM_FJ_TOUROKU}
  597.   VK_OEM_FJ_LOYA    = $95; // 'Left OYAYUBI' key
  598.   {$EXTERNALSYM VK_OEM_FJ_LOYA}
  599.   VK_OEM_FJ_ROYA    = $96; // 'Right OYAYUBI' key
  600.   {$EXTERNALSYM VK_OEM_FJ_ROYA}
  601. //
  602. // 0x97 - 0x9F : unassigned
  603. //
  604. //
  605. // VK_L* & VK_R* - left and right Alt, Ctrl and Shift virtual keys.
  606. // Used only as parameters to GetAsyncKeyState() and GetKeyState().
  607. // No other API or message will distinguish left and right keys in this way.
  608. //
  609.   VK_LSHIFT   = $A0;
  610.   {$EXTERNALSYM VK_LSHIFT}
  611.   VK_RSHIFT   = $A1;
  612.   {$EXTERNALSYM VK_RSHIFT}
  613.   VK_LCONTROL = $A2;
  614.   {$EXTERNALSYM VK_LCONTROL}
  615.   VK_RCONTROL = $A3;
  616.   {$EXTERNALSYM VK_RCONTROL}
  617.   VK_LMENU    = $A4;
  618.   {$EXTERNALSYM VK_LMENU}
  619.   VK_RMENU    = $A5;
  620.   {$EXTERNALSYM VK_RMENU}
  621.   VK_BROWSER_BACK      = $A6;
  622.   {$EXTERNALSYM VK_BROWSER_BACK}
  623.   VK_BROWSER_FORWARD   = $A7;
  624.   {$EXTERNALSYM VK_BROWSER_FORWARD}
  625.   VK_BROWSER_REFRESH   = $A8;
  626.   {$EXTERNALSYM VK_BROWSER_REFRESH}
  627.   VK_BROWSER_STOP      = $A9;
  628.   {$EXTERNALSYM VK_BROWSER_STOP}
  629.   VK_BROWSER_SEARCH    = $AA;
  630.   {$EXTERNALSYM VK_BROWSER_SEARCH}
  631.   VK_BROWSER_FAVORITES = $AB;
  632.   {$EXTERNALSYM VK_BROWSER_FAVORITES}
  633.   VK_BROWSER_HOME      = $AC;
  634.   {$EXTERNALSYM VK_BROWSER_HOME}
  635.   VK_VOLUME_MUTE         = $AD;
  636.   {$EXTERNALSYM VK_VOLUME_MUTE}
  637.   VK_VOLUME_DOWN         = $AE;
  638.   {$EXTERNALSYM VK_VOLUME_DOWN}
  639.   VK_VOLUME_UP           = $AF;
  640.   {$EXTERNALSYM VK_VOLUME_UP}
  641.   VK_MEDIA_NEXT_TRACK    = $B0;
  642.   {$EXTERNALSYM VK_MEDIA_NEXT_TRACK}
  643.   VK_MEDIA_PREV_TRACK    = $B1;
  644.   {$EXTERNALSYM VK_MEDIA_PREV_TRACK}
  645.   VK_MEDIA_STOP          = $B2;
  646.   {$EXTERNALSYM VK_MEDIA_STOP}
  647.   VK_MEDIA_PLAY_PAUSE    = $B3;
  648.   {$EXTERNALSYM VK_MEDIA_PLAY_PAUSE}
  649.   VK_LAUNCH_MAIL         = $B4;
  650.   {$EXTERNALSYM VK_LAUNCH_MAIL}
  651.   VK_LAUNCH_MEDIA_SELECT = $B5;
  652.   {$EXTERNALSYM VK_LAUNCH_MEDIA_SELECT}
  653.   VK_LAUNCH_APP1         = $B6;
  654.   {$EXTERNALSYM VK_LAUNCH_APP1}
  655.   VK_LAUNCH_APP2         = $B7;
  656.   {$EXTERNALSYM VK_LAUNCH_APP2}
  657. //
  658. // 0xB8 - 0xB9 : reserved
  659. //
  660.   VK_OEM_1      = $BA; // ';:' for US
  661.   {$EXTERNALSYM VK_OEM_1}
  662.   VK_OEM_PLUS   = $BB; // '+' any country
  663.   {$EXTERNALSYM VK_OEM_PLUS}
  664.   VK_OEM_COMMA  = $BC; // ',' any country
  665.   {$EXTERNALSYM VK_OEM_COMMA}
  666.   VK_OEM_MINUS  = $BD; // '-' any country
  667.   {$EXTERNALSYM VK_OEM_MINUS}
  668.   VK_OEM_PERIOD = $BE; // '.' any country
  669.   {$EXTERNALSYM VK_OEM_PERIOD}
  670.   VK_OEM_2      = $BF; // '/?' for US
  671.   {$EXTERNALSYM VK_OEM_2}
  672.   VK_OEM_3      = $C0; // '`~' for US
  673.   {$EXTERNALSYM VK_OEM_3}
  674. //
  675. // 0xC1 - 0xD7 : reserved
  676. //
  677. //
  678. // 0xD8 - 0xDA : unassigned
  679. //
  680.   VK_OEM_4 = $DB; // '[{' for US
  681.   {$EXTERNALSYM VK_OEM_4}
  682.   VK_OEM_5 = $DC; // '|' for US
  683.   {$EXTERNALSYM VK_OEM_5}
  684.   VK_OEM_6 = $DD; // ']}' for US
  685.   {$EXTERNALSYM VK_OEM_6}
  686.   VK_OEM_7 = $DE; // ''"' for US
  687.   {$EXTERNALSYM VK_OEM_7}
  688.   VK_OEM_8 = $DF;
  689.   {$EXTERNALSYM VK_OEM_8}
  690. //
  691. // 0xE0 : reserved
  692. //
  693. //
  694. // Various extended or enhanced keyboards
  695. //
  696.   VK_OEM_AX   = $E1; // 'AX' key on Japanese AX kbd
  697.   {$EXTERNALSYM VK_OEM_AX}
  698.   VK_OEM_102  = $E2; // "<>" or "|" on RT 102-key kbd.
  699.   {$EXTERNALSYM VK_OEM_102}
  700.   VK_ICO_HELP = $E3; // Help key on ICO
  701.   {$EXTERNALSYM VK_ICO_HELP}
  702.   VK_ICO_00   = $E4; // 00 key on ICO
  703.   {$EXTERNALSYM VK_ICO_00}
  704.   VK_PROCESSKEY = $E5;
  705.   {$EXTERNALSYM VK_PROCESSKEY}
  706.   VK_ICO_CLEAR = $E6;
  707.   {$EXTERNALSYM VK_ICO_CLEAR}
  708.   VK_PACKET = $E7;
  709.   {$EXTERNALSYM VK_PACKET}
  710. //
  711. // 0xE8 : unassigned
  712. //
  713. //
  714. // Nokia/Ericsson definitions
  715. //
  716.   VK_OEM_RESET   = $E9;
  717.   {$EXTERNALSYM VK_OEM_RESET}
  718.   VK_OEM_JUMP    = $EA;
  719.   {$EXTERNALSYM VK_OEM_JUMP}
  720.   VK_OEM_PA1     = $EB;
  721.   {$EXTERNALSYM VK_OEM_PA1}
  722.   VK_OEM_PA2     = $EC;
  723.   {$EXTERNALSYM VK_OEM_PA2}
  724.   VK_OEM_PA3     = $ED;
  725.   {$EXTERNALSYM VK_OEM_PA3}
  726.   VK_OEM_WSCTRL  = $EE;
  727.   {$EXTERNALSYM VK_OEM_WSCTRL}
  728.   VK_OEM_CUSEL   = $EF;
  729.   {$EXTERNALSYM VK_OEM_CUSEL}
  730.   VK_OEM_ATTN    = $F0;
  731.   {$EXTERNALSYM VK_OEM_ATTN}
  732.   VK_OEM_FINISH  = $F1;
  733.   {$EXTERNALSYM VK_OEM_FINISH}
  734.   VK_OEM_COPY    = $F2;
  735.   {$EXTERNALSYM VK_OEM_COPY}
  736.   VK_OEM_AUTO    = $F3;
  737.   {$EXTERNALSYM VK_OEM_AUTO}
  738.   VK_OEM_ENLW    = $F4;
  739.   {$EXTERNALSYM VK_OEM_ENLW}
  740.   VK_OEM_BACKTAB = $F5;
  741.   {$EXTERNALSYM VK_OEM_BACKTAB}
  742.   VK_ATTN      = $F6;
  743.   {$EXTERNALSYM VK_ATTN}
  744.   VK_CRSEL     = $F7;
  745.   {$EXTERNALSYM VK_CRSEL}
  746.   VK_EXSEL     = $F8;
  747.   {$EXTERNALSYM VK_EXSEL}
  748.   VK_EREOF     = $F9;
  749.   {$EXTERNALSYM VK_EREOF}
  750.   VK_PLAY      = $FA;
  751.   {$EXTERNALSYM VK_PLAY}
  752.   VK_ZOOM      = $FB;
  753.   {$EXTERNALSYM VK_ZOOM}
  754.   VK_NONAME    = $FC;
  755.   {$EXTERNALSYM VK_NONAME}
  756.   VK_PA1       = $FD;
  757.   {$EXTERNALSYM VK_PA1}
  758.   VK_OEM_CLEAR = $FE;
  759.   {$EXTERNALSYM VK_OEM_CLEAR}
  760. //
  761. // 0xFF : reserved
  762. //
  763. //
  764. // SetWindowsHook() codes
  765. //
  766.   WH_MIN             = DWORD(-1);
  767.   {$EXTERNALSYM WH_MIN}
  768.   WH_MSGFILTER       = DWORD(-1);
  769.   {$EXTERNALSYM WH_MSGFILTER}
  770.   WH_JOURNALRECORD   = 0;
  771.   {$EXTERNALSYM WH_JOURNALRECORD}
  772.   WH_JOURNALPLAYBACK = 1;
  773.   {$EXTERNALSYM WH_JOURNALPLAYBACK}
  774.   WH_KEYBOARD        = 2;
  775.   {$EXTERNALSYM WH_KEYBOARD}
  776.   WH_GETMESSAGE      = 3;
  777.   {$EXTERNALSYM WH_GETMESSAGE}
  778.   WH_CALLWNDPROC     = 4;
  779.   {$EXTERNALSYM WH_CALLWNDPROC}
  780.   WH_CBT             = 5;
  781.   {$EXTERNALSYM WH_CBT}
  782.   WH_SYSMSGFILTER    = 6;
  783.   {$EXTERNALSYM WH_SYSMSGFILTER}
  784.   WH_MOUSE           = 7;
  785.   {$EXTERNALSYM WH_MOUSE}
  786.   WH_HARDWARE        = 8;
  787.   {$EXTERNALSYM WH_HARDWARE}
  788.   WH_DEBUG           = 9;
  789.   {$EXTERNALSYM WH_DEBUG}
  790.   WH_SHELL           = 10;
  791.   {$EXTERNALSYM WH_SHELL}
  792.   WH_FOREGROUNDIDLE  = 11;
  793.   {$EXTERNALSYM WH_FOREGROUNDIDLE}
  794.   WH_CALLWNDPROCRET  = 12;
  795.   {$EXTERNALSYM WH_CALLWNDPROCRET}
  796.   WH_KEYBOARD_LL = 13;
  797.   {$EXTERNALSYM WH_KEYBOARD_LL}
  798.   WH_MOUSE_LL    = 14;
  799.   {$EXTERNALSYM WH_MOUSE_LL}
  800. {$IFDEF WINVER_0400_UP}
  801.   {$IFDEF WINNT_0400_UP}
  802.   WH_MAX = 14;
  803.   {$EXTERNALSYM WH_MAX}
  804.   {$ELSE}
  805.   WH_MAX = 12;
  806.   {$EXTERNALSYM WH_MAX}
  807.   {$ENDIF}
  808. {$ELSE}
  809.   WH_MAX = 11;
  810.   {$EXTERNALSYM WH_MAX}
  811. {$ENDIF}
  812.   WH_MINHOOK = WH_MIN;
  813.   {$EXTERNALSYM WH_MINHOOK}
  814.   WH_MAXHOOK = WH_MAX;
  815.   {$EXTERNALSYM WH_MAXHOOK}
  816. //
  817. // Hook Codes
  818. //
  819.   HC_ACTION      = 0;
  820.   {$EXTERNALSYM HC_ACTION}
  821.   HC_GETNEXT     = 1;
  822.   {$EXTERNALSYM HC_GETNEXT}
  823.   HC_SKIP        = 2;
  824.   {$EXTERNALSYM HC_SKIP}
  825.   HC_NOREMOVE    = 3;
  826.   {$EXTERNALSYM HC_NOREMOVE}
  827.   HC_NOREM       = HC_NOREMOVE;
  828.   {$EXTERNALSYM HC_NOREM}
  829.   HC_SYSMODALON  = 4;
  830.   {$EXTERNALSYM HC_SYSMODALON}
  831.   HC_SYSMODALOFF = 5;
  832.   {$EXTERNALSYM HC_SYSMODALOFF}
  833. //
  834. // CBT Hook Codes
  835. //
  836.   HCBT_MOVESIZE     = 0;
  837.   {$EXTERNALSYM HCBT_MOVESIZE}
  838.   HCBT_MINMAX       = 1;
  839.   {$EXTERNALSYM HCBT_MINMAX}
  840.   HCBT_QS           = 2;
  841.   {$EXTERNALSYM HCBT_QS}
  842.   HCBT_CREATEWND    = 3;
  843.   {$EXTERNALSYM HCBT_CREATEWND}
  844.   HCBT_DESTROYWND   = 4;
  845.   {$EXTERNALSYM HCBT_DESTROYWND}
  846.   HCBT_ACTIVATE     = 5;
  847.   {$EXTERNALSYM HCBT_ACTIVATE}
  848.   HCBT_CLICKSKIPPED = 6;
  849.   {$EXTERNALSYM HCBT_CLICKSKIPPED}
  850.   HCBT_KEYSKIPPED   = 7;
  851.   {$EXTERNALSYM HCBT_KEYSKIPPED}
  852.   HCBT_SYSCOMMAND   = 8;
  853.   {$EXTERNALSYM HCBT_SYSCOMMAND}
  854.   HCBT_SETFOCUS     = 9;
  855.   {$EXTERNALSYM HCBT_SETFOCUS}
  856. //
  857. // HCBT_ACTIVATE structure pointed to by lParam
  858. //
  859. type
  860.   LPCBTACTIVATESTRUCT = ^CBTACTIVATESTRUCT;
  861.   {$EXTERNALSYM LPCBTACTIVATESTRUCT}
  862.   tagCBTACTIVATESTRUCT = record
  863.     fMouse: BOOL;
  864.     hWndActive: HWND;
  865.   end;
  866.   {$EXTERNALSYM tagCBTACTIVATESTRUCT}
  867.   CBTACTIVATESTRUCT = tagCBTACTIVATESTRUCT;
  868.   {$EXTERNALSYM CBTACTIVATESTRUCT}
  869.   TCbtActivateStruct = CBTACTIVATESTRUCT;
  870.   PCbtActivateStruct = LPCBTACTIVATESTRUCT;
  871. //
  872. // WTSSESSION_NOTIFICATION struct pointed by lParam, for WM_WTSSESSION_CHANGE
  873. //
  874.   tagWTSSESSION_NOTIFICATION = record
  875.     cbSize: DWORD;
  876.     dwSessionId: DWORD;
  877.   end;
  878.   {$EXTERNALSYM tagWTSSESSION_NOTIFICATION}
  879.   WTSSESSION_NOTIFICATION = tagWTSSESSION_NOTIFICATION;
  880.   {$EXTERNALSYM WTSSESSION_NOTIFICATION}
  881.   PWTSSESSION_NOTIFICATION = ^WTSSESSION_NOTIFICATION;
  882.   {$EXTERNALSYM PWTSSESSION_NOTIFICATION}
  883.   TWtsSessionNotification = WTSSESSION_NOTIFICATION;
  884.   PWtsSessionNotification = PWTSSESSION_NOTIFICATION;
  885. //
  886. // codes passed in WPARAM for WM_WTSSESSION_CHANGE
  887. //
  888. const
  889.   WTS_CONSOLE_CONNECT     = $1;
  890.   {$EXTERNALSYM WTS_CONSOLE_CONNECT}
  891.   WTS_CONSOLE_DISCONNECT  = $2;
  892.   {$EXTERNALSYM WTS_CONSOLE_DISCONNECT}
  893.   WTS_REMOTE_CONNECT      = $3;
  894.   {$EXTERNALSYM WTS_REMOTE_CONNECT}
  895.   WTS_REMOTE_DISCONNECT   = $4;
  896.   {$EXTERNALSYM WTS_REMOTE_DISCONNECT}
  897.   WTS_SESSION_LOGON       = $5;
  898.   {$EXTERNALSYM WTS_SESSION_LOGON}
  899.   WTS_SESSION_LOGOFF      = $6;
  900.   {$EXTERNALSYM WTS_SESSION_LOGOFF}
  901.   WTS_SESSION_LOCK        = $7;
  902.   {$EXTERNALSYM WTS_SESSION_LOCK}
  903.   WTS_SESSION_UNLOCK      = $8;
  904.   {$EXTERNALSYM WTS_SESSION_UNLOCK}
  905.   WTS_SESSION_REMOTE_CONTROL = $9;
  906.   {$EXTERNALSYM WTS_SESSION_REMOTE_CONTROL}
  907. //
  908. // WH_MSGFILTER Filter Proc Codes
  909. //
  910. const
  911.   MSGF_DIALOGBOX  = 0;
  912.   {$EXTERNALSYM MSGF_DIALOGBOX}
  913.   MSGF_MESSAGEBOX = 1;
  914.   {$EXTERNALSYM MSGF_MESSAGEBOX}
  915.   MSGF_MENU       = 2;
  916.   {$EXTERNALSYM MSGF_MENU}
  917.   MSGF_SCROLLBAR  = 5;
  918.   {$EXTERNALSYM MSGF_SCROLLBAR}
  919.   MSGF_NEXTWINDOW = 6;
  920.   {$EXTERNALSYM MSGF_NEXTWINDOW}
  921.   MSGF_MAX        = 8; // unused
  922.   {$EXTERNALSYM MSGF_MAX}
  923.   MSGF_USER       = 4096;
  924.   {$EXTERNALSYM MSGF_USER}
  925. //
  926. // Shell support
  927. //
  928.   HSHELL_WINDOWCREATED       = 1;
  929.   {$EXTERNALSYM HSHELL_WINDOWCREATED}
  930.   HSHELL_WINDOWDESTROYED     = 2;
  931.   {$EXTERNALSYM HSHELL_WINDOWDESTROYED}
  932.   HSHELL_ACTIVATESHELLWINDOW = 3;
  933.   {$EXTERNALSYM HSHELL_ACTIVATESHELLWINDOW}
  934.   HSHELL_WINDOWACTIVATED = 4;
  935.   {$EXTERNALSYM HSHELL_WINDOWACTIVATED}
  936.   HSHELL_GETMINRECT      = 5;
  937.   {$EXTERNALSYM HSHELL_GETMINRECT}
  938.   HSHELL_REDRAW          = 6;
  939.   {$EXTERNALSYM HSHELL_REDRAW}
  940.   HSHELL_TASKMAN         = 7;
  941.   {$EXTERNALSYM HSHELL_TASKMAN}
  942.   HSHELL_LANGUAGE        = 8;
  943.   {$EXTERNALSYM HSHELL_LANGUAGE}
  944.   HSHELL_ACCESSIBILITYSTATE = 11;
  945.   {$EXTERNALSYM HSHELL_ACCESSIBILITYSTATE}
  946.   HSHELL_APPCOMMAND      = 12;
  947.   {$EXTERNALSYM HSHELL_APPCOMMAND}
  948.   HSHELL_WINDOWREPLACED  = 13;
  949.   {$EXTERNALSYM HSHELL_WINDOWREPLACED}
  950. // wparam for HSHELL_ACCESSIBILITYSTATE//
  951.   ACCESS_STICKYKEYS = $0001;
  952.   {$EXTERNALSYM ACCESS_STICKYKEYS}
  953.   ACCESS_FILTERKEYS = $0002;
  954.   {$EXTERNALSYM ACCESS_FILTERKEYS}
  955.   ACCESS_MOUSEKEYS  = $0003;
  956.   {$EXTERNALSYM ACCESS_MOUSEKEYS}
  957. // cmd for HSHELL_APPCOMMAND and WM_APPCOMMAND//
  958.   APPCOMMAND_BROWSER_BACKWARD    = 1;
  959.   {$EXTERNALSYM APPCOMMAND_BROWSER_BACKWARD}
  960.   APPCOMMAND_BROWSER_FORWARD     = 2;
  961.   {$EXTERNALSYM APPCOMMAND_BROWSER_FORWARD}
  962.   APPCOMMAND_BROWSER_REFRESH     = 3;
  963.   {$EXTERNALSYM APPCOMMAND_BROWSER_REFRESH}
  964.   APPCOMMAND_BROWSER_STOP        = 4;
  965.   {$EXTERNALSYM APPCOMMAND_BROWSER_STOP}
  966.   APPCOMMAND_BROWSER_SEARCH      = 5;
  967.   {$EXTERNALSYM APPCOMMAND_BROWSER_SEARCH}
  968.   APPCOMMAND_BROWSER_FAVORITES   = 6;
  969.   {$EXTERNALSYM APPCOMMAND_BROWSER_FAVORITES}
  970.   APPCOMMAND_BROWSER_HOME        = 7;
  971.   {$EXTERNALSYM APPCOMMAND_BROWSER_HOME}
  972.   APPCOMMAND_VOLUME_MUTE         = 8;
  973.   {$EXTERNALSYM APPCOMMAND_VOLUME_MUTE}
  974.   APPCOMMAND_VOLUME_DOWN         = 9;
  975.   {$EXTERNALSYM APPCOMMAND_VOLUME_DOWN}
  976.   APPCOMMAND_VOLUME_UP           = 10;
  977.   {$EXTERNALSYM APPCOMMAND_VOLUME_UP}
  978.   APPCOMMAND_MEDIA_NEXTTRACK     = 11;
  979.   {$EXTERNALSYM APPCOMMAND_MEDIA_NEXTTRACK}
  980.   APPCOMMAND_MEDIA_PREVIOUSTRACK = 12;
  981.   {$EXTERNALSYM APPCOMMAND_MEDIA_PREVIOUSTRACK}
  982.   APPCOMMAND_MEDIA_STOP          = 13;
  983.   {$EXTERNALSYM APPCOMMAND_MEDIA_STOP}
  984.   APPCOMMAND_MEDIA_PLAY_PAUSE    = 14;
  985.   {$EXTERNALSYM APPCOMMAND_MEDIA_PLAY_PAUSE}
  986.   APPCOMMAND_LAUNCH_MAIL         = 15;
  987.   {$EXTERNALSYM APPCOMMAND_LAUNCH_MAIL}
  988.   APPCOMMAND_LAUNCH_MEDIA_SELECT = 16;
  989.   {$EXTERNALSYM APPCOMMAND_LAUNCH_MEDIA_SELECT}
  990.   APPCOMMAND_LAUNCH_APP1         = 17;
  991.   {$EXTERNALSYM APPCOMMAND_LAUNCH_APP1}
  992.   APPCOMMAND_LAUNCH_APP2         = 18;
  993.   {$EXTERNALSYM APPCOMMAND_LAUNCH_APP2}
  994.   APPCOMMAND_BASS_DOWN           = 19;
  995.   {$EXTERNALSYM APPCOMMAND_BASS_DOWN}
  996.   APPCOMMAND_BASS_BOOST          = 20;
  997.   {$EXTERNALSYM APPCOMMAND_BASS_BOOST}
  998.   APPCOMMAND_BASS_UP             = 21;
  999.   {$EXTERNALSYM APPCOMMAND_BASS_UP}
  1000.   APPCOMMAND_TREBLE_DOWN         = 22;
  1001.   {$EXTERNALSYM APPCOMMAND_TREBLE_DOWN}
  1002.   APPCOMMAND_TREBLE_UP           = 23;
  1003.   {$EXTERNALSYM APPCOMMAND_TREBLE_UP}
  1004.   APPCOMMAND_MICROPHONE_VOLUME_MUTE = 24;
  1005.   {$EXTERNALSYM APPCOMMAND_MICROPHONE_VOLUME_MUTE}
  1006.   APPCOMMAND_MICROPHONE_VOLUME_DOWN = 25;
  1007.   {$EXTERNALSYM APPCOMMAND_MICROPHONE_VOLUME_DOWN}
  1008.   APPCOMMAND_MICROPHONE_VOLUME_UP   = 26;
  1009.   {$EXTERNALSYM APPCOMMAND_MICROPHONE_VOLUME_UP}
  1010.   APPCOMMAND_HELP                   = 27;
  1011.   {$EXTERNALSYM APPCOMMAND_HELP}
  1012.   APPCOMMAND_FIND                   = 28;
  1013.   {$EXTERNALSYM APPCOMMAND_FIND}
  1014.   APPCOMMAND_NEW                    = 29;
  1015.   {$EXTERNALSYM APPCOMMAND_NEW}
  1016.   APPCOMMAND_OPEN                   = 30;
  1017.   {$EXTERNALSYM APPCOMMAND_OPEN}
  1018.   APPCOMMAND_CLOSE                  = 31;
  1019.   {$EXTERNALSYM APPCOMMAND_CLOSE}
  1020.   APPCOMMAND_SAVE                   = 32;
  1021.   {$EXTERNALSYM APPCOMMAND_SAVE}
  1022.   APPCOMMAND_PRINT                  = 33;
  1023.   {$EXTERNALSYM APPCOMMAND_PRINT}
  1024.   APPCOMMAND_UNDO                   = 34;
  1025.   {$EXTERNALSYM APPCOMMAND_UNDO}
  1026.   APPCOMMAND_REDO                   = 35;
  1027.   {$EXTERNALSYM APPCOMMAND_REDO}
  1028.   APPCOMMAND_COPY                   = 36;
  1029.   {$EXTERNALSYM APPCOMMAND_COPY}
  1030.   APPCOMMAND_CUT                    = 37;
  1031.   {$EXTERNALSYM APPCOMMAND_CUT}
  1032.   APPCOMMAND_PASTE                  = 38;
  1033.   {$EXTERNALSYM APPCOMMAND_PASTE}
  1034.   APPCOMMAND_REPLY_TO_MAIL          = 39;
  1035.   {$EXTERNALSYM APPCOMMAND_REPLY_TO_MAIL}
  1036.   APPCOMMAND_FORWARD_MAIL           = 40;
  1037.   {$EXTERNALSYM APPCOMMAND_FORWARD_MAIL}
  1038.   APPCOMMAND_SEND_MAIL              = 41;
  1039.   {$EXTERNALSYM APPCOMMAND_SEND_MAIL}
  1040.   APPCOMMAND_SPELL_CHECK            = 42;
  1041.   {$EXTERNALSYM APPCOMMAND_SPELL_CHECK}
  1042.   APPCOMMAND_DICTATE_OR_COMMAND_CONTROL_TOGGLE = 43;
  1043.   {$EXTERNALSYM APPCOMMAND_DICTATE_OR_COMMAND_CONTROL_TOGGLE}
  1044.   APPCOMMAND_MIC_ON_OFF_TOGGLE      = 44;
  1045.   {$EXTERNALSYM APPCOMMAND_MIC_ON_OFF_TOGGLE}
  1046.   APPCOMMAND_CORRECTION_LIST        = 45;
  1047.   {$EXTERNALSYM APPCOMMAND_CORRECTION_LIST}
  1048.   APPCOMMAND_MEDIA_PLAY             = 46;
  1049.   {$EXTERNALSYM APPCOMMAND_MEDIA_PLAY}
  1050.   APPCOMMAND_MEDIA_PAUSE            = 47;
  1051.   {$EXTERNALSYM APPCOMMAND_MEDIA_PAUSE}
  1052.   APPCOMMAND_MEDIA_RECORD           = 48;
  1053.   {$EXTERNALSYM APPCOMMAND_MEDIA_RECORD}
  1054.   APPCOMMAND_MEDIA_FAST_FORWARD     = 49;
  1055.   {$EXTERNALSYM APPCOMMAND_MEDIA_FAST_FORWARD}
  1056.   APPCOMMAND_MEDIA_REWIND           = 50;
  1057.   {$EXTERNALSYM APPCOMMAND_MEDIA_REWIND}
  1058.   APPCOMMAND_MEDIA_CHANNEL_UP       = 51;
  1059.   {$EXTERNALSYM APPCOMMAND_MEDIA_CHANNEL_UP}
  1060.   APPCOMMAND_MEDIA_CHANNEL_DOWN     = 52;
  1061.   {$EXTERNALSYM APPCOMMAND_MEDIA_CHANNEL_DOWN}
  1062.   FAPPCOMMAND_MOUSE = $8000;
  1063.   {$EXTERNALSYM FAPPCOMMAND_MOUSE}
  1064.   FAPPCOMMAND_KEY   = 0;
  1065.   {$EXTERNALSYM FAPPCOMMAND_KEY}
  1066.   FAPPCOMMAND_OEM   = $1000;
  1067.   {$EXTERNALSYM FAPPCOMMAND_OEM}
  1068.   FAPPCOMMAND_MASK  = $F000;
  1069.   {$EXTERNALSYM FAPPCOMMAND_MASK}
  1070. function GET_APPCOMMAND_LPARAM(lParam: LPARAM): Shortint;
  1071. {$EXTERNALSYM GET_APPCOMMAND_LPARAM}
  1072. function GET_DEVICE_LPARAM(lParam: LPARAM): WORD;
  1073. {$EXTERNALSYM GET_DEVICE_LPARAM}
  1074. function GET_MOUSEORKEY_LPARAM(lParam: LPARAM): WORD;
  1075. {$EXTERNALSYM GET_MOUSEORKEY_LPARAM}
  1076. function GET_FLAGS_LPARAM(lParam: LPARAM): Integer;
  1077. {$EXTERNALSYM GET_FLAGS_LPARAM}
  1078. function GET_KEYSTATE_LPARAM(lParam: LPARAM): Integer;
  1079. {$EXTERNALSYM GET_KEYSTATE_LPARAM}
  1080. //
  1081. // Message Structure used in Journaling
  1082. //
  1083. type
  1084.   LPEVENTMSG = ^EVENTMSG;
  1085.   {$EXTERNALSYM LPEVENTMSG}
  1086.   tagEVENTMSG = record
  1087.     message_: UINT;
  1088.     paramL: UINT;
  1089.     paramH: UINT;
  1090.     time: DWORD;
  1091.     hwnd: HWND;
  1092.   end;
  1093.   {$EXTERNALSYM tagEVENTMSG}
  1094.   EVENTMSG = tagEVENTMSG;
  1095.   {$EXTERNALSYM EVENTMSG}
  1096.   LPEVENTMSGMSG = ^EVENTMSG;
  1097.   {$EXTERNALSYM LPEVENTMSGMSG}
  1098.   PEVENTMSGMSG = ^EVENTMSG;
  1099.   {$EXTERNALSYM PEVENTMSGMSG}
  1100.   NPEVENTMSG = ^EVENTMSG;
  1101.   {$EXTERNALSYM NPEVENTMSG}
  1102.   NPEVENTMSGMSG = ^EVENTMSG;
  1103.   {$EXTERNALSYM NPEVENTMSGMSG}
  1104.   TEventMsg = EVENTMSG;
  1105.   PEventMsg = LPEVENTMSG;
  1106. //
  1107. // Message structure used by WH_CALLWNDPROC
  1108. //
  1109.   LPCWPSTRUCT = ^CWPSTRUCT;
  1110.   {$EXTERNALSYM LPCWPSTRUCT}
  1111.   tagCWPSTRUCT = record
  1112.     lParam: LPARAM;
  1113.     wParam: WPARAM;
  1114.     message: UINT;
  1115.     hwnd: HWND;
  1116.   end;
  1117.   {$EXTERNALSYM tagCWPSTRUCT}
  1118.   CWPSTRUCT = tagCWPSTRUCT;
  1119.   {$EXTERNALSYM CWPSTRUCT}
  1120.   NPCWPSTRUCT = ^CWPSTRUCT;
  1121.   {$EXTERNALSYM NPCWPSTRUCT}
  1122.   TCwpStruct = CWPSTRUCT;
  1123.   PCwpStruct = LPCWPSTRUCT;
  1124. //
  1125. // Message structure used by WH_CALLWNDPROCRET
  1126. //
  1127.   LPCWPRETSTRUCT = ^CWPRETSTRUCT;
  1128.   {$EXTERNALSYM LPCWPRETSTRUCT}
  1129.   tagCWPRETSTRUCT = record
  1130.     lResult: LRESULT;
  1131.     lParam: LPARAM;
  1132.     wParam: WPARAM;
  1133.     message: UINT;
  1134.     hwnd: HWND;
  1135.   end;
  1136.   {$EXTERNALSYM tagCWPRETSTRUCT}
  1137.   CWPRETSTRUCT = tagCWPRETSTRUCT;
  1138.   {$EXTERNALSYM CWPRETSTRUCT}
  1139.   NPCWPRETSTRUCT = ^CWPRETSTRUCT;
  1140.   {$EXTERNALSYM NPCWPRETSTRUCT}
  1141.   TCwpRetStruct = CWPRETSTRUCT;
  1142.   PCwpRetStruct = LPCWPRETSTRUCT;
  1143. //
  1144. // Low level hook flags
  1145. //
  1146. const
  1147.   LLKHF_EXTENDED = (KF_EXTENDED shr 8);
  1148.   {$EXTERNALSYM LLKHF_EXTENDED}
  1149.   LLKHF_INJECTED = $00000010;
  1150.   {$EXTERNALSYM LLKHF_INJECTED}
  1151.   LLKHF_ALTDOWN  = (KF_ALTDOWN shr 8);
  1152.   {$EXTERNALSYM LLKHF_ALTDOWN}
  1153.   LLKHF_UP       = (KF_UP shr 8);
  1154.   {$EXTERNALSYM LLKHF_UP}
  1155.   LLMHF_INJECTED = $00000001;
  1156.   {$EXTERNALSYM LLMHF_INJECTED}
  1157. //
  1158. // Structure used by WH_KEYBOARD_LL
  1159. //
  1160. type
  1161.   LPKBDLLHOOKSTRUCT = ^KBDLLHOOKSTRUCT;
  1162.   {$EXTERNALSYM LPKBDLLHOOKSTRUCT}
  1163.   tagKBDLLHOOKSTRUCT = record
  1164.     vkCode: DWORD;
  1165.     scanCode: DWORD;
  1166.     flags: DWORD;
  1167.     time: DWORD;
  1168.     dwExtraInfo: ULONG_PTR;
  1169.   end;
  1170.   {$EXTERNALSYM tagKBDLLHOOKSTRUCT}
  1171.   KBDLLHOOKSTRUCT = tagKBDLLHOOKSTRUCT;
  1172.   {$EXTERNALSYM KBDLLHOOKSTRUCT}
  1173.   TKbDllHookStruct = KBDLLHOOKSTRUCT;
  1174.   PKbDllHookStruct = LPKBDLLHOOKSTRUCT;
  1175. //
  1176. // Structure used by WH_MOUSE_LL
  1177. //
  1178.   LPMSLLHOOKSTRUCT = ^MSLLHOOKSTRUCT;
  1179.   {$EXTERNALSYM LPMSLLHOOKSTRUCT}
  1180.   tagMSLLHOOKSTRUCT = record
  1181.     pt: POINT;
  1182.     mouseData: DWORD;
  1183.     flags: DWORD;
  1184.     time: DWORD;
  1185.     dwExtraInfo: ULONG_PTR;
  1186.   end;
  1187.   {$EXTERNALSYM tagMSLLHOOKSTRUCT}
  1188.   MSLLHOOKSTRUCT = tagMSLLHOOKSTRUCT;
  1189.   {$EXTERNALSYM MSLLHOOKSTRUCT}
  1190.   TMsllHookStruct = MSLLHOOKSTRUCT;
  1191.   PMsllHookStruct = LPMSLLHOOKSTRUCT;
  1192. //
  1193. // Structure used by WH_DEBUG
  1194. //
  1195.   LPDEBUGHOOKINFO = ^DEBUGHOOKINFO;
  1196.   {$EXTERNALSYM LPDEBUGHOOKINFO}
  1197.   tagDEBUGHOOKINFO = record
  1198.     idThread: DWORD;
  1199.     idThreadInstaller: DWORD;
  1200.     lParam: LPARAM;
  1201.     wParam: WPARAM;
  1202.     code: Integer;
  1203.   end;
  1204.   {$EXTERNALSYM tagDEBUGHOOKINFO}
  1205.   DEBUGHOOKINFO = tagDEBUGHOOKINFO;
  1206.   {$EXTERNALSYM DEBUGHOOKINFO}
  1207.   NPDEBUGHOOKINFO = ^DEBUGHOOKINFO;
  1208.   {$EXTERNALSYM NPDEBUGHOOKINFO}
  1209.   TDebugHookInfo = DEBUGHOOKINFO;
  1210.   PDebugHookInfo = LPDEBUGHOOKINFO;
  1211. //
  1212. // Structure used by WH_MOUSE
  1213. //
  1214.   LPMOUSEHOOKSTRUCT = ^MOUSEHOOKSTRUCT;
  1215.   {$EXTERNALSYM LPMOUSEHOOKSTRUCT}
  1216.   tagMOUSEHOOKSTRUCT = record
  1217.     pt: POINT;
  1218.     hwnd: HWND;
  1219.     wHitTestCode: UINT;
  1220.     dwExtraInfo: ULONG_PTR;
  1221.   end;
  1222.   {$EXTERNALSYM tagMOUSEHOOKSTRUCT}
  1223.   MOUSEHOOKSTRUCT = tagMOUSEHOOKSTRUCT;
  1224.   {$EXTERNALSYM MOUSEHOOKSTRUCT}
  1225.   TMouseHookStruct = MOUSEHOOKSTRUCT;
  1226.   PMouseHookStruct = LPMOUSEHOOKSTRUCT;
  1227.   LPMOUSEHOOKSTRUCTEX = ^MOUSEHOOKSTRUCTEX;
  1228.   {$EXTERNALSYM LPMOUSEHOOKSTRUCTEX}
  1229.   tagMOUSEHOOKSTRUCTEX = record
  1230.     mhs: MOUSEHOOKSTRUCT;
  1231.     mouseData: DWORD;
  1232.   end;
  1233.   {$EXTERNALSYM tagMOUSEHOOKSTRUCTEX}
  1234.   MOUSEHOOKSTRUCTEX = tagMOUSEHOOKSTRUCTEX;
  1235.   {$EXTERNALSYM MOUSEHOOKSTRUCTEX}
  1236.   TMouseHookStructEx = MOUSEHOOKSTRUCTEX;
  1237.   PMouseHookStructEx = LPMOUSEHOOKSTRUCTEX;
  1238. //
  1239. // Structure used by WH_HARDWARE
  1240. //
  1241.   LPHARDWAREHOOKSTRUCT = ^HARDWAREHOOKSTRUCT;
  1242.   {$EXTERNALSYM LPHARDWAREHOOKSTRUCT}
  1243.   tagHARDWAREHOOKSTRUCT = record
  1244.     hwnd: HWND;
  1245.     message: UINT;
  1246.     wParam: WPARAM;
  1247.     lParam: LPARAM;
  1248.   end;
  1249.   {$EXTERNALSYM tagHARDWAREHOOKSTRUCT}
  1250.   HARDWAREHOOKSTRUCT = tagHARDWAREHOOKSTRUCT;
  1251.   {$EXTERNALSYM HARDWAREHOOKSTRUCT}
  1252.   THardwareHookStruct = HARDWAREHOOKSTRUCT;
  1253.   PHardwareHookStruct = LPHARDWAREHOOKSTRUCT;
  1254. //
  1255. // Keyboard Layout API
  1256. //
  1257. const
  1258.   HKL_PREV = 0;
  1259.   {$EXTERNALSYM HKL_PREV}
  1260.   HKL_NEXT = 1;
  1261.   {$EXTERNALSYM HKL_NEXT}
  1262.   KLF_ACTIVATE      = $00000001;
  1263.   {$EXTERNALSYM KLF_ACTIVATE}
  1264.   KLF_SUBSTITUTE_OK = $00000002;
  1265.   {$EXTERNALSYM KLF_SUBSTITUTE_OK}
  1266.   KLF_REORDER       = $00000008;
  1267.   {$EXTERNALSYM KLF_REORDER}
  1268.   KLF_REPLACELANG   = $00000010;
  1269.   {$EXTERNALSYM KLF_REPLACELANG}
  1270.   KLF_NOTELLSHELL   = $00000080;
  1271.   {$EXTERNALSYM KLF_NOTELLSHELL}
  1272.   KLF_SETFORPROCESS = $00000100;
  1273.   {$EXTERNALSYM KLF_SETFORPROCESS}
  1274.   KLF_SHIFTLOCK     = $00010000;
  1275.   {$EXTERNALSYM KLF_SHIFTLOCK}
  1276.   KLF_RESET         = $40000000;
  1277.   {$EXTERNALSYM KLF_RESET}
  1278. //
  1279. // Bits in wParam of WM_INPUTLANGCHANGEREQUEST message
  1280. //
  1281.   INPUTLANGCHANGE_SYSCHARSET = $0001;
  1282.   {$EXTERNALSYM INPUTLANGCHANGE_SYSCHARSET}
  1283.   INPUTLANGCHANGE_FORWARD    = $0002;
  1284.   {$EXTERNALSYM INPUTLANGCHANGE_FORWARD}
  1285.   INPUTLANGCHANGE_BACKWARD   = $0004;
  1286.   {$EXTERNALSYM INPUTLANGCHANGE_BACKWARD}
  1287. //
  1288. // Size of KeyboardLayoutName (number of characters), including nul terminator
  1289. //
  1290.   KL_NAMELENGTH = 9;
  1291.   {$EXTERNALSYM KL_NAMELENGTH}
  1292. function LoadKeyboardLayoutA(pwszKLID: LPCSTR; Flags: UINT): HKL; stdcall;
  1293. {$EXTERNALSYM LoadKeyboardLayoutA}
  1294. function LoadKeyboardLayoutW(pwszKLID: LPCWSTR; Flags: UINT): HKL; stdcall;
  1295. {$EXTERNALSYM LoadKeyboardLayoutW}
  1296. {$IFDEF UNICODE}
  1297. function LoadKeyboardLayout(pwszKLID: LPCWSTR; Flags: UINT): HKL; stdcall;
  1298. {$EXTERNALSYM LoadKeyboardLayout}
  1299. {$ELSE}
  1300. function LoadKeyboardLayout(pwszKLID: LPCSTR; Flags: UINT): HKL; stdcall;
  1301. {$EXTERNALSYM LoadKeyboardLayout}
  1302. {$ENDIF}
  1303. {$IFDEF WINVER_0400_GREATER}
  1304. function ActivateKeyboardLayout(hkl: HKL; Flags: UINT): HKL; stdcall;
  1305. {$EXTERNALSYM ActivateKeyboardLayout}
  1306. {$ELSE}
  1307. function ActivateKeyboardLayout(hkl: HKL; Flags: UINT): BOOL; stdcall;
  1308. {$EXTERNALSYM ActivateKeyboardLayout}
  1309. {$ENDIF}
  1310. function ToUnicodeEx(wVirtKey, wScanCode: UINT; lpKeyState: PBYTE;
  1311.   pwszBuff: LPWSTR; cchBuff: Integer; wFlags: UINT; dwhkl: HKL): Integer; stdcall;
  1312. {$EXTERNALSYM ToUnicodeEx}
  1313. function UnloadKeyboardLayout(hkl: HKL): BOOL; stdcall;
  1314. {$EXTERNALSYM UnloadKeyboardLayout}
  1315. function GetKeyboardLayoutNameA(pwszKLID: LPSTR): BOOL; stdcall;
  1316. {$EXTERNALSYM GetKeyboardLayoutNameA}
  1317. function GetKeyboardLayoutNameW(pwszKLID: LPWSTR): BOOL; stdcall;
  1318. {$EXTERNALSYM GetKeyboardLayoutNameW}
  1319. {$IFDEF UNICODE}
  1320. function GetKeyboardLayoutName(pwszKLID: LPWSTR): BOOL; stdcall;
  1321. {$EXTERNALSYM GetKeyboardLayoutName}
  1322. {$ELSE}
  1323. function GetKeyboardLayoutName(pwszKLID: LPSTR): BOOL; stdcall;
  1324. {$EXTERNALSYM GetKeyboardLayoutName}
  1325. {$ENDIF}
  1326. function GetKeyboardLayoutList(nBuff: Integer; lpList: PHKL): Integer; stdcall;
  1327. {$EXTERNALSYM GetKeyboardLayoutList}
  1328. function GetKeyboardLayout(idThread: DWORD): HKL; stdcall;
  1329. {$EXTERNALSYM GetKeyboardLayout}
  1330. type
  1331.   LPMOUSEMOVEPOINT = ^MOUSEMOVEPOINT;
  1332.   {$EXTERNALSYM LPMOUSEMOVEPOINT}
  1333.   tagMOUSEMOVEPOINT = record
  1334.     x: Integer;
  1335.     y: Integer;
  1336.     time: DWORD;
  1337.     dwExtraInfo: ULONG_PTR;
  1338.   end;
  1339.   {$EXTERNALSYM tagMOUSEMOVEPOINT}
  1340.   MOUSEMOVEPOINT = tagMOUSEMOVEPOINT;
  1341.   {$EXTERNALSYM MOUSEMOVEPOINT}
  1342.   TMouseMovePoint = MOUSEMOVEPOINT;
  1343.   PMouseMovePoint = LPMOUSEMOVEPOINT;
  1344. //
  1345. // Values for resolution parameter of GetMouseMovePointsEx
  1346. //
  1347. const
  1348.   GMMP_USE_DISPLAY_POINTS         = 1;
  1349.   {$EXTERNALSYM GMMP_USE_DISPLAY_POINTS}
  1350.   GMMP_USE_HIGH_RESOLUTION_POINTS = 2;
  1351.   {$EXTERNALSYM GMMP_USE_HIGH_RESOLUTION_POINTS}
  1352. function GetMouseMovePointsEx(cbSize: UINT; lppt, lpptBuf: LPMOUSEMOVEPOINT;
  1353.   nBufPoints: Integer; resolution: DWORD): Integer; stdcall;
  1354. {$EXTERNALSYM GetMouseMovePointsEx}
  1355. //
  1356. // Desktop-specific access flags
  1357. //
  1358. const
  1359.   DESKTOP_READOBJECTS     = $0001;
  1360.   {$EXTERNALSYM DESKTOP_READOBJECTS}
  1361.   DESKTOP_CREATEWINDOW    = $0002;
  1362.   {$EXTERNALSYM DESKTOP_CREATEWINDOW}
  1363.   DESKTOP_CREATEMENU      = $0004;
  1364.   {$EXTERNALSYM DESKTOP_CREATEMENU}
  1365.   DESKTOP_HOOKCONTROL     = $0008;
  1366.   {$EXTERNALSYM DESKTOP_HOOKCONTROL}
  1367.   DESKTOP_JOURNALRECORD   = $0010;
  1368.   {$EXTERNALSYM DESKTOP_JOURNALRECORD}
  1369.   DESKTOP_JOURNALPLAYBACK = $0020;
  1370.   {$EXTERNALSYM DESKTOP_JOURNALPLAYBACK}
  1371.   DESKTOP_ENUMERATE       = $0040;
  1372.   {$EXTERNALSYM DESKTOP_ENUMERATE}
  1373.   DESKTOP_WRITEOBJECTS    = $0080;
  1374.   {$EXTERNALSYM DESKTOP_WRITEOBJECTS}
  1375.   DESKTOP_SWITCHDESKTOP   = $0100;
  1376.   {$EXTERNALSYM DESKTOP_SWITCHDESKTOP}
  1377. //
  1378. // Desktop-specific control flags
  1379. //
  1380.   DF_ALLOWOTHERACCOUNTHOOK = $0001;
  1381.   {$EXTERNALSYM DF_ALLOWOTHERACCOUNTHOOK}
  1382. function CreateDesktopA(lpszDesktop, lpszDevice: LPCSTR; pDevmode: LPDEVMODEA;
  1383.   dwFlags: DWORD; dwDesiredAccess: ACCESS_MASK; lpsa: LPSECURITY_ATTRIBUTES): HDESK; stdcall;
  1384. {$EXTERNALSYM CreateDesktopA}
  1385. function CreateDesktopW(lpszDesktop, lpszDevice: LPCWSTR; pDevmode: LPDEVMODEW;
  1386.   dwFlags: DWORD; dwDesiredAccess: ACCESS_MASK; lpsa: LPSECURITY_ATTRIBUTES): HDESK; stdcall;
  1387. {$EXTERNALSYM CreateDesktopW}
  1388. {$IFDEF UNICODE}
  1389. function CreateDesktop(lpszDesktop, lpszDevice: LPCWSTR; pDevmode: LPDEVMODEW;
  1390.   dwFlags: DWORD; dwDesiredAccess: ACCESS_MASK; lpsa: LPSECURITY_ATTRIBUTES): HDESK; stdcall;
  1391. {$EXTERNALSYM CreateDesktop}
  1392. {$ELSE}
  1393. function CreateDesktop(lpszDesktop, lpszDevice: LPCSTR; pDevmode: LPDEVMODEA;
  1394.   dwFlags: DWORD; dwDesiredAccess: ACCESS_MASK; lpsa: LPSECURITY_ATTRIBUTES): HDESK; stdcall;
  1395. {$EXTERNALSYM CreateDesktop}
  1396. {$ENDIF}
  1397. function OpenDesktopA(lpszDesktop: LPCSTR; dwFlags: DWORD; fInherit: BOOL;
  1398.   dwDesiredAccess: ACCESS_MASK): HDESK; stdcall;
  1399. {$EXTERNALSYM OpenDesktopA}
  1400. function OpenDesktopW(lpszDesktop: LPCWSTR; dwFlags: DWORD; fInherit: BOOL;
  1401.   dwDesiredAccess: ACCESS_MASK): HDESK; stdcall;
  1402. {$EXTERNALSYM OpenDesktopW}
  1403. {$IFDEF UNICODE}
  1404. function OpenDesktop(lpszDesktop: LPCWSTR; dwFlags: DWORD; fInherit: BOOL;
  1405.   dwDesiredAccess: ACCESS_MASK): HDESK; stdcall;
  1406. {$EXTERNALSYM OpenDesktop}
  1407. {$ELSE}
  1408. function OpenDesktop(lpszDesktop: LPCSTR; dwFlags: DWORD; fInherit: BOOL;
  1409.   dwDesiredAccess: ACCESS_MASK): HDESK; stdcall;
  1410. {$EXTERNALSYM OpenDesktop}
  1411. {$ENDIF}
  1412. function OpenInputDesktop(dwFlags: DWORD; fInherit: BOOL;
  1413.   dwDesiredAccess: ACCESS_MASK): HDESK; stdcall;
  1414. {$EXTERNALSYM OpenInputDesktop}
  1415. function EnumDesktopsA(hwinsta: HWINSTA; lpEnumFunc: DESKTOPENUMPROCA;
  1416.   lParam: LPARAM): BOOL; stdcall;
  1417. {$EXTERNALSYM EnumDesktopsA}
  1418. function EnumDesktopsW(hwinsta: HWINSTA; lpEnumFunc: DESKTOPENUMPROCW;
  1419.   lParam: LPARAM): BOOL; stdcall;
  1420. {$EXTERNALSYM EnumDesktopsW}
  1421. {$IFDEF UNICODE}
  1422. function EnumDesktops(hwinsta: HWINSTA; lpEnumFunc: DESKTOPENUMPROCW;
  1423.   lParam: LPARAM): BOOL; stdcall;
  1424. {$EXTERNALSYM EnumDesktops}
  1425. {$ELSE}
  1426. function EnumDesktops(hwinsta: HWINSTA; lpEnumFunc: DESKTOPENUMPROCA;
  1427.   lParam: LPARAM): BOOL; stdcall;
  1428. {$EXTERNALSYM EnumDesktops}
  1429. {$ENDIF}
  1430. function EnumDesktopWindows(hDesktop: HDESK; lpfn: WNDENUMPROC; lParam: LPARAM): BOOL; stdcall;
  1431. {$EXTERNALSYM EnumDesktopWindows}
  1432. function SwitchDesktop(hDesktop: HDESK): BOOL; stdcall;
  1433. {$EXTERNALSYM SwitchDesktop}
  1434. function SetThreadDesktop(hDesktop: HDESK): BOOL; stdcall;
  1435. {$EXTERNALSYM SetThreadDesktop}
  1436. function CloseDesktop(hDesktop: HDESK): BOOL; stdcall;
  1437. {$EXTERNALSYM CloseDesktop}
  1438. function GetThreadDesktop(dwThreadId: DWORD): HDESK; stdcall;
  1439. {$EXTERNALSYM GetThreadDesktop}
  1440. //
  1441. // Windowstation-specific access flags
  1442. //
  1443. const
  1444.   WINSTA_ENUMDESKTOPS      = $0001;
  1445.   {$EXTERNALSYM WINSTA_ENUMDESKTOPS}
  1446.   WINSTA_READATTRIBUTES    = $0002;
  1447.   {$EXTERNALSYM WINSTA_READATTRIBUTES}
  1448.   WINSTA_ACCESSCLIPBOARD   = $0004;
  1449.   {$EXTERNALSYM WINSTA_ACCESSCLIPBOARD}
  1450.   WINSTA_CREATEDESKTOP     = $0008;
  1451.   {$EXTERNALSYM WINSTA_CREATEDESKTOP}
  1452.   WINSTA_WRITEATTRIBUTES   = $0010;
  1453.   {$EXTERNALSYM WINSTA_WRITEATTRIBUTES}
  1454.   WINSTA_ACCESSGLOBALATOMS = $0020;
  1455.   {$EXTERNALSYM WINSTA_ACCESSGLOBALATOMS}
  1456.   WINSTA_EXITWINDOWS       = $0040;
  1457.   {$EXTERNALSYM WINSTA_EXITWINDOWS}
  1458.   WINSTA_ENUMERATE         = $0100;
  1459.   {$EXTERNALSYM WINSTA_ENUMERATE}
  1460.   WINSTA_READSCREEN        = $0200;
  1461.   {$EXTERNALSYM WINSTA_READSCREEN}
  1462.   WINSTA_ALL_ACCESS        = (WINSTA_ENUMDESKTOPS or WINSTA_READATTRIBUTES or WINSTA_ACCESSCLIPBOARD or
  1463.                               WINSTA_CREATEDESKTOP or WINSTA_WRITEATTRIBUTES or WINSTA_ACCESSGLOBALATOMS or
  1464.                               WINSTA_EXITWINDOWS or WINSTA_ENUMERATE or WINSTA_READSCREEN);
  1465.   {$EXTERNALSYM WINSTA_ALL_ACCESS}
  1466. //
  1467. // Windowstation-specific attribute flags
  1468. //
  1469.   WSF_VISIBLE = $0001;
  1470.   {$EXTERNALSYM WSF_VISIBLE}
  1471. function CreateWindowStationA(lpwinsta: LPCSTR; dwReserved: DWORD;
  1472.   dwDesiredAccess: ACCESS_MASK; lpsa: LPSECURITY_ATTRIBUTES): HWINSTA; stdcall;
  1473. {$EXTERNALSYM CreateWindowStationA}
  1474. function CreateWindowStationW(lpwinsta: LPCWSTR; dwReserved: DWORD;
  1475.   dwDesiredAccess: ACCESS_MASK; lpsa: LPSECURITY_ATTRIBUTES): HWINSTA; stdcall;
  1476. {$EXTERNALSYM CreateWindowStationW}
  1477. {$IFDEF UNICODE}
  1478. function CreateWindowStation(lpwinsta: LPCWSTR; dwReserved: DWORD;
  1479.   dwDesiredAccess: ACCESS_MASK; lpsa: LPSECURITY_ATTRIBUTES): HWINSTA; stdcall;
  1480. {$EXTERNALSYM CreateWindowStation}
  1481. {$ELSE}
  1482. function CreateWindowStation(lpwinsta: LPCSTR; dwReserved: DWORD;
  1483.   dwDesiredAccess: ACCESS_MASK; lpsa: LPSECURITY_ATTRIBUTES): HWINSTA; stdcall;
  1484. {$EXTERNALSYM CreateWindowStation}
  1485. {$ENDIF}
  1486. function OpenWindowStationA(lpszWinSta: LPCSTR; fInherit: BOOL;
  1487.   dwDesiredAccess: ACCESS_MASK): HWINSTA; stdcall;
  1488. {$EXTERNALSYM OpenWindowStationA}
  1489. function OpenWindowStationW(lpszWinSta: LPCWSTR; fInherit: BOOL;
  1490.   dwDesiredAccess: ACCESS_MASK): HWINSTA; stdcall;
  1491. {$EXTERNALSYM OpenWindowStationW}
  1492. {$IFDEF UNICODE}
  1493. function OpenWindowStation(lpszWinSta: LPCWSTR; fInherit: BOOL;
  1494.   dwDesiredAccess: ACCESS_MASK): HWINSTA; stdcall;
  1495. {$EXTERNALSYM OpenWindowStation}
  1496. {$ELSE}
  1497. function OpenWindowStation(lpszWinSta: LPCSTR; fInherit: BOOL;
  1498.   dwDesiredAccess: ACCESS_MASK): HWINSTA; stdcall;
  1499. {$EXTERNALSYM OpenWindowStation}
  1500. {$ENDIF}
  1501. function EnumWindowStationsA(lpEnumFunc: WINSTAENUMPROCA; lParam: LPARAM): BOOL; stdcall;
  1502. {$EXTERNALSYM EnumWindowStationsA}
  1503. function EnumWindowStationsW(lpEnumFunc: WINSTAENUMPROCW; lParam: LPARAM): BOOL; stdcall;
  1504. {$EXTERNALSYM EnumWindowStationsW}
  1505. {$IFDEF UNICODE}
  1506. function EnumWindowStations(lpEnumFunc: WINSTAENUMPROCW; lParam: LPARAM): BOOL; stdcall;
  1507. {$EXTERNALSYM EnumWindowStations}
  1508. {$ELSE}
  1509. function EnumWindowStations(lpEnumFunc: WINSTAENUMPROCA; lParam: LPARAM): BOOL; stdcall;
  1510. {$EXTERNALSYM EnumWindowStations}
  1511. {$ENDIF}
  1512. function CloseWindowStation(hWinSta: HWINSTA): BOOL; stdcall;
  1513. {$EXTERNALSYM CloseWindowStation}
  1514. function SetProcessWindowStation(hWinSta: HWINSTA): BOOL; stdcall;
  1515. {$EXTERNALSYM SetProcessWindowStation}
  1516. function GetProcessWindowStation: HWINSTA; stdcall;
  1517. {$EXTERNALSYM GetProcessWindowStation}
  1518. function SetUserObjectSecurity(hObj: HANDLE; var pSIRequested: SECURITY_INFORMATION;
  1519.   pSID: PSECURITY_DESCRIPTOR): BOOL; stdcall;
  1520. {$EXTERNALSYM SetUserObjectSecurity}
  1521. function GetUserObjectSecurity(hObj: HANDLE; var pSIRequested: SECURITY_INFORMATION;
  1522.   pSID: PSECURITY_DESCRIPTOR; nLength: DWORD; var lpnLengthNeeded: DWORD): BOOL; stdcall;
  1523. {$EXTERNALSYM GetUserObjectSecurity}
  1524. const
  1525.   UOI_FLAGS    = 1;
  1526.   {$EXTERNALSYM UOI_FLAGS}
  1527.   UOI_NAME     = 2;
  1528.   {$EXTERNALSYM UOI_NAME}
  1529.   UOI_TYPE     = 3;
  1530.   {$EXTERNALSYM UOI_TYPE}
  1531.   UOI_USER_SID = 4;
  1532.   {$EXTERNALSYM UOI_USER_SID}
  1533. type
  1534.   PUSEROBJECTFLAGS = ^USEROBJECTFLAGS;
  1535.   tagUSEROBJECTFLAGS = record
  1536.     fInherit: BOOL;
  1537.     fReserved: BOOL;
  1538.     dwFlags: DWORD;
  1539.   end;
  1540.   {$EXTERNALSYM tagUSEROBJECTFLAGS}
  1541.   USEROBJECTFLAGS = tagUSEROBJECTFLAGS;
  1542.   {$EXTERNALSYM USEROBJECTFLAGS}
  1543.   TUserObjectFlags = USEROBJECTFLAGS;
  1544. function GetUserObjectInformationA(hObj: HANDLE; nIndex: Integer; pvInfo: PVOID;
  1545.   nLength: DWORD; var lpnLengthNeeded: DWORD): BOOL; stdcall;
  1546. {$EXTERNALSYM GetUserObjectInformationA}
  1547. function GetUserObjectInformationW(hObj: HANDLE; nIndex: Integer; pvInfo: PVOID;
  1548.   nLength: DWORD; var lpnLengthNeeded: DWORD): BOOL; stdcall;
  1549. {$EXTERNALSYM GetUserObjectInformationW}
  1550. {$IFDEF UNICODE}
  1551. function GetUserObjectInformation(hObj: HANDLE; nIndex: Integer; pvInfo: PVOID;
  1552.   nLength: DWORD; var lpnLengthNeeded: DWORD): BOOL; stdcall;
  1553. {$EXTERNALSYM GetUserObjectInformation}
  1554. {$ELSE}
  1555. function GetUserObjectInformation(hObj: HANDLE; nIndex: Integer; pvInfo: PVOID;
  1556.   nLength: DWORD; var lpnLengthNeeded: DWORD): BOOL; stdcall;
  1557. {$EXTERNALSYM GetUserObjectInformation}
  1558. {$ENDIF}
  1559. function SetUserObjectInformationA(hObj: HANDLE; nIndex: Integer; pvInfo: PVOID;
  1560.   nLength: DWORD): BOOL; stdcall;
  1561. {$EXTERNALSYM SetUserObjectInformationA}
  1562. function SetUserObjectInformationW(hObj: HANDLE; nIndex: Integer; pvInfo: PVOID;
  1563.   nLength: DWORD): BOOL; stdcall;
  1564. {$EXTERNALSYM SetUserObjectInformationW}
  1565. {$IFDEF UNICODE}
  1566. function SetUserObjectInformation(hObj: HANDLE; nIndex: Integer; pvInfo: PVOID;
  1567.   nLength: DWORD): BOOL; stdcall;
  1568. {$EXTERNALSYM SetUserObjectInformation}
  1569. {$ELSE}
  1570. function SetUserObjectInformation(hObj: HANDLE; nIndex: Integer; pvInfo: PVOID;
  1571.   nLength: DWORD): BOOL; stdcall;
  1572. {$EXTERNALSYM SetUserObjectInformation}
  1573. {$ENDIF}
  1574. type
  1575.   LPWNDCLASSEXA = ^WNDCLASSEXA;
  1576.   {$EXTERNALSYM LPWNDCLASSEXA}
  1577.   tagWNDCLASSEXA = record
  1578.     cbSize: UINT;
  1579.     // Win 3.x
  1580.     style: UINT;
  1581.     lpfnWndProc: WNDPROC;
  1582.     cbClsExtra: Integer;
  1583.     cbWndExtra: Integer;
  1584.     hInstance: HINSTANCE;
  1585.     hIcon: HICON;
  1586.     hCursor: HCURSOR;
  1587.     hbrBackground: HBRUSH;
  1588.     lpszMenuName: LPCSTR;
  1589.     lpszClassName: LPCSTR;
  1590.     // Win 4.0
  1591.     hIconSm: HICON;
  1592.   end;
  1593.   {$EXTERNALSYM tagWNDCLASSEXA}
  1594.   WNDCLASSEXA = tagWNDCLASSEXA;
  1595.   {$EXTERNALSYM WNDCLASSEXA}
  1596.   NPWNDCLASSEXA = ^WNDCLASSEXA;
  1597.   {$EXTERNALSYM NPWNDCLASSEXA}
  1598.   TWndClassExA = WNDCLASSEXA;
  1599.   PWndClassExA = LPWNDCLASSEXA;
  1600.   LPWNDCLASSEXW = ^WNDCLASSEXW;
  1601.   {$EXTERNALSYM LPWNDCLASSEXW}
  1602.   tagWNDCLASSEXW = record
  1603.     cbSize: UINT;
  1604.     // Win 3.x
  1605.     style: UINT;
  1606.     lpfnWndProc: WNDPROC;
  1607.     cbClsExtra: Integer;
  1608.     cbWndExtra: Integer;
  1609.     hInstance: HINSTANCE;
  1610.     hIcon: HICON;
  1611.     hCursor: HCURSOR;
  1612.     hbrBackground: HBRUSH;
  1613.     lpszMenuName: LPCWSTR;
  1614.     lpszClassName: LPCWSTR;
  1615.     // Win 4.0
  1616.     hIconSm: HICON;
  1617.   end;
  1618.   {$EXTERNALSYM tagWNDCLASSEXW}
  1619.   WNDCLASSEXW = tagWNDCLASSEXW;
  1620.   {$EXTERNALSYM WNDCLASSEXW}
  1621.   NPWNDCLASSEXW = ^WNDCLASSEXW;
  1622.   {$EXTERNALSYM NPWNDCLASSEXW}
  1623.   TWndClassExW = WNDCLASSEXW;
  1624.   PWndClassExW = LPWNDCLASSEXW;
  1625. {$IFDEF UNICODE}
  1626.   WNDCLASSEX = WNDCLASSEXW;
  1627.   {$EXTERNALSYM WNDCLASSEX}
  1628.   NPWNDCLASSEX = NPWNDCLASSEXW;
  1629.   {$EXTERNALSYM NPWNDCLASSEX}
  1630.   LPWNDCLASSEX = LPWNDCLASSEXW;
  1631.   {$EXTERNALSYM LPWNDCLASSEX}
  1632.   TWndClassEx = TWndClassExW;
  1633.   PWndClassEx = PWndClassExW;
  1634. {$ELSE}
  1635.   WNDCLASSEX = WNDCLASSEXA;
  1636.   {$EXTERNALSYM WNDCLASSEX}
  1637.   NPWNDCLASSEX = NPWNDCLASSEXA;
  1638.   {$EXTERNALSYM NPWNDCLASSEX}
  1639.   LPWNDCLASSEX = LPWNDCLASSEXA;
  1640.   {$EXTERNALSYM LPWNDCLASSEX}
  1641.   TWndClassEx = TWndClassExA;
  1642.   PWndClassEx = PWndClassExA;
  1643. {$ENDIF}
  1644.   LPWNDCLASSA = ^WNDCLASSA;
  1645.   {$EXTERNALSYM LPWNDCLASSA}
  1646.   tagWNDCLASSA = record
  1647.     style: UINT;
  1648.     lpfnWndProc: WNDPROC;
  1649.     cbClsExtra: Integer;
  1650.     cbWndExtra: Integer;
  1651.     hInstance: HINSTANCE;
  1652.     hIcon: HICON;
  1653.     hCursor: HCURSOR;
  1654.     hbrBackground: HBRUSH;
  1655.     lpszMenuName: LPCSTR;
  1656.     lpszClassName: LPCSTR;
  1657.   end;
  1658.   {$EXTERNALSYM tagWNDCLASSA}
  1659.   WNDCLASSA = tagWNDCLASSA;
  1660.   {$EXTERNALSYM WNDCLASSA}
  1661.   NPWNDCLASSA = ^WNDCLASSA;
  1662.   {$EXTERNALSYM NPWNDCLASSA}
  1663.   TWndClassA = WNDCLASSA;
  1664.   PWndClassA = LPWNDCLASSA;
  1665.   LPWNDCLASSW = ^WNDCLASSW;
  1666.   {$EXTERNALSYM LPWNDCLASSW}
  1667.   tagWNDCLASSW = record
  1668.     style: UINT;
  1669.     lpfnWndProc: WNDPROC;
  1670.     cbClsExtra: Integer;
  1671.     cbWndExtra: Integer;
  1672.     hInstance: HINSTANCE;
  1673.     hIcon: HICON;
  1674.     hCursor: HCURSOR;
  1675.     hbrBackground: HBRUSH;
  1676.     lpszMenuName: LPCWSTR;
  1677.     lpszClassName: LPCWSTR;
  1678.   end;
  1679.   {$EXTERNALSYM tagWNDCLASSW}
  1680.   WNDCLASSW = tagWNDCLASSW;
  1681.   {$EXTERNALSYM WNDCLASSW}
  1682.   NPWNDCLASSW = ^WNDCLASSW;
  1683.   {$EXTERNALSYM NPWNDCLASSW}
  1684.   TWndClassW = WNDCLASSW;
  1685.   PWndClassW = LPWNDCLASSW;
  1686. {$IFDEF UNICODE}
  1687.   WNDCLASS = WNDCLASSW;
  1688.   {$EXTERNALSYM WNDCLASS}
  1689.   NPWNDCLASS = NPWNDCLASSW;
  1690.   {$EXTERNALSYM NPWNDCLASS}
  1691.   LPWNDCLASS = LPWNDCLASSW;
  1692.   {$EXTERNALSYM LPWNDCLASS}
  1693.   TWndClass = TWndClassW;
  1694.   PWndClass = PWndClassW;
  1695. {$ELSE}
  1696.   WNDCLASS = WNDCLASSA;
  1697.   {$EXTERNALSYM WNDCLASS}
  1698.   NPWNDCLASS = NPWNDCLASSA;
  1699.   {$EXTERNALSYM NPWNDCLASS}
  1700.   LPWNDCLASS = LPWNDCLASSA;
  1701.   {$EXTERNALSYM LPWNDCLASS}
  1702.   TWndClass = TWndClassA;
  1703.   PWndClass = PWndClassA;
  1704. {$ENDIF}
  1705. function IsHungAppWindow(hwnd: HWND): BOOL; stdcall;
  1706. {$EXTERNALSYM IsHungAppWindow}
  1707. //
  1708. // Message structure
  1709. //
  1710. type
  1711.   LPMSG = ^MSG;
  1712.   {$EXTERNALSYM LPMSG}
  1713.   tagMSG = record
  1714.     hwnd: HWND;
  1715.     message: UINT;
  1716.     wParam: WPARAM;
  1717.     lParam: LPARAM;
  1718.     time: DWORD;
  1719.     pt: POINT;
  1720.   end;
  1721.   {$EXTERNALSYM tagMSG}
  1722.   MSG = tagMSG;
  1723.   {$EXTERNALSYM MSG}
  1724.   NPMSG = ^MSG;
  1725.   {$EXTERNALSYM NPMSG}
  1726.   TMsg = MSG;
  1727.   PMsg = LPMSG;
  1728. function MAKEWPARAM(wLow, wHigh: WORD): WPARAM;
  1729. {$EXTERNALSYM MAKEWPARAM}
  1730. function MAKELPARAM(wLow, wHigh: WORD): LPARAM;
  1731. {$EXTERNALSYM MAKELPARAM}
  1732. function MAKELRESULT(wLow, wHigh: WORD): LRESULT;
  1733. {$EXTERNALSYM MAKELRESULT}
  1734. //
  1735. // Window field offsets for GetWindowLong()
  1736. //
  1737. const
  1738.   GWL_WNDPROC    = -4;
  1739.   {$EXTERNALSYM GWL_WNDPROC}
  1740.   GWL_HINSTANCE  = -6;
  1741.   {$EXTERNALSYM GWL_HINSTANCE}
  1742.   GWL_HWNDPARENT = -8;
  1743.   {$EXTERNALSYM GWL_HWNDPARENT}
  1744.   GWL_STYLE      = -16;
  1745.   {$EXTERNALSYM GWL_STYLE}
  1746.   GWL_EXSTYLE    = -20;
  1747.   {$EXTERNALSYM GWL_EXSTYLE}
  1748.   GWL_USERDATA   = -21;
  1749.   {$EXTERNALSYM GWL_USERDATA}
  1750.   GWL_ID         = -12;
  1751.   {$EXTERNALSYM GWL_ID}
  1752.   GWLP_WNDPROC    = -4;
  1753.   {$EXTERNALSYM GWLP_WNDPROC}
  1754.   GWLP_HINSTANCE  = -6;
  1755.   {$EXTERNALSYM GWLP_HINSTANCE}
  1756.   GWLP_HWNDPARENT = -8;
  1757.   {$EXTERNALSYM GWLP_HWNDPARENT}
  1758.   GWLP_USERDATA   = -21;
  1759.   {$EXTERNALSYM GWLP_USERDATA}
  1760.   GWLP_ID         = -12;
  1761.   {$EXTERNALSYM GWLP_ID}
  1762. //
  1763. // Class field offsets for GetClassLong()
  1764. //
  1765.   GCL_MENUNAME      = DWORD(-8);
  1766.   {$EXTERNALSYM GCL_MENUNAME}
  1767.   GCL_HBRBACKGROUND = DWORD(-10);
  1768.   {$EXTERNALSYM GCL_HBRBACKGROUND}
  1769.   GCL_HCURSOR       = DWORD(-12);
  1770.   {$EXTERNALSYM GCL_HCURSOR}
  1771.   GCL_HICON         = DWORD(-14);
  1772.   {$EXTERNALSYM GCL_HICON}
  1773.   GCL_HMODULE       = DWORD(-16);
  1774.   {$EXTERNALSYM GCL_HMODULE}
  1775.   GCL_CBWNDEXTRA    = DWORD(-18);
  1776.   {$EXTERNALSYM GCL_CBWNDEXTRA}
  1777.   GCL_CBCLSEXTRA    = DWORD(-20);
  1778.   {$EXTERNALSYM GCL_CBCLSEXTRA}
  1779.   GCL_WNDPROC       = DWORD(-24);
  1780.   {$EXTERNALSYM GCL_WNDPROC}
  1781.   GCL_STYLE         = DWORD(-26);
  1782.   {$EXTERNALSYM GCL_STYLE}
  1783.   GCW_ATOM          = DWORD(-32);
  1784.   {$EXTERNALSYM GCW_ATOM}
  1785.   GCL_HICONSM = DWORD(-34);
  1786.   {$EXTERNALSYM GCL_HICONSM}
  1787.   GCLP_MENUNAME      = DWORD(-8);
  1788.   {$EXTERNALSYM GCLP_MENUNAME}
  1789.   GCLP_HBRBACKGROUND = DWORD(-10);
  1790.   {$EXTERNALSYM GCLP_HBRBACKGROUND}
  1791.   GCLP_HCURSOR       = DWORD(-12);
  1792.   {$EXTERNALSYM GCLP_HCURSOR}
  1793.   GCLP_HICON         = DWORD(-14);
  1794.   {$EXTERNALSYM GCLP_HICON}
  1795.   GCLP_HMODULE       = DWORD(-16);
  1796.   {$EXTERNALSYM GCLP_HMODULE}
  1797.   GCLP_WNDPROC       = DWORD(-24);
  1798.   {$EXTERNALSYM GCLP_WNDPROC}
  1799.   GCLP_HICONSM       = DWORD(-34);
  1800.   {$EXTERNALSYM GCLP_HICONSM}
  1801. //
  1802. // Window Messages
  1803. //
  1804.   WM_NULL    = $0000;
  1805.   {$EXTERNALSYM WM_NULL}
  1806.   WM_CREATE  = $0001;
  1807.   {$EXTERNALSYM WM_CREATE}
  1808.   WM_DESTROY = $0002;
  1809.   {$EXTERNALSYM WM_DESTROY}
  1810.   WM_MOVE    = $0003;
  1811.   {$EXTERNALSYM WM_MOVE}
  1812.   WM_SIZE    = $0005;
  1813.   {$EXTERNALSYM WM_SIZE}
  1814.   WM_ACTIVATE = $0006;
  1815.   {$EXTERNALSYM WM_ACTIVATE}
  1816. //
  1817. // WM_ACTIVATE state values
  1818. //
  1819.   WA_INACTIVE    = 0;
  1820.   {$EXTERNALSYM WA_INACTIVE}
  1821.   WA_ACTIVE      = 1;
  1822.   {$EXTERNALSYM WA_ACTIVE}
  1823.   WA_CLICKACTIVE = 2;
  1824.   {$EXTERNALSYM WA_CLICKACTIVE}
  1825.   WM_SETFOCUS        = $0007;
  1826.   {$EXTERNALSYM WM_SETFOCUS}
  1827.   WM_KILLFOCUS       = $0008;
  1828.   {$EXTERNALSYM WM_KILLFOCUS}
  1829.   WM_ENABLE          = $000A;
  1830.   {$EXTERNALSYM WM_ENABLE}
  1831.   WM_SETREDRAW       = $000B;
  1832.   {$EXTERNALSYM WM_SETREDRAW}
  1833.   WM_SETTEXT         = $000C;
  1834.   {$EXTERNALSYM WM_SETTEXT}
  1835.   WM_GETTEXT         = $000D;
  1836.   {$EXTERNALSYM WM_GETTEXT}
  1837.   WM_GETTEXTLENGTH   = $000E;
  1838.   {$EXTERNALSYM WM_GETTEXTLENGTH}
  1839.   WM_PAINT           = $000F;
  1840.   {$EXTERNALSYM WM_PAINT}
  1841.   WM_CLOSE           = $0010;
  1842.   {$EXTERNALSYM WM_CLOSE}
  1843.   WM_QUERYENDSESSION = $0011;
  1844.   {$EXTERNALSYM WM_QUERYENDSESSION}
  1845.   WM_QUERYOPEN       = $0013;
  1846.   {$EXTERNALSYM WM_QUERYOPEN}
  1847.   WM_ENDSESSION      = $0016;
  1848.   {$EXTERNALSYM WM_ENDSESSION}
  1849.   WM_QUIT            = $0012;
  1850.   {$EXTERNALSYM WM_QUIT}
  1851.   WM_ERASEBKGND      = $0014;
  1852.   {$EXTERNALSYM WM_ERASEBKGND}
  1853.   WM_SYSCOLORCHANGE  = $0015;
  1854.   {$EXTERNALSYM WM_SYSCOLORCHANGE}
  1855.   WM_SHOWWINDOW      = $0018;
  1856.   {$EXTERNALSYM WM_SHOWWINDOW}
  1857.   WM_WININICHANGE    = $001A;
  1858.   {$EXTERNALSYM WM_WININICHANGE}
  1859.   WM_SETTINGCHANGE   = WM_WININICHANGE;
  1860.   {$EXTERNALSYM WM_SETTINGCHANGE}
  1861.   WM_DEVMODECHANGE = $001B;
  1862.   {$EXTERNALSYM WM_DEVMODECHANGE}
  1863.   WM_ACTIVATEAPP   = $001C;
  1864.   {$EXTERNALSYM WM_ACTIVATEAPP}
  1865.   WM_FONTCHANGE    = $001D;
  1866.   {$EXTERNALSYM WM_FONTCHANGE}
  1867.   WM_TIMECHANGE    = $001E;
  1868.   {$EXTERNALSYM WM_TIMECHANGE}
  1869.   WM_CANCELMODE    = $001F;
  1870.   {$EXTERNALSYM WM_CANCELMODE}
  1871.   WM_SETCURSOR     = $0020;
  1872.   {$EXTERNALSYM WM_SETCURSOR}
  1873.   WM_MOUSEACTIVATE = $0021;
  1874.   {$EXTERNALSYM WM_MOUSEACTIVATE}
  1875.   WM_CHILDACTIVATE = $0022;
  1876.   {$EXTERNALSYM WM_CHILDACTIVATE}
  1877.   WM_QUEUESYNC     = $0023;
  1878.   {$EXTERNALSYM WM_QUEUESYNC}
  1879.   WM_GETMINMAXINFO = $0024;
  1880.   {$EXTERNALSYM WM_GETMINMAXINFO}
  1881. //
  1882. // Struct pointed to by WM_GETMINMAXINFO lParam
  1883. //
  1884. type
  1885.   LPMINMAXINFO = ^MINMAXINFO;
  1886.   {$EXTERNALSYM LPMINMAXINFO}
  1887.   tagMINMAXINFO = record
  1888.     ptReserved: POINT;
  1889.     ptMaxSize: POINT;
  1890.     ptMaxPosition: POINT;
  1891.     ptMinTrackSize: POINT;
  1892.     ptMaxTrackSize: POINT;
  1893.   end;
  1894.   {$EXTERNALSYM tagMINMAXINFO}
  1895.   MINMAXINFO = tagMINMAXINFO;
  1896.   {$EXTERNALSYM MINMAXINFO}
  1897.   TMinMaxInfo = MINMAXINFO;
  1898.   PMinMaxInfo = LPMINMAXINFO;
  1899. const
  1900.   WM_PAINTICON         = $0026;
  1901.   {$EXTERNALSYM WM_PAINTICON}
  1902.   WM_ICONERASEBKGND    = $0027;
  1903.   {$EXTERNALSYM WM_ICONERASEBKGND}
  1904.   WM_NEXTDLGCTL        = $0028;
  1905.   {$EXTERNALSYM WM_NEXTDLGCTL}
  1906.   WM_SPOOLERSTATUS     = $002A;
  1907.   {$EXTERNALSYM WM_SPOOLERSTATUS}
  1908.   WM_DRAWITEM          = $002B;
  1909.   {$EXTERNALSYM WM_DRAWITEM}
  1910.   WM_MEASUREITEM       = $002C;
  1911.   {$EXTERNALSYM WM_MEASUREITEM}
  1912.   WM_DELETEITEM        = $002D;
  1913.   {$EXTERNALSYM WM_DELETEITEM}
  1914.   WM_VKEYTOITEM        = $002E;
  1915.   {$EXTERNALSYM WM_VKEYTOITEM}
  1916.   WM_CHARTOITEM        = $002F;
  1917.   {$EXTERNALSYM WM_CHARTOITEM}
  1918.   WM_SETFONT           = $0030;
  1919.   {$EXTERNALSYM WM_SETFONT}
  1920.   WM_GETFONT           = $0031;
  1921.   {$EXTERNALSYM WM_GETFONT}
  1922.   WM_SETHOTKEY         = $0032;
  1923.   {$EXTERNALSYM WM_SETHOTKEY}
  1924.   WM_GETHOTKEY         = $0033;
  1925.   {$EXTERNALSYM WM_GETHOTKEY}
  1926.   WM_QUERYDRAGICON     = $0037;
  1927.   {$EXTERNALSYM WM_QUERYDRAGICON}
  1928.   WM_COMPAREITEM       = $0039;
  1929.   {$EXTERNALSYM WM_COMPAREITEM}
  1930.   WM_GETOBJECT         = $003D;
  1931.   {$EXTERNALSYM WM_GETOBJECT}
  1932.   WM_COMPACTING        = $0041;
  1933.   {$EXTERNALSYM WM_COMPACTING}
  1934.   WM_COMMNOTIFY        = $0044; // no longer suported
  1935.   {$EXTERNALSYM WM_COMMNOTIFY}
  1936.   WM_WINDOWPOSCHANGING = $0046;
  1937.   {$EXTERNALSYM WM_WINDOWPOSCHANGING}
  1938.   WM_WINDOWPOSCHANGED  = $0047;
  1939.   {$EXTERNALSYM WM_WINDOWPOSCHANGED}
  1940.   WM_POWER = $0048;
  1941.   {$EXTERNALSYM WM_POWER}
  1942. //
  1943. // wParam for WM_POWER window message and DRV_POWER driver notification
  1944. //
  1945.   PWR_OK             = 1;
  1946.   {$EXTERNALSYM PWR_OK}
  1947.   PWR_FAIL           = DWORD(-1);
  1948.   {$EXTERNALSYM PWR_FAIL}
  1949.   PWR_SUSPENDREQUEST = 1;
  1950.   {$EXTERNALSYM PWR_SUSPENDREQUEST}
  1951.   PWR_SUSPENDRESUME  = 2;
  1952.   {$EXTERNALSYM PWR_SUSPENDRESUME}
  1953.   PWR_CRITICALRESUME = 3;
  1954.   {$EXTERNALSYM PWR_CRITICALRESUME}
  1955.   WM_COPYDATA      = $004A;
  1956.   {$EXTERNALSYM WM_COPYDATA}
  1957.   WM_CANCELJOURNAL = $004B;
  1958.   {$EXTERNALSYM WM_CANCELJOURNAL}
  1959. //
  1960. // lParam of WM_COPYDATA message points to...
  1961. //
  1962. type
  1963.   PCOPYDATASTRUCT = ^COPYDATASTRUCT;
  1964.   tagCOPYDATASTRUCT = record
  1965.     dwData: ULONG_PTR;
  1966.     cbData: DWORD;
  1967.     lpData: PVOID;
  1968.   end;
  1969.   {$EXTERNALSYM tagCOPYDATASTRUCT}
  1970.   COPYDATASTRUCT = tagCOPYDATASTRUCT;
  1971.   {$EXTERNALSYM COPYDATASTRUCT}
  1972.   TCopyDataStruct = COPYDATASTRUCT;
  1973.   LPMDINEXTMENU = ^MDINEXTMENU;
  1974.   {$EXTERNALSYM LPMDINEXTMENU}
  1975.   tagMDINEXTMENU = record
  1976.     hmenuIn: HMENU;
  1977.     hmenuNext: HMENU;
  1978.     hwndNext: HWND;
  1979.   end;
  1980.   {$EXTERNALSYM tagMDINEXTMENU}
  1981.   MDINEXTMENU = tagMDINEXTMENU;
  1982.   {$EXTERNALSYM MDINEXTMENU}
  1983.   TMdiNextMenu = MDINEXTMENU;
  1984.   PMdiNextMenu = LPMDINEXTMENU;
  1985. const
  1986.   WM_NOTIFY                 = $004E;
  1987.   {$EXTERNALSYM WM_NOTIFY}
  1988.   WM_INPUTLANGCHANGEREQUEST = $0050;
  1989.   {$EXTERNALSYM WM_INPUTLANGCHANGEREQUEST}
  1990.   WM_INPUTLANGCHANGE        = $0051;
  1991.   {$EXTERNALSYM WM_INPUTLANGCHANGE}
  1992.   WM_TCARD                  = $0052;
  1993.   {$EXTERNALSYM WM_TCARD}
  1994.   WM_HELP                   = $0053;
  1995.   {$EXTERNALSYM WM_HELP}
  1996.   WM_USERCHANGED            = $0054;
  1997.   {$EXTERNALSYM WM_USERCHANGED}
  1998.   WM_NOTIFYFORMAT           = $0055;
  1999.   {$EXTERNALSYM WM_NOTIFYFORMAT}
  2000.   NFR_ANSI    = 1;
  2001.   {$EXTERNALSYM NFR_ANSI}
  2002.   NFR_UNICODE = 2;
  2003.   {$EXTERNALSYM NFR_UNICODE}
  2004.   NF_QUERY    = 3;
  2005.   {$EXTERNALSYM NF_QUERY}
  2006.   NF_REQUERY  = 4;
  2007.   {$EXTERNALSYM NF_REQUERY}
  2008.   WM_CONTEXTMENU   = $007B;
  2009.   {$EXTERNALSYM WM_CONTEXTMENU}
  2010.   WM_STYLECHANGING = $007C;
  2011.   {$EXTERNALSYM WM_STYLECHANGING}
  2012.   WM_STYLECHANGED  = $007D;
  2013.   {$EXTERNALSYM WM_STYLECHANGED}
  2014.   WM_DISPLAYCHANGE = $007E;
  2015.   {$EXTERNALSYM WM_DISPLAYCHANGE}
  2016.   WM_GETICON       = $007F;
  2017.   {$EXTERNALSYM WM_GETICON}
  2018.   WM_SETICON       = $0080;
  2019.   {$EXTERNALSYM WM_SETICON}
  2020.   WM_NCCREATE        = $0081;
  2021.   {$EXTERNALSYM WM_NCCREATE}
  2022.   WM_NCDESTROY       = $0082;
  2023.   {$EXTERNALSYM WM_NCDESTROY}
  2024.   WM_NCCALCSIZE      = $0083;
  2025.   {$EXTERNALSYM WM_NCCALCSIZE}
  2026.   WM_NCHITTEST       = $0084;
  2027.   {$EXTERNALSYM WM_NCHITTEST}
  2028.   WM_NCPAINT         = $0085;
  2029.   {$EXTERNALSYM WM_NCPAINT}
  2030.   WM_NCACTIVATE      = $0086;
  2031.   {$EXTERNALSYM WM_NCACTIVATE}
  2032.   WM_GETDLGCODE      = $0087;
  2033.   {$EXTERNALSYM WM_GETDLGCODE}
  2034.   WM_SYNCPAINT       = $0088;
  2035.   {$EXTERNALSYM WM_SYNCPAINT}
  2036.   WM_NCMOUSEMOVE     = $00A0;
  2037.   {$EXTERNALSYM WM_NCMOUSEMOVE}
  2038.   WM_NCLBUTTONDOWN   = $00A1;
  2039.   {$EXTERNALSYM WM_NCLBUTTONDOWN}
  2040.   WM_NCLBUTTONUP     = $00A2;
  2041.   {$EXTERNALSYM WM_NCLBUTTONUP}
  2042.   WM_NCLBUTTONDBLCLK = $00A3;
  2043.   {$EXTERNALSYM WM_NCLBUTTONDBLCLK}
  2044.   WM_NCRBUTTONDOWN   = $00A4;
  2045.   {$EXTERNALSYM WM_NCRBUTTONDOWN}
  2046.   WM_NCRBUTTONUP     = $00A5;
  2047.   {$EXTERNALSYM WM_NCRBUTTONUP}
  2048.   WM_NCRBUTTONDBLCLK = $00A6;
  2049.   {$EXTERNALSYM WM_NCRBUTTONDBLCLK}
  2050.   WM_NCMBUTTONDOWN   = $00A7;
  2051.   {$EXTERNALSYM WM_NCMBUTTONDOWN}
  2052.   WM_NCMBUTTONUP     = $00A8;
  2053.   {$EXTERNALSYM WM_NCMBUTTONUP}
  2054.   WM_NCMBUTTONDBLCLK = $00A9;
  2055.   {$EXTERNALSYM WM_NCMBUTTONDBLCLK}
  2056.   WM_NCXBUTTONDOWN   = $00AB;
  2057.   {$EXTERNALSYM WM_NCXBUTTONDOWN}
  2058.   WM_NCXBUTTONUP     = $00AC;
  2059.   {$EXTERNALSYM WM_NCXBUTTONUP}
  2060.   WM_NCXBUTTONDBLCLK = $00AD;
  2061.   {$EXTERNALSYM WM_NCXBUTTONDBLCLK}
  2062.   WM_INPUT           = $00FF;
  2063.   {$EXTERNALSYM WM_INPUT}
  2064.   WM_KEYFIRST    = $0100;
  2065.   {$EXTERNALSYM WM_KEYFIRST}
  2066.   WM_KEYDOWN     = $0100;
  2067.   {$EXTERNALSYM WM_KEYDOWN}
  2068.   WM_KEYUP       = $0101;
  2069.   {$EXTERNALSYM WM_KEYUP}
  2070.   WM_CHAR        = $0102;
  2071.   {$EXTERNALSYM WM_CHAR}
  2072.   WM_DEADCHAR    = $0103;
  2073.   {$EXTERNALSYM WM_DEADCHAR}
  2074.   WM_SYSKEYDOWN  = $0104;
  2075.   {$EXTERNALSYM WM_SYSKEYDOWN}
  2076.   WM_SYSKEYUP    = $0105;
  2077.   {$EXTERNALSYM WM_SYSKEYUP}
  2078.   WM_SYSCHAR     = $0106;
  2079.   {$EXTERNALSYM WM_SYSCHAR}
  2080.   WM_SYSDEADCHAR = $0107;
  2081.   {$EXTERNALSYM WM_SYSDEADCHAR}
  2082. {$IFDEF WIN32_WINNT_GREATER_EQUAL_0501}
  2083.   WM_UNICHAR     = $0109;
  2084.   {$EXTERNALSYM WM_UNICHAR}
  2085.   WM_KEYLAST     = $0109;
  2086.   {$EXTERNALSYM WM_KEYLAST}
  2087.   UNICODE_NOCHAR = $FFFF;
  2088.   {$EXTERNALSYM UNICODE_NOCHAR}
  2089. {$ELSE}
  2090.   WM_KEYLAST     = $0108;
  2091.   {$EXTERNALSYM WM_KEYLAST}
  2092. {$ENDIF}
  2093.   WM_IME_STARTCOMPOSITION = $010D;
  2094.   {$EXTERNALSYM WM_IME_STARTCOMPOSITION}
  2095.   WM_IME_ENDCOMPOSITION   = $010E;
  2096.   {$EXTERNALSYM WM_IME_ENDCOMPOSITION}
  2097.   WM_IME_COMPOSITION      = $010F;
  2098.   {$EXTERNALSYM WM_IME_COMPOSITION}
  2099.   WM_IME_KEYLAST          = $010F;
  2100.   {$EXTERNALSYM WM_IME_KEYLAST}
  2101.   WM_INITDIALOG      = $0110;
  2102.   {$EXTERNALSYM WM_INITDIALOG}
  2103.   WM_COMMAND         = $0111;
  2104.   {$EXTERNALSYM WM_COMMAND}
  2105.   WM_SYSCOMMAND      = $0112;
  2106.   {$EXTERNALSYM WM_SYSCOMMAND}
  2107.   WM_TIMER           = $0113;
  2108.   {$EXTERNALSYM WM_TIMER}
  2109.   WM_HSCROLL         = $0114;
  2110.   {$EXTERNALSYM WM_HSCROLL}
  2111.   WM_VSCROLL         = $0115;
  2112.   {$EXTERNALSYM WM_VSCROLL}
  2113.   WM_INITMENU        = $0116;
  2114.   {$EXTERNALSYM WM_INITMENU}
  2115.   WM_INITMENUPOPUP   = $0117;
  2116.   {$EXTERNALSYM WM_INITMENUPOPUP}
  2117.   WM_MENUSELECT      = $011F;
  2118.   {$EXTERNALSYM WM_MENUSELECT}
  2119.   WM_MENUCHAR        = $0120;
  2120.   {$EXTERNALSYM WM_MENUCHAR}
  2121.   WM_ENTERIDLE       = $0121;
  2122.   {$EXTERNALSYM WM_ENTERIDLE}
  2123.   WM_MENURBUTTONUP   = $0122;
  2124.   {$EXTERNALSYM WM_MENURBUTTONUP}
  2125.   WM_MENUDRAG        = $0123;
  2126.   {$EXTERNALSYM WM_MENUDRAG}
  2127.   WM_MENUGETOBJECT   = $0124;
  2128.   {$EXTERNALSYM WM_MENUGETOBJECT}
  2129.   WM_UNINITMENUPOPUP = $0125;
  2130.   {$EXTERNALSYM WM_UNINITMENUPOPUP}
  2131.   WM_MENUCOMMAND     = $0126;
  2132.   {$EXTERNALSYM WM_MENUCOMMAND}
  2133.   WM_CHANGEUISTATE = $0127;
  2134.   {$EXTERNALSYM WM_CHANGEUISTATE}
  2135.   WM_UPDATEUISTATE = $0128;
  2136.   {$EXTERNALSYM WM_UPDATEUISTATE}
  2137.   WM_QUERYUISTATE  = $0129;
  2138.   {$EXTERNALSYM WM_QUERYUISTATE}
  2139. //
  2140. // LOWORD(wParam) values in WM_*UISTATE*
  2141. //
  2142.   UIS_SET        = 1;
  2143.   {$EXTERNALSYM UIS_SET}
  2144.   UIS_CLEAR      = 2;
  2145.   {$EXTERNALSYM UIS_CLEAR}
  2146.   UIS_INITIALIZE = 3;
  2147.   {$EXTERNALSYM UIS_INITIALIZE}
  2148. //
  2149. // HIWORD(wParam) values in WM_*UISTATE*
  2150. //
  2151.   UISF_HIDEFOCUS = $1;
  2152.   {$EXTERNALSYM UISF_HIDEFOCUS}
  2153.   UISF_HIDEACCEL = $2;
  2154.   {$EXTERNALSYM UISF_HIDEACCEL}
  2155.   UISF_ACTIVE    = $4;
  2156.   {$EXTERNALSYM UISF_ACTIVE}
  2157.   WM_CTLCOLORMSGBOX    = $0132;
  2158.   {$EXTERNALSYM WM_CTLCOLORMSGBOX}
  2159.   WM_CTLCOLOREDIT      = $0133;
  2160.   {$EXTERNALSYM WM_CTLCOLOREDIT}
  2161.   WM_CTLCOLORLISTBOX   = $0134;
  2162.   {$EXTERNALSYM WM_CTLCOLORLISTBOX}
  2163.   WM_CTLCOLORBTN       = $0135;
  2164.   {$EXTERNALSYM WM_CTLCOLORBTN}
  2165.   WM_CTLCOLORDLG       = $0136;
  2166.   {$EXTERNALSYM WM_CTLCOLORDLG}
  2167.   WM_CTLCOLORSCROLLBAR = $0137;
  2168.   {$EXTERNALSYM WM_CTLCOLORSCROLLBAR}
  2169.   WM_CTLCOLORSTATIC    = $0138;
  2170.   {$EXTERNALSYM WM_CTLCOLORSTATIC}
  2171.   WM_MOUSEFIRST    = $0200;
  2172.   {$EXTERNALSYM WM_MOUSEFIRST}
  2173.   WM_MOUSEMOVE     = $0200;
  2174.   {$EXTERNALSYM WM_MOUSEMOVE}
  2175.   WM_LBUTTONDOWN   = $0201;
  2176.   {$EXTERNALSYM WM_LBUTTONDOWN}
  2177.   WM_LBUTTONUP     = $0202;
  2178.   {$EXTERNALSYM WM_LBUTTONUP}
  2179.   WM_LBUTTONDBLCLK = $0203;
  2180.   {$EXTERNALSYM WM_LBUTTONDBLCLK}
  2181.   WM_RBUTTONDOWN   = $0204;
  2182.   {$EXTERNALSYM WM_RBUTTONDOWN}
  2183.   WM_RBUTTONUP     = $0205;
  2184.   {$EXTERNALSYM WM_RBUTTONUP}
  2185.   WM_RBUTTONDBLCLK = $0206;
  2186.   {$EXTERNALSYM WM_RBUTTONDBLCLK}
  2187.   WM_MBUTTONDOWN   = $0207;
  2188.   {$EXTERNALSYM WM_MBUTTONDOWN}
  2189.   WM_MBUTTONUP     = $0208;
  2190.   {$EXTERNALSYM WM_MBUTTONUP}
  2191.   WM_MBUTTONDBLCLK = $0209;
  2192.   {$EXTERNALSYM WM_MBUTTONDBLCLK}
  2193.   WM_MOUSEWHEEL    = $020A;
  2194.   {$EXTERNALSYM WM_MOUSEWHEEL}
  2195.   WM_XBUTTONDOWN   = $020B;
  2196.   {$EXTERNALSYM WM_XBUTTONDOWN}
  2197.   WM_XBUTTONUP     = $020C;
  2198.   {$EXTERNALSYM WM_XBUTTONUP}
  2199.   WM_XBUTTONDBLCLK = $020D;
  2200.   {$EXTERNALSYM WM_XBUTTONDBLCLK}
  2201. {$IFDEF WINNT_0500_GREATER}
  2202.   WM_MOUSELAST = $020D;
  2203.   {$EXTERNALSYM WM_MOUSELAST}
  2204. {$ELSE}
  2205.   {$IFDEF WINNT_0400_GREATER}
  2206.   WM_MOUSELAST = $020A;
  2207.   {$EXTERNALSYM WM_MOUSELAST}
  2208.   {$ELSE}
  2209.     {$IFDEF WINDOWS_0400_GREATER}
  2210.   WM_MOUSELAST = $020A;
  2211.   {$EXTERNALSYM WM_MOUSELAST}
  2212.     {$ELSE}
  2213.   WM_MOUSELAST = $0209;
  2214.   {$EXTERNALSYM WM_MOUSELAST}
  2215.     {$ENDIF}
  2216.   {$ENDIF}
  2217. {$ENDIF}
  2218. // Value for rolling one detent//
  2219.   WHEEL_DELTA                    = 120;
  2220.   {$EXTERNALSYM WHEEL_DELTA}
  2221. function GET_WHEEL_DELTA_WPARAM(wParam: WPARAM): SHORT;
  2222. {$EXTERNALSYM GET_WHEEL_DELTA_WPARAM(wParam)}
  2223. // Setting to scroll one page for SPI_GET/SETWHEELSCROLLLINES//
  2224. const
  2225.   WHEEL_PAGESCROLL = UINT_MAX;
  2226.   {$EXTERNALSYM WHEEL_PAGESCROLL}
  2227. function GET_KEYSTATE_WPARAM(wParam: WPARAM): Integer;
  2228. {$EXTERNALSYM GET_KEYSTATE_WPARAM}
  2229. function GET_NCHITTEST_WPARAM(wParam: WPARAM): Shortint;
  2230. {$EXTERNALSYM GET_NCHITTEST_WPARAM}
  2231. function GET_XBUTTON_WPARAM(wParam: WPARAM): Integer;
  2232. {$EXTERNALSYM GET_XBUTTON_WPARAM}
  2233. // XButton values are WORD flags//
  2234. const
  2235.   XBUTTON1 = $0001;
  2236.   {$EXTERNALSYM XBUTTON1}
  2237.   XBUTTON2 = $0002;
  2238.   {$EXTERNALSYM XBUTTON2}
  2239. // Were there to be an XBUTTON3, it's value would be 0x0004//
  2240.   WM_PARENTNOTIFY  = $0210;
  2241.   {$EXTERNALSYM WM_PARENTNOTIFY}
  2242.   WM_ENTERMENULOOP = $0211;
  2243.   {$EXTERNALSYM WM_ENTERMENULOOP}
  2244.   WM_EXITMENULOOP  = $0212;
  2245.   {$EXTERNALSYM WM_EXITMENULOOP}
  2246.   WM_NEXTMENU       = $0213;
  2247.   {$EXTERNALSYM WM_NEXTMENU}
  2248.   WM_SIZING         = $0214;
  2249.   {$EXTERNALSYM WM_SIZING}
  2250.   WM_CAPTURECHANGED = $0215;
  2251.   {$EXTERNALSYM WM_CAPTURECHANGED}
  2252.   WM_MOVING         = $0216;
  2253.   {$EXTERNALSYM WM_MOVING}
  2254.   WM_POWERBROADCAST = $0218;
  2255.   {$EXTERNALSYM WM_POWERBROADCAST}
  2256.   PBT_APMQUERYSUSPEND = $0000;
  2257.   {$EXTERNALSYM PBT_APMQUERYSUSPEND}
  2258.   PBT_APMQUERYSTANDBY = $0001;
  2259.   {$EXTERNALSYM PBT_APMQUERYSTANDBY}
  2260.   PBT_APMQUERYSUSPENDFAILED = $0002;
  2261.   {$EXTERNALSYM PBT_APMQUERYSUSPENDFAILED}
  2262.   PBT_APMQUERYSTANDBYFAILED = $0003;
  2263.   {$EXTERNALSYM PBT_APMQUERYSTANDBYFAILED}
  2264.   PBT_APMSUSPEND = $0004;
  2265.   {$EXTERNALSYM PBT_APMSUSPEND}
  2266.   PBT_APMSTANDBY = $0005;
  2267.   {$EXTERNALSYM PBT_APMSTANDBY}
  2268.   PBT_APMRESUMECRITICAL = $0006;
  2269.   {$EXTERNALSYM PBT_APMRESUMECRITICAL}
  2270.   PBT_APMRESUMESUSPEND  = $0007;
  2271.   {$EXTERNALSYM PBT_APMRESUMESUSPEND}
  2272.   PBT_APMRESUMESTANDBY  = $0008;
  2273.   {$EXTERNALSYM PBT_APMRESUMESTANDBY}
  2274.   PBTF_APMRESUMEFROMFAILURE = $00000001;
  2275.   {$EXTERNALSYM PBTF_APMRESUMEFROMFAILURE}
  2276.   PBT_APMBATTERYLOW        = $0009;
  2277.   {$EXTERNALSYM PBT_APMBATTERYLOW}
  2278.   PBT_APMPOWERSTATUSCHANGE = $000A;
  2279.   {$EXTERNALSYM PBT_APMPOWERSTATUSCHANGE}
  2280.   PBT_APMOEMEVENT = $000B;
  2281.   {$EXTERNALSYM PBT_APMOEMEVENT}
  2282.   PBT_APMRESUMEAUTOMATIC = $0012;
  2283.   {$EXTERNALSYM PBT_APMRESUMEAUTOMATIC}
  2284.   WM_DEVICECHANGE = $0219;
  2285.   {$EXTERNALSYM WM_DEVICECHANGE}
  2286.   WM_MDICREATE      = $0220;
  2287.   {$EXTERNALSYM WM_MDICREATE}
  2288.   WM_MDIDESTROY     = $0221;
  2289.   {$EXTERNALSYM WM_MDIDESTROY}
  2290.   WM_MDIACTIVATE    = $0222;
  2291.   {$EXTERNALSYM WM_MDIACTIVATE}
  2292.   WM_MDIRESTORE     = $0223;
  2293.   {$EXTERNALSYM WM_MDIRESTORE}
  2294.   WM_MDINEXT        = $0224;
  2295.   {$EXTERNALSYM WM_MDINEXT}
  2296.   WM_MDIMAXIMIZE    = $0225;
  2297.   {$EXTERNALSYM WM_MDIMAXIMIZE}
  2298.   WM_MDITILE        = $0226;
  2299.   {$EXTERNALSYM WM_MDITILE}
  2300.   WM_MDICASCADE     = $0227;
  2301.   {$EXTERNALSYM WM_MDICASCADE}
  2302.   WM_MDIICONARRANGE = $0228;
  2303.   {$EXTERNALSYM WM_MDIICONARRANGE}
  2304.   WM_MDIGETACTIVE   = $0229;
  2305.   {$EXTERNALSYM WM_MDIGETACTIVE}
  2306.   WM_MDISETMENU     = $0230;
  2307.   {$EXTERNALSYM WM_MDISETMENU}
  2308.   WM_ENTERSIZEMOVE  = $0231;
  2309.   {$EXTERNALSYM WM_ENTERSIZEMOVE}
  2310.   WM_EXITSIZEMOVE   = $0232;
  2311.   {$EXTERNALSYM WM_EXITSIZEMOVE}
  2312.   WM_DROPFILES      = $0233;
  2313.   {$EXTERNALSYM WM_DROPFILES}
  2314.   WM_MDIREFRESHMENU = $0234;
  2315.   {$EXTERNALSYM WM_MDIREFRESHMENU}
  2316.   WM_IME_SETCONTEXT      = $0281;
  2317.   {$EXTERNALSYM WM_IME_SETCONTEXT}
  2318.   WM_IME_NOTIFY          = $0282;
  2319.   {$EXTERNALSYM WM_IME_NOTIFY}
  2320.   WM_IME_CONTROL         = $0283;
  2321.   {$EXTERNALSYM WM_IME_CONTROL}
  2322.   WM_IME_COMPOSITIONFULL = $0284;
  2323.   {$EXTERNALSYM WM_IME_COMPOSITIONFULL}
  2324.   WM_IME_SELECT          = $0285;
  2325.   {$EXTERNALSYM WM_IME_SELECT}
  2326.   WM_IME_CHAR            = $0286;
  2327.   {$EXTERNALSYM WM_IME_CHAR}
  2328.   WM_IME_REQUEST         = $0288;
  2329.   {$EXTERNALSYM WM_IME_REQUEST}
  2330.   WM_IME_KEYDOWN         = $0290;
  2331.   {$EXTERNALSYM WM_IME_KEYDOWN}
  2332.   WM_IME_KEYUP           = $0291;
  2333.   {$EXTERNALSYM WM_IME_KEYUP}
  2334.   WM_MOUSEHOVER   = $02A1;
  2335.   {$EXTERNALSYM WM_MOUSEHOVER}
  2336.   WM_MOUSELEAVE   = $02A3;
  2337.   {$EXTERNALSYM WM_MOUSELEAVE}
  2338.   WM_NCMOUSEHOVER = $02A0;
  2339.   {$EXTERNALSYM WM_NCMOUSEHOVER}
  2340.   WM_NCMOUSELEAVE = $02A2;
  2341.   {$EXTERNALSYM WM_NCMOUSELEAVE}
  2342.   WM_WTSSESSION_CHANGE = $02B1;
  2343.   {$EXTERNALSYM WM_WTSSESSION_CHANGE}
  2344.   WM_TABLET_FIRST      = $02c0;
  2345.   {$EXTERNALSYM WM_TABLET_FIRST}
  2346.   WM_TABLET_LAST       = $02df;
  2347.   {$EXTERNALSYM WM_TABLET_LAST}
  2348.   WM_CUT               = $0300;
  2349.   {$EXTERNALSYM WM_CUT}
  2350.   WM_COPY              = $0301;
  2351.   {$EXTERNALSYM WM_COPY}
  2352.   WM_PASTE             = $0302;
  2353.   {$EXTERNALSYM WM_PASTE}
  2354.   WM_CLEAR             = $0303;
  2355.   {$EXTERNALSYM WM_CLEAR}
  2356.   WM_UNDO              = $0304;
  2357.   {$EXTERNALSYM WM_UNDO}
  2358.   WM_RENDERFORMAT      = $0305;
  2359.   {$EXTERNALSYM WM_RENDERFORMAT}
  2360.   WM_RENDERALLFORMATS  = $0306;
  2361.   {$EXTERNALSYM WM_RENDERALLFORMATS}
  2362.   WM_DESTROYCLIPBOARD  = $0307;
  2363.   {$EXTERNALSYM WM_DESTROYCLIPBOARD}
  2364.   WM_DRAWCLIPBOARD     = $0308;
  2365.   {$EXTERNALSYM WM_DRAWCLIPBOARD}
  2366.   WM_PAINTCLIPBOARD    = $0309;
  2367.   {$EXTERNALSYM WM_PAINTCLIPBOARD}
  2368.   WM_VSCROLLCLIPBOARD  = $030A;
  2369.   {$EXTERNALSYM WM_VSCROLLCLIPBOARD}
  2370.   WM_SIZECLIPBOARD     = $030B;
  2371.   {$EXTERNALSYM WM_SIZECLIPBOARD}
  2372.   WM_ASKCBFORMATNAME   = $030C;
  2373.   {$EXTERNALSYM WM_ASKCBFORMATNAME}
  2374.   WM_CHANGECBCHAIN     = $030D;
  2375.   {$EXTERNALSYM WM_CHANGECBCHAIN}
  2376.   WM_HSCROLLCLIPBOARD  = $030E;
  2377.   {$EXTERNALSYM WM_HSCROLLCLIPBOARD}
  2378.   WM_QUERYNEWPALETTE   = $030F;
  2379.   {$EXTERNALSYM WM_QUERYNEWPALETTE}
  2380.   WM_PALETTEISCHANGING = $0310;
  2381.   {$EXTERNALSYM WM_PALETTEISCHANGING}
  2382.   WM_PALETTECHANGED    = $0311;
  2383.   {$EXTERNALSYM WM_PALETTECHANGED}
  2384.   WM_HOTKEY            = $0312;
  2385.   {$EXTERNALSYM WM_HOTKEY}
  2386.   WM_PRINT       = $0317;
  2387.   {$EXTERNALSYM WM_PRINT}
  2388.   WM_PRINTCLIENT = $0318;
  2389.   {$EXTERNALSYM WM_PRINTCLIENT}
  2390.   WM_APPCOMMAND = $0319;
  2391.   {$EXTERNALSYM WM_APPCOMMAND}
  2392.   WM_THEMECHANGED  = $031A;
  2393.   {$EXTERNALSYM WM_THEMECHANGED}
  2394.   WM_HANDHELDFIRST = $0358;
  2395.   {$EXTERNALSYM WM_HANDHELDFIRST}
  2396.   WM_HANDHELDLAST  = $035F;
  2397.   {$EXTERNALSYM WM_HANDHELDLAST}
  2398.   WM_AFXFIRST = $0360;
  2399.   {$EXTERNALSYM WM_AFXFIRST}
  2400.   WM_AFXLAST  = $037F;
  2401.   {$EXTERNALSYM WM_AFXLAST}
  2402.   WM_PENWINFIRST = $0380;
  2403.   {$EXTERNALSYM WM_PENWINFIRST}
  2404.   WM_PENWINLAST  = $038F;
  2405.   {$EXTERNALSYM WM_PENWINLAST}
  2406.   WM_APP = $8000;
  2407.   {$EXTERNALSYM WM_APP}
  2408. //
  2409. // NOTE: All Message Numbers below 0x0400 are RESERVED.
  2410. //
  2411. // Private Window Messages Start Here:
  2412. //
  2413.   WM_USER = $0400;
  2414.   {$EXTERNALSYM WM_USER}
  2415. //  wParam for WM_SIZING message
  2416.   WMSZ_LEFT        = 1;
  2417.   {$EXTERNALSYM WMSZ_LEFT}
  2418.   WMSZ_RIGHT       = 2;
  2419.   {$EXTERNALSYM WMSZ_RIGHT}
  2420.   WMSZ_TOP         = 3;
  2421.   {$EXTERNALSYM WMSZ_TOP}
  2422.   WMSZ_TOPLEFT     = 4;
  2423.   {$EXTERNALSYM WMSZ_TOPLEFT}
  2424.   WMSZ_TOPRIGHT    = 5;
  2425.   {$EXTERNALSYM WMSZ_TOPRIGHT}
  2426.   WMSZ_BOTTOM      = 6;
  2427.   {$EXTERNALSYM WMSZ_BOTTOM}
  2428.   WMSZ_BOTTOMLEFT  = 7;
  2429.   {$EXTERNALSYM WMSZ_BOTTOMLEFT}
  2430.   WMSZ_BOTTOMRIGHT = 8;
  2431.   {$EXTERNALSYM WMSZ_BOTTOMRIGHT}
  2432. //
  2433. // WM_NCHITTEST and MOUSEHOOKSTRUCT Mouse Position Codes
  2434. //
  2435.   HTERROR       = DWORD(-2);
  2436.   {$EXTERNALSYM HTERROR}
  2437.   HTTRANSPARENT = DWORD(-1);
  2438.   {$EXTERNALSYM HTTRANSPARENT}
  2439.   HTNOWHERE     = 0;
  2440.   {$EXTERNALSYM HTNOWHERE}
  2441.   HTCLIENT      = 1;
  2442.   {$EXTERNALSYM HTCLIENT}
  2443.   HTCAPTION     = 2;
  2444.   {$EXTERNALSYM HTCAPTION}
  2445.   HTSYSMENU     = 3;
  2446.   {$EXTERNALSYM HTSYSMENU}
  2447.   HTGROWBOX     = 4;
  2448.   {$EXTERNALSYM HTGROWBOX}
  2449.   HTSIZE        = HTGROWBOX;
  2450.   {$EXTERNALSYM HTSIZE}
  2451.   HTMENU        = 5;
  2452.   {$EXTERNALSYM HTMENU}
  2453.   HTHSCROLL     = 6;
  2454.   {$EXTERNALSYM HTHSCROLL}
  2455.   HTVSCROLL     = 7;
  2456.   {$EXTERNALSYM HTVSCROLL}
  2457.   HTMINBUTTON   = 8;
  2458.   {$EXTERNALSYM HTMINBUTTON}
  2459.   HTMAXBUTTON   = 9;
  2460.   {$EXTERNALSYM HTMAXBUTTON}
  2461.   HTLEFT        = 10;
  2462.   {$EXTERNALSYM HTLEFT}
  2463.   HTRIGHT       = 11;
  2464.   {$EXTERNALSYM HTRIGHT}
  2465.   HTTOP         = 12;
  2466.   {$EXTERNALSYM HTTOP}
  2467.   HTTOPLEFT     = 13;
  2468.   {$EXTERNALSYM HTTOPLEFT}
  2469.   HTTOPRIGHT    = 14;
  2470.   {$EXTERNALSYM HTTOPRIGHT}
  2471.   HTBOTTOM      = 15;
  2472.   {$EXTERNALSYM HTBOTTOM}
  2473.   HTBOTTOMLEFT  = 16;
  2474.   {$EXTERNALSYM HTBOTTOMLEFT}
  2475.   HTBOTTOMRIGHT = 17;
  2476.   {$EXTERNALSYM HTBOTTOMRIGHT}
  2477.   HTBORDER      = 18;
  2478.   {$EXTERNALSYM HTBORDER}
  2479.   HTREDUCE      = HTMINBUTTON;
  2480.   {$EXTERNALSYM HTREDUCE}
  2481.   HTZOOM        = HTMAXBUTTON;
  2482.   {$EXTERNALSYM HTZOOM}
  2483.   HTSIZEFIRST   = HTLEFT;
  2484.   {$EXTERNALSYM HTSIZEFIRST}
  2485.   HTSIZELAST    = HTBOTTOMRIGHT;
  2486.   {$EXTERNALSYM HTSIZELAST}
  2487.   HTOBJECT      = 19;
  2488.   {$EXTERNALSYM HTOBJECT}
  2489.   HTCLOSE       = 20;
  2490.   {$EXTERNALSYM HTCLOSE}
  2491.   HTHELP        = 21;
  2492.   {$EXTERNALSYM HTHELP}
  2493. //
  2494. // SendMessageTimeout values
  2495. //
  2496.   SMTO_NORMAL             = $0000;
  2497.   {$EXTERNALSYM SMTO_NORMAL}
  2498.   SMTO_BLOCK              = $0001;
  2499.   {$EXTERNALSYM SMTO_BLOCK}
  2500.   SMTO_ABORTIFHUNG        = $0002;
  2501.   {$EXTERNALSYM SMTO_ABORTIFHUNG}
  2502.   SMTO_NOTIMEOUTIFNOTHUNG = $0008;
  2503.   {$EXTERNALSYM SMTO_NOTIMEOUTIFNOTHUNG}
  2504. //
  2505. // WM_MOUSEACTIVATE Return Codes
  2506. //
  2507.   MA_ACTIVATE         = 1;
  2508.   {$EXTERNALSYM MA_ACTIVATE}
  2509.   MA_ACTIVATEANDEAT   = 2;
  2510.   {$EXTERNALSYM MA_ACTIVATEANDEAT}
  2511.   MA_NOACTIVATE       = 3;
  2512.   {$EXTERNALSYM MA_NOACTIVATE}
  2513.   MA_NOACTIVATEANDEAT = 4;
  2514.   {$EXTERNALSYM MA_NOACTIVATEANDEAT}
  2515. //
  2516. // WM_SETICON / WM_GETICON Type Codes
  2517. //
  2518.   ICON_SMALL  = 0;
  2519.   {$EXTERNALSYM ICON_SMALL}
  2520.   ICON_BIG    = 1;
  2521.   {$EXTERNALSYM ICON_BIG}
  2522.   ICON_SMALL2 = 2;
  2523.   {$EXTERNALSYM ICON_SMALL2}
  2524. function RegisterWindowMessageA(lpString: LPCSTR): UINT; stdcall;
  2525. {$EXTERNALSYM RegisterWindowMessageA}
  2526. function RegisterWindowMessageW(lpString: LPCWSTR): UINT; stdcall;
  2527. {$EXTERNALSYM RegisterWindowMessageW}
  2528. {$IFDEF UNICODE}
  2529. function RegisterWindowMessage(lpString: LPCWSTR): UINT; stdcall;
  2530. {$EXTERNALSYM RegisterWindowMessage}
  2531. {$ELSE}
  2532. function RegisterWindowMessage(lpString: LPCSTR): UINT; stdcall;
  2533. {$EXTERNALSYM RegisterWindowMessage}
  2534. {$ENDIF}
  2535. //
  2536. // WM_SIZE message wParam values
  2537. //
  2538. const
  2539.   SIZE_RESTORED  = 0;
  2540.   {$EXTERNALSYM SIZE_RESTORED}
  2541.   SIZE_MINIMIZED = 1;
  2542.   {$EXTERNALSYM SIZE_MINIMIZED}
  2543.   SIZE_MAXIMIZED = 2;
  2544.   {$EXTERNALSYM SIZE_MAXIMIZED}
  2545.   SIZE_MAXSHOW   = 3;
  2546.   {$EXTERNALSYM SIZE_MAXSHOW}
  2547.   SIZE_MAXHIDE   = 4;
  2548.   {$EXTERNALSYM SIZE_MAXHIDE}
  2549. //
  2550. // Obsolete constant names
  2551. //
  2552.   SIZENORMAL     = SIZE_RESTORED;
  2553.   {$EXTERNALSYM SIZENORMAL}
  2554.   SIZEICONIC     = SIZE_MINIMIZED;
  2555.   {$EXTERNALSYM SIZEICONIC}
  2556.   SIZEFULLSCREEN = SIZE_MAXIMIZED;
  2557.   {$EXTERNALSYM SIZEFULLSCREEN}
  2558.   SIZEZOOMSHOW   = SIZE_MAXSHOW;
  2559.   {$EXTERNALSYM SIZEZOOMSHOW}
  2560.   SIZEZOOMHIDE   = SIZE_MAXHIDE;
  2561.   {$EXTERNALSYM SIZEZOOMHIDE}
  2562. //
  2563. // WM_WINDOWPOSCHANGING/CHANGED struct pointed to by lParam
  2564. //
  2565. type
  2566.   LPWINDOWPOS = ^WINDOWPOS;
  2567.   {$EXTERNALSYM LPWINDOWPOS}
  2568.   tagWINDOWPOS = record
  2569.     hwnd: HWND;
  2570.     hwndInsertAfter: HWND;
  2571.     x: Integer;
  2572.     y: Integer;
  2573.     cx: Integer;
  2574.     cy: Integer;
  2575.     flags: UINT;
  2576.   end;
  2577.   {$EXTERNALSYM tagWINDOWPOS}
  2578.   WINDOWPOS = tagWINDOWPOS;
  2579.   {$EXTERNALSYM WINDOWPOS}
  2580.   TWindowPos = WINDOWPOS;
  2581.   PWindowPos = LPWINDOWPOS;
  2582. //
  2583. // WM_NCCALCSIZE parameter structure
  2584. //
  2585.   LPNCCALCSIZE_PARAMS = ^NCCALCSIZE_PARAMS;
  2586.   {$EXTERNALSYM LPNCCALCSIZE_PARAMS}
  2587.   NCCALCSIZE_PARAMS = record
  2588.     rgrc: array [0..2] of RECT;
  2589.     lppos: PWINDOWPOS;
  2590.   end;
  2591.   {$EXTERNALSYM NCCALCSIZE_PARAMS}
  2592.   TNcCalcSizeParams = NCCALCSIZE_PARAMS;
  2593.   PNcCalcSizeParams = LPNCCALCSIZE_PARAMS;
  2594. //
  2595. // WM_NCCALCSIZE "window valid rect" return values
  2596. //
  2597. const
  2598.   WVR_ALIGNTOP    = $0010;
  2599.   {$EXTERNALSYM WVR_ALIGNTOP}
  2600.   WVR_ALIGNLEFT   = $0020;
  2601.   {$EXTERNALSYM WVR_ALIGNLEFT}
  2602.   WVR_ALIGNBOTTOM = $0040;
  2603.   {$EXTERNALSYM WVR_ALIGNBOTTOM}
  2604.   WVR_ALIGNRIGHT  = $0080;
  2605.   {$EXTERNALSYM WVR_ALIGNRIGHT}
  2606.   WVR_HREDRAW     = $0100;
  2607.   {$EXTERNALSYM WVR_HREDRAW}
  2608.   WVR_VREDRAW     = $0200;
  2609.   {$EXTERNALSYM WVR_VREDRAW}
  2610.   WVR_REDRAW      = (WVR_HREDRAW or WVR_VREDRAW);
  2611.   {$EXTERNALSYM WVR_REDRAW}
  2612.   WVR_VALIDRECTS  = $0400;
  2613.   {$EXTERNALSYM WVR_VALIDRECTS}
  2614. //
  2615. // Key State Masks for Mouse Messages
  2616. //
  2617.   MK_LBUTTON  = $0001;
  2618.   {$EXTERNALSYM MK_LBUTTON}
  2619.   MK_RBUTTON  = $0002;
  2620.   {$EXTERNALSYM MK_RBUTTON}
  2621.   MK_SHIFT    = $0004;
  2622.   {$EXTERNALSYM MK_SHIFT}
  2623.   MK_CONTROL  = $0008;
  2624.   {$EXTERNALSYM MK_CONTROL}
  2625.   MK_MBUTTON  = $0010;
  2626.   {$EXTERNALSYM MK_MBUTTON}
  2627.   MK_XBUTTON1 = $0020;
  2628.   {$EXTERNALSYM MK_XBUTTON1}
  2629.   MK_XBUTTON2 = $0040;
  2630.   {$EXTERNALSYM MK_XBUTTON2}
  2631.   TME_HOVER     = $00000001;
  2632.   {$EXTERNALSYM TME_HOVER}
  2633.   TME_LEAVE     = $00000002;
  2634.   {$EXTERNALSYM TME_LEAVE}
  2635.   TME_NONCLIENT = $00000010;
  2636.   {$EXTERNALSYM TME_NONCLIENT}
  2637.   TME_QUERY     = $40000000;
  2638.   {$EXTERNALSYM TME_QUERY}
  2639.   TME_CANCEL    = $80000000;
  2640.   {$EXTERNALSYM TME_CANCEL}
  2641.   HOVER_DEFAULT = $FFFFFFFF;
  2642.   {$EXTERNALSYM HOVER_DEFAULT}
  2643. type
  2644.   LPTRACKMOUSEEVENT = ^_TRACKMOUSEEVENT;
  2645.   {$EXTERNALSYM LPTRACKMOUSEEVENT}
  2646.   _TRACKMOUSEEVENT = record
  2647.     cbSize: DWORD;
  2648.     dwFlags: DWORD;
  2649.     hwndTrack: HWND;
  2650.     dwHoverTime: DWORD;
  2651.   end;
  2652.   //TRACKMOUSEEVENT = _TRACKMOUSEEVENT;
  2653.   //{$EXTERNALSYM TRACKMOUSEEVENT}
  2654.   TTrackMouseEvent = _TRACKMOUSEEVENT;
  2655.   PTrackMouseEvent = LPTRACKMOUSEEVENT;
  2656. function TrackMouseEvent(var lpEventTrack: TTrackMouseEvent): BOOL; stdcall;
  2657. {$EXTERNALSYM TrackMouseEvent}
  2658. //
  2659. // Window Styles
  2660. //
  2661. const
  2662.   WS_OVERLAPPED   = $00000000;
  2663.   {$EXTERNALSYM WS_OVERLAPPED}
  2664.   WS_POPUP        = $80000000;
  2665.   {$EXTERNALSYM WS_POPUP}
  2666.   WS_CHILD        = $40000000;
  2667.   {$EXTERNALSYM WS_CHILD}
  2668.   WS_MINIMIZE     = $20000000;
  2669.   {$EXTERNALSYM WS_MINIMIZE}
  2670.   WS_VISIBLE      = $10000000;
  2671.   {$EXTERNALSYM WS_VISIBLE}
  2672.   WS_DISABLED     = $08000000;
  2673.   {$EXTERNALSYM WS_DISABLED}
  2674.   WS_CLIPSIBLINGS = $04000000;
  2675.   {$EXTERNALSYM WS_CLIPSIBLINGS}
  2676.   WS_CLIPCHILDREN = $02000000;
  2677.   {$EXTERNALSYM WS_CLIPCHILDREN}
  2678.   WS_MAXIMIZE     = $01000000;
  2679.   {$EXTERNALSYM WS_MAXIMIZE}
  2680.   WS_CAPTION      = $00C00000; // WS_BORDER | WS_DLGFRAME
  2681.   {$EXTERNALSYM WS_CAPTION}
  2682.   WS_BORDER       = $00800000;
  2683.   {$EXTERNALSYM WS_BORDER}
  2684.   WS_DLGFRAME     = $00400000;
  2685.   {$EXTERNALSYM WS_DLGFRAME}
  2686.   WS_VSCROLL      = $00200000;
  2687.   {$EXTERNALSYM WS_VSCROLL}
  2688.   WS_HSCROLL      = $00100000;
  2689.   {$EXTERNALSYM WS_HSCROLL}
  2690.   WS_SYSMENU      = $00080000;
  2691.   {$EXTERNALSYM WS_SYSMENU}
  2692.   WS_THICKFRAME   = $00040000;
  2693.   {$EXTERNALSYM WS_THICKFRAME}
  2694.   WS_GROUP        = $00020000;
  2695.   {$EXTERNALSYM WS_GROUP}
  2696.   WS_TABSTOP      = $00010000;
  2697.   {$EXTERNALSYM WS_TABSTOP}
  2698.   WS_MINIMIZEBOX = $00020000;
  2699.   {$EXTERNALSYM WS_MINIMIZEBOX}
  2700.   WS_MAXIMIZEBOX = $00010000;
  2701.   {$EXTERNALSYM WS_MAXIMIZEBOX}
  2702.   WS_TILED       = WS_OVERLAPPED;
  2703.   {$EXTERNALSYM WS_TILED}
  2704.   WS_ICONIC      = WS_MINIMIZE;
  2705.   {$EXTERNALSYM WS_ICONIC}
  2706.   WS_SIZEBOX     = WS_THICKFRAME;
  2707.   {$EXTERNALSYM WS_SIZEBOX}
  2708. //
  2709. // Common Window Styles
  2710. //
  2711.   WS_OVERLAPPEDWINDOW = (WS_OVERLAPPED or WS_CAPTION or WS_SYSMENU or
  2712.                          WS_THICKFRAME or WS_MINIMIZEBOX or WS_MAXIMIZEBOX);
  2713.   {$EXTERNALSYM WS_OVERLAPPEDWINDOW}
  2714.   WS_POPUPWINDOW = (WS_POPUP or WS_BORDER or WS_SYSMENU);
  2715.   {$EXTERNALSYM WS_POPUPWINDOW}
  2716.   WS_CHILDWINDOW = (WS_CHILD);
  2717.   {$EXTERNALSYM WS_CHILDWINDOW}
  2718.   WS_TILEDWINDOW = WS_OVERLAPPEDWINDOW;
  2719.   {$EXTERNALSYM WS_TILEDWINDOW}
  2720. //
  2721. // Extended Window Styles
  2722. //
  2723.   WS_EX_DLGMODALFRAME  = $00000001;
  2724.   {$EXTERNALSYM WS_EX_DLGMODALFRAME}
  2725.   WS_EX_NOPARENTNOTIFY = $00000004;
  2726.   {$EXTERNALSYM WS_EX_NOPARENTNOTIFY}
  2727.   WS_EX_TOPMOST        = $00000008;
  2728.   {$EXTERNALSYM WS_EX_TOPMOST}
  2729.   WS_EX_ACCEPTFILES    = $00000010;
  2730.   {$EXTERNALSYM WS_EX_ACCEPTFILES}
  2731.   WS_EX_TRANSPARENT    = $00000020;
  2732.   {$EXTERNALSYM WS_EX_TRANSPARENT}
  2733.   WS_EX_MDICHILD       = $00000040;
  2734.   {$EXTERNALSYM WS_EX_MDICHILD}
  2735.   WS_EX_TOOLWINDOW     = $00000080;
  2736.   {$EXTERNALSYM WS_EX_TOOLWINDOW}
  2737.   WS_EX_WINDOWEDGE     = $00000100;
  2738.   {$EXTERNALSYM WS_EX_WINDOWEDGE}
  2739.   WS_EX_CLIENTEDGE     = $00000200;
  2740.   {$EXTERNALSYM WS_EX_CLIENTEDGE}
  2741.   WS_EX_CONTEXTHELP    = $00000400;
  2742.   {$EXTERNALSYM WS_EX_CONTEXTHELP}
  2743.   WS_EX_RIGHT          = $00001000;
  2744.   {$EXTERNALSYM WS_EX_RIGHT}
  2745.   WS_EX_LEFT           = $00000000;
  2746.   {$EXTERNALSYM WS_EX_LEFT}
  2747.   WS_EX_RTLREADING     = $00002000;
  2748.   {$EXTERNALSYM WS_EX_RTLREADING}
  2749.   WS_EX_LTRREADING     = $00000000;
  2750.   {$EXTERNALSYM WS_EX_LTRREADING}
  2751.   WS_EX_LEFTSCROLLBAR  = $00004000;
  2752.   {$EXTERNALSYM WS_EX_LEFTSCROLLBAR}
  2753.   WS_EX_RIGHTSCROLLBAR = $00000000;
  2754.   {$EXTERNALSYM WS_EX_RIGHTSCROLLBAR}
  2755.   WS_EX_CONTROLPARENT  = $00010000;
  2756.   {$EXTERNALSYM WS_EX_CONTROLPARENT}
  2757.   WS_EX_STATICEDGE     = $00020000;
  2758.   {$EXTERNALSYM WS_EX_STATICEDGE}
  2759.   WS_EX_APPWINDOW      = $00040000;
  2760.   {$EXTERNALSYM WS_EX_APPWINDOW}
  2761.   WS_EX_OVERLAPPEDWINDOW = (WS_EX_WINDOWEDGE or WS_EX_CLIENTEDGE);
  2762.   {$EXTERNALSYM WS_EX_OVERLAPPEDWINDOW}
  2763.   WS_EX_PALETTEWINDOW    = (WS_EX_WINDOWEDGE or WS_EX_TOOLWINDOW or WS_EX_TOPMOST);
  2764.   {$EXTERNALSYM WS_EX_PALETTEWINDOW}
  2765.   WS_EX_LAYERED = $00080000;
  2766.   {$EXTERNALSYM WS_EX_LAYERED}
  2767.   WS_EX_NOINHERITLAYOUT = $00100000; // Disable inheritence of mirroring by children
  2768.   {$EXTERNALSYM WS_EX_NOINHERITLAYOUT}
  2769.   WS_EX_LAYOUTRTL       = $00400000; // Right to left mirroring
  2770.   {$EXTERNALSYM WS_EX_LAYOUTRTL}
  2771.   WS_EX_COMPOSITED = $02000000;
  2772.   {$EXTERNALSYM WS_EX_COMPOSITED}
  2773.   WS_EX_NOACTIVATE = $08000000;
  2774.   {$EXTERNALSYM WS_EX_NOACTIVATE}
  2775. //
  2776. // Class styles
  2777. //
  2778.   CS_VREDRAW         = $0001;
  2779.   {$EXTERNALSYM CS_VREDRAW}
  2780.   CS_HREDRAW         = $0002;
  2781.   {$EXTERNALSYM CS_HREDRAW}
  2782.   CS_DBLCLKS         = $0008;
  2783.   {$EXTERNALSYM CS_DBLCLKS}
  2784.   CS_OWNDC           = $0020;
  2785.   {$EXTERNALSYM CS_OWNDC}
  2786.   CS_CLASSDC         = $0040;
  2787.   {$EXTERNALSYM CS_CLASSDC}
  2788.   CS_PARENTDC        = $0080;
  2789.   {$EXTERNALSYM CS_PARENTDC}
  2790.   CS_NOCLOSE         = $0200;
  2791.   {$EXTERNALSYM CS_NOCLOSE}
  2792.   CS_SAVEBITS        = $0800;
  2793.   {$EXTERNALSYM CS_SAVEBITS}
  2794.   CS_BYTEALIGNCLIENT = $1000;
  2795.   {$EXTERNALSYM CS_BYTEALIGNCLIENT}
  2796.   CS_BYTEALIGNWINDOW = $2000;
  2797.   {$EXTERNALSYM CS_BYTEALIGNWINDOW}
  2798.   CS_GLOBALCLASS     = $4000;
  2799.   {$EXTERNALSYM CS_GLOBALCLASS}
  2800.   CS_IME = $00010000;
  2801.   {$EXTERNALSYM CS_IME}
  2802.   CS_DROPSHADOW = $00020000;
  2803.   {$EXTERNALSYM CS_DROPSHADOW}
  2804. // WM_PRINT flags//
  2805.   PRF_CHECKVISIBLE = $00000001;
  2806.   {$EXTERNALSYM PRF_CHECKVISIBLE}
  2807.   PRF_NONCLIENT    = $00000002;
  2808.   {$EXTERNALSYM PRF_NONCLIENT}
  2809.   PRF_CLIENT       = $00000004;
  2810.   {$EXTERNALSYM PRF_CLIENT}
  2811.   PRF_ERASEBKGND   = $00000008;
  2812.   {$EXTERNALSYM PRF_ERASEBKGND}
  2813.   PRF_CHILDREN     = $00000010;
  2814.   {$EXTERNALSYM PRF_CHILDREN}
  2815.   PRF_OWNED        = $00000020;
  2816.   {$EXTERNALSYM PRF_OWNED}
  2817. // 3D border styles//
  2818.   BDR_RAISEDOUTER = $0001;
  2819.   {$EXTERNALSYM BDR_RAISEDOUTER}
  2820.   BDR_SUNKENOUTER = $0002;
  2821.   {$EXTERNALSYM BDR_SUNKENOUTER}
  2822.   BDR_RAISEDINNER = $0004;
  2823.   {$EXTERNALSYM BDR_RAISEDINNER}
  2824.   BDR_SUNKENINNER = $0008;
  2825.   {$EXTERNALSYM BDR_SUNKENINNER}
  2826.   BDR_OUTER  = (BDR_RAISEDOUTER or BDR_SUNKENOUTER);
  2827.   {$EXTERNALSYM BDR_OUTER}
  2828.   BDR_INNER  = (BDR_RAISEDINNER or BDR_SUNKENINNER);
  2829.   {$EXTERNALSYM BDR_INNER}
  2830.   BDR_RAISED = (BDR_RAISEDOUTER or BDR_RAISEDINNER);
  2831.   {$EXTERNALSYM BDR_RAISED}
  2832.   BDR_SUNKEN = (BDR_SUNKENOUTER or BDR_SUNKENINNER);
  2833.   {$EXTERNALSYM BDR_SUNKEN}
  2834.   EDGE_RAISED = (BDR_RAISEDOUTER or BDR_RAISEDINNER);
  2835.   {$EXTERNALSYM EDGE_RAISED}
  2836.   EDGE_SUNKEN = (BDR_SUNKENOUTER or BDR_SUNKENINNER);
  2837.   {$EXTERNALSYM EDGE_SUNKEN}
  2838.   EDGE_ETCHED = (BDR_SUNKENOUTER or BDR_RAISEDINNER);
  2839.   {$EXTERNALSYM EDGE_ETCHED}
  2840.   EDGE_BUMP   = (BDR_RAISEDOUTER or BDR_SUNKENINNER);
  2841.   {$EXTERNALSYM EDGE_BUMP}
  2842. // Border flags//
  2843.   BF_LEFT   = $0001;
  2844.   {$EXTERNALSYM BF_LEFT}
  2845.   BF_TOP    = $0002;
  2846.   {$EXTERNALSYM BF_TOP}
  2847.   BF_RIGHT  = $0004;
  2848.   {$EXTERNALSYM BF_RIGHT}
  2849.   BF_BOTTOM = $0008;
  2850.   {$EXTERNALSYM BF_BOTTOM}
  2851.   BF_TOPLEFT     = (BF_TOP or BF_LEFT);
  2852.   {$EXTERNALSYM BF_TOPLEFT}
  2853.   BF_TOPRIGHT    = (BF_TOP or BF_RIGHT);
  2854.   {$EXTERNALSYM BF_TOPRIGHT}
  2855.   BF_BOTTOMLEFT  = (BF_BOTTOM or BF_LEFT);
  2856.   {$EXTERNALSYM BF_BOTTOMLEFT}
  2857.   BF_BOTTOMRIGHT = (BF_BOTTOM or BF_RIGHT);
  2858.   {$EXTERNALSYM BF_BOTTOMRIGHT}
  2859.   BF_RECT        = (BF_LEFT or BF_TOP or BF_RIGHT or BF_BOTTOM);
  2860.   {$EXTERNALSYM BF_RECT}
  2861.   BF_DIAGONAL = $0010;
  2862.   {$EXTERNALSYM BF_DIAGONAL}
  2863. // For diagonal lines, the BF_RECT flags specify the end point of the
  2864. // vector bounded by the rectangle parameter.
  2865.   BF_DIAGONAL_ENDTOPRIGHT    = (BF_DIAGONAL or BF_TOP or BF_RIGHT);
  2866.   {$EXTERNALSYM BF_DIAGONAL_ENDTOPRIGHT}
  2867.   BF_DIAGONAL_ENDTOPLEFT     = (BF_DIAGONAL or BF_TOP or BF_LEFT);
  2868.   {$EXTERNALSYM BF_DIAGONAL_ENDTOPLEFT}
  2869.   BF_DIAGONAL_ENDBOTTOMLEFT  = (BF_DIAGONAL or BF_BOTTOM or BF_LEFT);
  2870.   {$EXTERNALSYM BF_DIAGONAL_ENDBOTTOMLEFT}
  2871.   BF_DIAGONAL_ENDBOTTOMRIGHT = (BF_DIAGONAL or BF_BOTTOM or BF_RIGHT);
  2872.   {$EXTERNALSYM BF_DIAGONAL_ENDBOTTOMRIGHT}
  2873.   BF_MIDDLE = $0800; // Fill in the middle
  2874.   {$EXTERNALSYM BF_MIDDLE}
  2875.   BF_SOFT   = $1000; // For softer buttons
  2876.   {$EXTERNALSYM BF_SOFT}
  2877.   BF_ADJUST = $2000; // Calculate the space left over
  2878.   {$EXTERNALSYM BF_ADJUST}
  2879.   BF_FLAT   = $4000; // For flat rather than 3D borders
  2880.   {$EXTERNALSYM BF_FLAT}
  2881.   BF_MONO   = $8000; // For monochrome borders
  2882.   {$EXTERNALSYM BF_MONO}
  2883. function DrawEdge(hdc: HDC; var qrc: RECT; edge, grfFlags: UINT): BOOL; stdcall;
  2884. {$EXTERNALSYM DrawEdge}
  2885. // flags for DrawFrameControl//
  2886. const
  2887.   DFC_CAPTION   = 1;
  2888.   {$EXTERNALSYM DFC_CAPTION}
  2889.   DFC_MENU      = 2;
  2890.   {$EXTERNALSYM DFC_MENU}
  2891.   DFC_SCROLL    = 3;
  2892.   {$EXTERNALSYM DFC_SCROLL}
  2893.   DFC_BUTTON    = 4;
  2894.   {$EXTERNALSYM DFC_BUTTON}
  2895.   DFC_POPUPMENU = 5;
  2896.   {$EXTERNALSYM DFC_POPUPMENU}
  2897.   DFCS_CAPTIONCLOSE   = $0000;
  2898.   {$EXTERNALSYM DFCS_CAPTIONCLOSE}
  2899.   DFCS_CAPTIONMIN     = $0001;
  2900.   {$EXTERNALSYM DFCS_CAPTIONMIN}
  2901.   DFCS_CAPTIONMAX     = $0002;
  2902.   {$EXTERNALSYM DFCS_CAPTIONMAX}
  2903.   DFCS_CAPTIONRESTORE = $0003;
  2904.   {$EXTERNALSYM DFCS_CAPTIONRESTORE}
  2905.   DFCS_CAPTIONHELP    = $0004;
  2906.   {$EXTERNALSYM DFCS_CAPTIONHELP}
  2907.   DFCS_MENUARROW           = $0000;
  2908.   {$EXTERNALSYM DFCS_MENUARROW}
  2909.   DFCS_MENUCHECK           = $0001;
  2910.   {$EXTERNALSYM DFCS_MENUCHECK}
  2911.   DFCS_MENUBULLET          = $0002;
  2912.   {$EXTERNALSYM DFCS_MENUBULLET}
  2913.   DFCS_MENUARROWRIGHT      = $0004;
  2914.   {$EXTERNALSYM DFCS_MENUARROWRIGHT}
  2915.   DFCS_SCROLLUP            = $0000;
  2916.   {$EXTERNALSYM DFCS_SCROLLUP}
  2917.   DFCS_SCROLLDOWN          = $0001;
  2918.   {$EXTERNALSYM DFCS_SCROLLDOWN}
  2919.   DFCS_SCROLLLEFT          = $0002;
  2920.   {$EXTERNALSYM DFCS_SCROLLLEFT}
  2921.   DFCS_SCROLLRIGHT         = $0003;
  2922.   {$EXTERNALSYM DFCS_SCROLLRIGHT}
  2923.   DFCS_SCROLLCOMBOBOX      = $0005;
  2924.   {$EXTERNALSYM DFCS_SCROLLCOMBOBOX}
  2925.   DFCS_SCROLLSIZEGRIP      = $0008;
  2926.   {$EXTERNALSYM DFCS_SCROLLSIZEGRIP}
  2927.   DFCS_SCROLLSIZEGRIPRIGHT = $0010;
  2928.   {$EXTERNALSYM DFCS_SCROLLSIZEGRIPRIGHT}
  2929.   DFCS_BUTTONCHECK      = $0000;
  2930.   {$EXTERNALSYM DFCS_BUTTONCHECK}
  2931.   DFCS_BUTTONRADIOIMAGE = $0001;
  2932.   {$EXTERNALSYM DFCS_BUTTONRADIOIMAGE}
  2933.   DFCS_BUTTONRADIOMASK  = $0002;
  2934.   {$EXTERNALSYM DFCS_BUTTONRADIOMASK}
  2935.   DFCS_BUTTONRADIO      = $0004;
  2936.   {$EXTERNALSYM DFCS_BUTTONRADIO}
  2937.   DFCS_BUTTON3STATE     = $0008;
  2938.   {$EXTERNALSYM DFCS_BUTTON3STATE}
  2939.   DFCS_BUTTONPUSH       = $0010;
  2940.   {$EXTERNALSYM DFCS_BUTTONPUSH}
  2941.   DFCS_INACTIVE = $0100;
  2942.   {$EXTERNALSYM DFCS_INACTIVE}
  2943.   DFCS_PUSHED   = $0200;
  2944.   {$EXTERNALSYM DFCS_PUSHED}
  2945.   DFCS_CHECKED  = $0400;
  2946.   {$EXTERNALSYM DFCS_CHECKED}
  2947.   DFCS_TRANSPARENT = $0800;
  2948.   {$EXTERNALSYM DFCS_TRANSPARENT}
  2949.   DFCS_HOT         = $1000;
  2950.   {$EXTERNALSYM DFCS_HOT}
  2951.   DFCS_ADJUSTRECT = $2000;
  2952.   {$EXTERNALSYM DFCS_ADJUSTRECT}
  2953.   DFCS_FLAT       = $4000;
  2954.   {$EXTERNALSYM DFCS_FLAT}
  2955.   DFCS_MONO       = $8000;
  2956.   {$EXTERNALSYM DFCS_MONO}
  2957. function DrawFrameControl(hdc: HDC; const lprc: RECT; uType, uState: UINT): BOOL; stdcall;
  2958. {$EXTERNALSYM DrawFrameControl}
  2959. // flags for DrawCaption//
  2960. const
  2961.   DC_ACTIVE   = $0001;
  2962.   {$EXTERNALSYM DC_ACTIVE}
  2963.   DC_SMALLCAP = $0002;
  2964.   {$EXTERNALSYM DC_SMALLCAP}
  2965.   DC_ICON     = $0004;
  2966.   {$EXTERNALSYM DC_ICON}
  2967.   DC_TEXT     = $0008;
  2968.   {$EXTERNALSYM DC_TEXT}
  2969.   DC_INBUTTON = $0010;
  2970.   {$EXTERNALSYM DC_INBUTTON}
  2971.   DC_GRADIENT = $0020;
  2972.   {$EXTERNALSYM DC_GRADIENT}
  2973.   DC_BUTTONS  = $1000;
  2974.   {$EXTERNALSYM DC_BUTTONS}
  2975. function DrawCaption(hwnd: HWND; hdc: HDC; const lprc: RECT; uFlags: UINT): BOOL; stdcall;
  2976. {$EXTERNALSYM DrawCaption}
  2977. const
  2978.   IDANI_OPEN = 1;
  2979.   {$EXTERNALSYM IDANI_OPEN}
  2980.   IDANI_CAPTION = 3;
  2981.   {$EXTERNALSYM IDANI_CAPTION}
  2982. function DrawAnimatedRects(hwnd: HWND; idAni: Integer; const lprcFrom, lprcTo: RECT): BOOL; stdcall;
  2983. {$EXTERNALSYM DrawAnimatedRects}
  2984. //
  2985. // Predefined Clipboard Formats
  2986. //
  2987. const
  2988.   CF_TEXT         = 1;
  2989.   {$EXTERNALSYM CF_TEXT}
  2990.   CF_BITMAP       = 2;
  2991.   {$EXTERNALSYM CF_BITMAP}
  2992.   CF_METAFILEPICT = 3;
  2993.   {$EXTERNALSYM CF_METAFILEPICT}
  2994.   CF_SYLK         = 4;
  2995.   {$EXTERNALSYM CF_SYLK}
  2996.   CF_DIF          = 5;
  2997.   {$EXTERNALSYM CF_DIF}
  2998.   CF_TIFF         = 6;
  2999.   {$EXTERNALSYM CF_TIFF}
  3000.   CF_OEMTEXT      = 7;
  3001.   {$EXTERNALSYM CF_OEMTEXT}
  3002.   CF_DIB          = 8;
  3003.   {$EXTERNALSYM CF_DIB}
  3004.   CF_PALETTE      = 9;
  3005.   {$EXTERNALSYM CF_PALETTE}
  3006.   CF_PENDATA      = 10;
  3007.   {$EXTERNALSYM CF_PENDATA}
  3008.   CF_RIFF         = 11;
  3009.   {$EXTERNALSYM CF_RIFF}
  3010.   CF_WAVE         = 12;
  3011.   {$EXTERNALSYM CF_WAVE}
  3012.   CF_UNICODETEXT  = 13;
  3013.   {$EXTERNALSYM CF_UNICODETEXT}
  3014.   CF_ENHMETAFILE  = 14;
  3015.   {$EXTERNALSYM CF_ENHMETAFILE}
  3016.   CF_HDROP        = 15;
  3017.   {$EXTERNALSYM CF_HDROP}
  3018.   CF_LOCALE       = 16;
  3019.   {$EXTERNALSYM CF_LOCALE}
  3020.   CF_DIBV5        = 17;
  3021.   {$EXTERNALSYM CF_DIBV5}
  3022. {$IFDEF WINVER_0500_GREATER}
  3023.   CF_MAX = 18;
  3024.   {$EXTERNALSYM CF_MAX}
  3025. {$ELSE}
  3026.   {$IFDEF WINVER_0400_GREATER}
  3027.   CF_MAX = 17;
  3028.   {$EXTERNALSYM CF_MAX}
  3029.   {$ELSE}
  3030.   CF_MAX = 15;
  3031.   {$EXTERNALSYM CF_MAX}
  3032.   {$ENDIF}
  3033. {$ENDIF}
  3034.   CF_OWNERDISPLAY    = $0080;
  3035.   {$EXTERNALSYM CF_OWNERDISPLAY}
  3036.   CF_DSPTEXT         = $0081;
  3037.   {$EXTERNALSYM CF_DSPTEXT}
  3038.   CF_DSPBITMAP       = $0082;
  3039.   {$EXTERNALSYM CF_DSPBITMAP}
  3040.   CF_DSPMETAFILEPICT = $0083;
  3041.   {$EXTERNALSYM CF_DSPMETAFILEPICT}
  3042.   CF_DSPENHMETAFILE  = $008E;
  3043.   {$EXTERNALSYM CF_DSPENHMETAFILE}
  3044. //
  3045. // "Private" formats don't get GlobalFree()'d
  3046. //
  3047.   CF_PRIVATEFIRST = $0200;
  3048.   {$EXTERNALSYM CF_PRIVATEFIRST}
  3049.   CF_PRIVATELAST  = $02FF;
  3050.   {$EXTERNALSYM CF_PRIVATELAST}
  3051. //
  3052. // "GDIOBJ" formats do get DeleteObject()'d
  3053. //
  3054.   CF_GDIOBJFIRST = $0300;
  3055.   {$EXTERNALSYM CF_GDIOBJFIRST}
  3056.   CF_GDIOBJLAST  = $03FF;
  3057.   {$EXTERNALSYM CF_GDIOBJLAST}
  3058. //
  3059. // Defines for the fVirt field of the Accelerator table structure.
  3060. //
  3061.   FVIRTKEY  = TRUE; // Assumed to be == TRUE
  3062.   {$EXTERNALSYM FVIRTKEY}
  3063.   FNOINVERT = $02;
  3064.   {$EXTERNALSYM FNOINVERT}
  3065.   FSHIFT    = $04;
  3066.   {$EXTERNALSYM FSHIFT}
  3067.   FCONTROL  = $08;
  3068.   {$EXTERNALSYM FCONTROL}
  3069.   FALT      = $10;
  3070.   {$EXTERNALSYM FALT}
  3071. type
  3072.   LPACCEL = ^ACCEL;
  3073.   {$EXTERNALSYM LPACCEL}
  3074.   tagACCEL = record
  3075.     fVirt: BYTE; // Also called the flags field//
  3076.     key: WORD;
  3077.     cmd: WORD;
  3078.   end;
  3079.   {$EXTERNALSYM tagACCEL}
  3080.   ACCEL = tagACCEL;
  3081.   {$EXTERNALSYM ACCEL}
  3082.   TAccel = ACCEL;
  3083.   PAccel = LPACCEL;
  3084.   LPPAINTSTRUCT = ^PAINTSTRUCT;
  3085.   {$EXTERNALSYM LPPAINTSTRUCT}
  3086.   tagPAINTSTRUCT = record
  3087.     hdc: HDC;
  3088.     fErase: BOOL;
  3089.     rcPaint: RECT;
  3090.     fRestore: BOOL;
  3091.     fIncUpdate: BOOL;
  3092.     rgbReserved: array [0..31] of BYTE;
  3093.   end;
  3094.   {$EXTERNALSYM tagPAINTSTRUCT}
  3095.   PAINTSTRUCT = tagPAINTSTRUCT;
  3096.   {$EXTERNALSYM PAINTSTRUCT}
  3097.   NPPAINTSTRUCT = ^PAINTSTRUCT;
  3098.   {$EXTERNALSYM NPPAINTSTRUCT}
  3099.   TPaintStruct = PAINTSTRUCT;
  3100.   PPaintStruct = LPPAINTSTRUCT;
  3101.   LPCREATESTRUCTA = ^CREATESTRUCTA;
  3102.   {$EXTERNALSYM LPCREATESTRUCTA}
  3103.   tagCREATESTRUCTA = record
  3104.     lpCreateParams: LPVOID;
  3105.     hInstance: HINSTANCE;
  3106.     hMenu: HMENU;
  3107.     hwndParent: HWND;
  3108.     cy: Integer;
  3109.     cx: Integer;
  3110.     y: Integer;
  3111.     x: Integer;
  3112.     style: LONG;
  3113.     lpszName: LPCSTR;
  3114.     lpszClass: LPCSTR;
  3115.     dwExStyle: DWORD;
  3116.   end;
  3117.   {$EXTERNALSYM tagCREATESTRUCTA}
  3118.   CREATESTRUCTA = tagCREATESTRUCTA;
  3119.   {$EXTERNALSYM CREATESTRUCTA}
  3120.   TCreateStructA = CREATESTRUCTA;
  3121.   PCreateStructA = LPCREATESTRUCTA;
  3122.   LPCREATESTRUCTW = ^CREATESTRUCTW;
  3123.   {$EXTERNALSYM LPCREATESTRUCTW}
  3124.   tagCREATESTRUCTW = record
  3125.     lpCreateParams: LPVOID;
  3126.     hInstance: HINSTANCE;
  3127.     hMenu: HMENU;
  3128.     hwndParent: HWND;
  3129.     cy: Integer;
  3130.     cx: Integer;
  3131.     y: Integer;
  3132.     x: Integer;
  3133.     style: LONG;
  3134.     lpszName: LPCWSTR;
  3135.     lpszClass: LPCWSTR;
  3136.     dwExStyle: DWORD;
  3137.   end;
  3138.   {$EXTERNALSYM tagCREATESTRUCTW}
  3139.   CREATESTRUCTW = tagCREATESTRUCTW;
  3140.   {$EXTERNALSYM CREATESTRUCTW}
  3141.   TCreateStructW = CREATESTRUCTW;
  3142.   PCreateStructW = LPCREATESTRUCTW;
  3143. {$IFDEF UNICODE}
  3144.   CREATESTRUCT = CREATESTRUCTW;
  3145.   {$EXTERNALSYM CREATESTRUCT}
  3146.   LPCREATESTRUCT = LPCREATESTRUCTW;
  3147.   {$EXTERNALSYM LPCREATESTRUCT}
  3148.   TCreateStruct = TCreateStructW;
  3149.   PCreateStruct = PCreateStructW;
  3150. {$ELSE}
  3151.   CREATESTRUCT = CREATESTRUCTA;
  3152.   {$EXTERNALSYM CREATESTRUCT}
  3153.   LPCREATESTRUCT = LPCREATESTRUCTA;
  3154.   {$EXTERNALSYM LPCREATESTRUCT}
  3155.   TCreateStruct = TCreateStructA;
  3156.   PCreateStruct = PCreateStructA;
  3157. {$ENDIF}
  3158. //
  3159. // HCBT_CREATEWND parameters pointed to by lParam
  3160. //
  3161. type
  3162.   LPCBT_CREATEWNDA = ^CBT_CREATEWNDA;
  3163.   {$EXTERNALSYM LPCBT_CREATEWNDA}
  3164.   tagCBT_CREATEWNDA = record
  3165.     lpcs: LPCREATESTRUCTA;
  3166.     hwndInsertAfter: HWND;
  3167.   end;
  3168.   {$EXTERNALSYM tagCBT_CREATEWNDA}
  3169.   CBT_CREATEWNDA = tagCBT_CREATEWNDA;
  3170.   {$EXTERNALSYM CBT_CREATEWNDA}
  3171.   TCbtCreateWndA = CBT_CREATEWNDA;
  3172.   PCbtCreateWndA = LPCBT_CREATEWNDA;
  3173. //
  3174. // HCBT_CREATEWND parameters pointed to by lParam
  3175. //
  3176.   LPCBT_CREATEWNDW = ^CBT_CREATEWNDW;
  3177.   {$EXTERNALSYM LPCBT_CREATEWNDW}
  3178.   tagCBT_CREATEWNDW = record
  3179.     lpcs: LPCREATESTRUCTW;
  3180.     hwndInsertAfter: HWND;
  3181.   end;
  3182.   {$EXTERNALSYM tagCBT_CREATEWNDW}
  3183.   CBT_CREATEWNDW = tagCBT_CREATEWNDW;
  3184.   {$EXTERNALSYM CBT_CREATEWNDW}
  3185.   TCbtCreateWndW = CBT_CREATEWNDW;
  3186.   PCbtCreateWndW = LPCBT_CREATEWNDW;
  3187. {$IFDEF UNICODE}
  3188.   CBT_CREATEWND = CBT_CREATEWNDW;
  3189.   {$EXTERNALSYM CBT_CREATEWND}
  3190.   LPCBT_CREATEWND = LPCBT_CREATEWNDW;
  3191.   {$EXTERNALSYM LPCBT_CREATEWND}
  3192. {$ELSE}
  3193.   CBT_CREATEWND = CBT_CREATEWNDA;
  3194.   {$EXTERNALSYM CBT_CREATEWND}
  3195.   LPCBT_CREATEWND = LPCBT_CREATEWNDA;
  3196.   {$EXTERNALSYM LPCBT_CREATEWND}
  3197. {$ENDIF}
  3198.   LPWINDOWPLACEMENT = ^WINDOWPLACEMENT;
  3199.   {$EXTERNALSYM LPWINDOWPLACEMENT}
  3200.   tagWINDOWPLACEMENT = record
  3201.     length: UINT;
  3202.     flags: UINT;
  3203.     showCmd: UINT;
  3204.     ptMinPosition: POINT;
  3205.     ptMaxPosition: POINT;
  3206.     rcNormalPosition: RECT;
  3207.   end;
  3208.   {$EXTERNALSYM tagWINDOWPLACEMENT}
  3209.   WINDOWPLACEMENT = tagWINDOWPLACEMENT;
  3210.   {$EXTERNALSYM WINDOWPLACEMENT}
  3211.   TWindowPlacement = WINDOWPLACEMENT;
  3212.   PWindowPlacement = LPWINDOWPLACEMENT;
  3213. const
  3214.   WPF_SETMINPOSITION       = $0001;
  3215.   {$EXTERNALSYM WPF_SETMINPOSITION}
  3216.   WPF_RESTORETOMAXIMIZED   = $0002;
  3217.   {$EXTERNALSYM WPF_RESTORETOMAXIMIZED}
  3218.   WPF_ASYNCWINDOWPLACEMENT = $0004;
  3219.   {$EXTERNALSYM WPF_ASYNCWINDOWPLACEMENT}
  3220. type
  3221.   LPNMHDR = ^NMHDR;
  3222.   {$EXTERNALSYM LPNMHDR}
  3223.   tagNMHDR = record
  3224.     hwndFrom: HWND;
  3225.     idFrom: UINT_PTR;
  3226.     code: UINT; // NM_ code
  3227.   end;
  3228.   {$EXTERNALSYM tagNMHDR}
  3229.   NMHDR = tagNMHDR;
  3230.   {$EXTERNALSYM NMHDR}
  3231.   TNmHdr = NMHDR;
  3232.   PNmHdr = LPNMHDR;
  3233.   LPSTYLESTRUCT = ^STYLESTRUCT;
  3234.   {$EXTERNALSYM LPSTYLESTRUCT}
  3235.   tagSTYLESTRUCT = record
  3236.     styleOld: DWORD;
  3237.     styleNew: DWORD;
  3238.   end;
  3239.   {$EXTERNALSYM tagSTYLESTRUCT}
  3240.   STYLESTRUCT = tagSTYLESTRUCT;
  3241.   {$EXTERNALSYM STYLESTRUCT}
  3242.   TStyleStruct = STYLESTRUCT;
  3243.   PStyleStruct = LPSTYLESTRUCT;
  3244. //
  3245. // Owner draw control types
  3246. //
  3247. const
  3248.   ODT_MENU     = 1;
  3249.   {$EXTERNALSYM ODT_MENU}
  3250.   ODT_LISTBOX  = 2;
  3251.   {$EXTERNALSYM ODT_LISTBOX}
  3252.   ODT_COMBOBOX = 3;
  3253.   {$EXTERNALSYM ODT_COMBOBOX}
  3254.   ODT_BUTTON   = 4;
  3255.   {$EXTERNALSYM ODT_BUTTON}
  3256.   ODT_STATIC   = 5;
  3257.   {$EXTERNALSYM ODT_STATIC}
  3258. //
  3259. // Owner draw actions
  3260. //
  3261.   ODA_DRAWENTIRE = $0001;
  3262.   {$EXTERNALSYM ODA_DRAWENTIRE}
  3263.   ODA_SELECT     = $0002;
  3264.   {$EXTERNALSYM ODA_SELECT}
  3265.   ODA_FOCUS      = $0004;
  3266.   {$EXTERNALSYM ODA_FOCUS}
  3267. //
  3268. // Owner draw state
  3269. //
  3270.   ODS_SELECTED     = $0001;
  3271.   {$EXTERNALSYM ODS_SELECTED}
  3272.   ODS_GRAYED       = $0002;
  3273.   {$EXTERNALSYM ODS_GRAYED}
  3274.   ODS_DISABLED     = $0004;
  3275.   {$EXTERNALSYM ODS_DISABLED}
  3276.   ODS_CHECKED      = $0008;
  3277.   {$EXTERNALSYM ODS_CHECKED}
  3278.   ODS_FOCUS        = $0010;
  3279.   {$EXTERNALSYM ODS_FOCUS}
  3280.   ODS_DEFAULT      = $0020;
  3281.   {$EXTERNALSYM ODS_DEFAULT}
  3282.   ODS_COMBOBOXEDIT = $1000;
  3283.   {$EXTERNALSYM ODS_COMBOBOXEDIT}
  3284.   ODS_HOTLIGHT     = $0040;
  3285.   {$EXTERNALSYM ODS_HOTLIGHT}
  3286.   ODS_INACTIVE     = $0080;
  3287.   {$EXTERNALSYM ODS_INACTIVE}
  3288.   ODS_NOACCEL      = $0100;
  3289.   {$EXTERNALSYM ODS_NOACCEL}
  3290.   ODS_NOFOCUSRECT  = $0200;
  3291.   {$EXTERNALSYM ODS_NOFOCUSRECT}
  3292. //
  3293. // MEASUREITEMSTRUCT for ownerdraw
  3294. //
  3295. type
  3296.   LPMEASUREITEMSTRUCT = ^MEASUREITEMSTRUCT;
  3297.   {$EXTERNALSYM LPMEASUREITEMSTRUCT}
  3298.   tagMEASUREITEMSTRUCT = record
  3299.     CtlType: UINT;
  3300.     CtlID: UINT;
  3301.     itemID: UINT;
  3302.     itemWidth: UINT;
  3303.     itemHeight: UINT;
  3304.     itemData: ULONG_PTR;
  3305.   end;
  3306.   {$EXTERNALSYM tagMEASUREITEMSTRUCT}
  3307.   MEASUREITEMSTRUCT = tagMEASUREITEMSTRUCT;
  3308.   {$EXTERNALSYM MEASUREITEMSTRUCT}
  3309.   TMeasureItemStruct = MEASUREITEMSTRUCT;
  3310.   PMeasureItemStruct = LPMEASUREITEMSTRUCT;
  3311. //
  3312. // DRAWITEMSTRUCT for ownerdraw
  3313. //
  3314.   LPDRAWITEMSTRUCT = ^DRAWITEMSTRUCT;
  3315.   {$EXTERNALSYM LPDRAWITEMSTRUCT}
  3316.   tagDRAWITEMSTRUCT = record
  3317.     CtlType: UINT;
  3318.     CtlID: UINT;
  3319.     itemID: UINT;
  3320.     itemAction: UINT;
  3321.     itemState: UINT;
  3322.     hwndItem: HWND;
  3323.     hDC: HDC;
  3324.     rcItem: RECT;
  3325.     itemData: ULONG_PTR;
  3326.   end;
  3327.   {$EXTERNALSYM tagDRAWITEMSTRUCT}
  3328.   DRAWITEMSTRUCT = tagDRAWITEMSTRUCT;
  3329.   {$EXTERNALSYM DRAWITEMSTRUCT}
  3330.   TDrawItemStruct = DRAWITEMSTRUCT;
  3331.   PDrawItemStruct = LPDRAWITEMSTRUCT;
  3332. //
  3333. // DELETEITEMSTRUCT for ownerdraw
  3334. //
  3335.   LPDELETEITEMSTRUCT = ^DELETEITEMSTRUCT;
  3336.   {$EXTERNALSYM LPDELETEITEMSTRUCT}
  3337.   tagDELETEITEMSTRUCT = record
  3338.     CtlType: UINT;
  3339.     CtlID: UINT;
  3340.     itemID: UINT;
  3341.     hwndItem: HWND;
  3342.     itemData: ULONG_PTR;
  3343.   end;
  3344.   {$EXTERNALSYM tagDELETEITEMSTRUCT}
  3345.   DELETEITEMSTRUCT = tagDELETEITEMSTRUCT;
  3346.   {$EXTERNALSYM DELETEITEMSTRUCT}
  3347.   TDeleteItemStruct = DELETEITEMSTRUCT;
  3348.   PDeleteItemStruct = LPDELETEITEMSTRUCT;
  3349. //
  3350. // COMPAREITEMSTUCT for ownerdraw sorting
  3351. //
  3352.   LPCOMPAREITEMSTRUCT = ^COMPAREITEMSTRUCT;
  3353.   {$EXTERNALSYM LPCOMPAREITEMSTRUCT}
  3354.   tagCOMPAREITEMSTRUCT = record
  3355.     CtlType: UINT;
  3356.     CtlID: UINT;
  3357.     hwndItem: HWND;
  3358.     itemID1: UINT;
  3359.     itemData1: ULONG_PTR;
  3360.     itemID2: UINT;
  3361.     itemData2: ULONG_PTR;
  3362.     dwLocaleId: DWORD;
  3363.   end;
  3364.   {$EXTERNALSYM tagCOMPAREITEMSTRUCT}
  3365.   COMPAREITEMSTRUCT = tagCOMPAREITEMSTRUCT;
  3366.   {$EXTERNALSYM COMPAREITEMSTRUCT}
  3367.   TCompareItemStruct = COMPAREITEMSTRUCT;
  3368.   PCompareItemStruct = LPCOMPAREITEMSTRUCT;
  3369. //
  3370. // Message Function Templates
  3371. //
  3372. function GetMessageA(lpMsg: LPMSG; hWnd: HWND; wMsgFilterMin, wMsgFilterMax: UINT): BOOL; stdcall;
  3373. {$EXTERNALSYM GetMessageA}
  3374. function GetMessageW(lpMsg: LPMSG; hWnd: HWND; wMsgFilterMin, wMsgFilterMax: UINT): BOOL; stdcall;
  3375. {$EXTERNALSYM GetMessageW}
  3376. {$IFDEF UNICODE}
  3377. function GetMessage(lpMsg: LPMSG; hWnd: HWND; wMsgFilterMin, wMsgFilterMax: UINT): BOOL; stdcall;
  3378. {$EXTERNALSYM GetMessage}
  3379. {$ELSE}
  3380. function GetMessage(lpMsg: LPMSG; hWnd: HWND; wMsgFilterMin, wMsgFilterMax: UINT): BOOL; stdcall;
  3381. {$EXTERNALSYM GetMessage}
  3382. {$ENDIF}
  3383. function TranslateMessage(lpMsg: LPMSG): BOOL; stdcall;
  3384. {$EXTERNALSYM TranslateMessage}
  3385. function DispatchMessageA(lpMsg: LPMSG): LRESULT; stdcall;
  3386. {$EXTERNALSYM DispatchMessageA}
  3387. function DispatchMessageW(lpMsg: LPMSG): LRESULT; stdcall;
  3388. {$EXTERNALSYM DispatchMessageW}
  3389. {$IFDEF UNICODE}
  3390. function DispatchMessage(lpMsg: LPMSG): LRESULT; stdcall;
  3391. {$EXTERNALSYM DispatchMessage}
  3392. {$ELSE}
  3393. function DispatchMessage(lpMsg: LPMSG): LRESULT; stdcall;
  3394. {$EXTERNALSYM DispatchMessage}
  3395. {$ENDIF}
  3396. function SetMessageQueue(cMessagesMax: Integer): BOOL; stdcall;
  3397. {$EXTERNALSYM SetMessageQueue}
  3398. function PeekMessageA(var lpMsg: MSG; hWnd: HWND;
  3399.   wMsgFilterMin, wMsgFilterMax, wRemoveMsg: UINT): BOOL; stdcall;
  3400. {$EXTERNALSYM PeekMessageA}
  3401. function PeekMessageW(var lpMsg: MSG; hWnd: HWND;
  3402.   wMsgFilterMin, wMsgFilterMax, wRemoveMsg: UINT): BOOL; stdcall;
  3403. {$EXTERNALSYM PeekMessageW}
  3404. {$IFDEF UNICODE}
  3405. function PeekMessage(var lpMsg: MSG; hWnd: HWND;
  3406.   wMsgFilterMin, wMsgFilterMax, wRemoveMsg: UINT): BOOL; stdcall;
  3407. {$EXTERNALSYM PeekMessage}
  3408. {$ELSE}
  3409. function PeekMessage(var lpMsg: MSG; hWnd: HWND;
  3410.   wMsgFilterMin, wMsgFilterMax, wRemoveMsg: UINT): BOOL; stdcall;
  3411. {$EXTERNALSYM PeekMessage}
  3412. {$ENDIF}
  3413. //
  3414. // Queue status flags for GetQueueStatus() and MsgWaitForMultipleObjects()
  3415. //
  3416. const
  3417.   QS_KEY            = $0001;
  3418.   {$EXTERNALSYM QS_KEY}
  3419.   QS_MOUSEMOVE      = $0002;
  3420.   {$EXTERNALSYM QS_MOUSEMOVE}
  3421.   QS_MOUSEBUTTON    = $0004;
  3422.   {$EXTERNALSYM QS_MOUSEBUTTON}
  3423.   QS_POSTMESSAGE    = $0008;
  3424.   {$EXTERNALSYM QS_POSTMESSAGE}
  3425.   QS_TIMER          = $0010;
  3426.   {$EXTERNALSYM QS_TIMER}
  3427.   QS_PAINT          = $0020;
  3428.   {$EXTERNALSYM QS_PAINT}
  3429.   QS_SENDMESSAGE    = $0040;
  3430.   {$EXTERNALSYM QS_SENDMESSAGE}
  3431.   QS_HOTKEY         = $0080;
  3432.   {$EXTERNALSYM QS_HOTKEY}
  3433.   QS_ALLPOSTMESSAGE = $0100;
  3434.   {$EXTERNALSYM QS_ALLPOSTMESSAGE}
  3435.   QS_RAWINPUT       = $0400;
  3436.   {$EXTERNALSYM QS_RAWINPUT}
  3437.   QS_MOUSE = (QS_MOUSEMOVE or QS_MOUSEBUTTON);
  3438.   {$EXTERNALSYM QS_MOUSE}
  3439.   QS_INPUT = (QS_MOUSE or QS_KEY {$IFDEF WINDOWSXP}or QS_RAWINPUT{$ENDIF});
  3440.   {$EXTERNALSYM QS_INPUT}
  3441.   QS_ALLEVENTS = (QS_INPUT or QS_POSTMESSAGE or QS_TIMER or QS_PAINT or QS_HOTKEY);
  3442.   {$EXTERNALSYM QS_ALLEVENTS}
  3443.   QS_ALLINPUT = (QS_INPUT or QS_POSTMESSAGE or QS_TIMER or QS_PAINT or
  3444.     QS_HOTKEY or QS_SENDMESSAGE);
  3445.   {$EXTERNALSYM QS_ALLINPUT}
  3446. //
  3447. // PeekMessage() Options
  3448. //
  3449. const
  3450.   PM_NOREMOVE       = $0000;
  3451.   {$EXTERNALSYM PM_NOREMOVE}
  3452.   PM_REMOVE         = $0001;
  3453.   {$EXTERNALSYM PM_REMOVE}
  3454.   PM_NOYIELD        = $0002;
  3455.   {$EXTERNALSYM PM_NOYIELD}
  3456.   PM_QS_INPUT       = (QS_INPUT shl 16);
  3457.   {$EXTERNALSYM PM_QS_INPUT}
  3458.   PM_QS_POSTMESSAGE = ((QS_POSTMESSAGE or QS_HOTKEY or QS_TIMER) shl 16);
  3459.   {$EXTERNALSYM PM_QS_POSTMESSAGE}
  3460.   PM_QS_PAINT       = (QS_PAINT shl 16);
  3461.   {$EXTERNALSYM PM_QS_PAINT}
  3462.   PM_QS_SENDMESSAGE = (QS_SENDMESSAGE shl 16);
  3463.   {$EXTERNALSYM PM_QS_SENDMESSAGE}
  3464. function RegisterHotKey(hWnd: HWND; id: Integer; fsModifiers, vk: UINT): BOOL; stdcall;
  3465. {$EXTERNALSYM RegisterHotKey}
  3466. function UnregisterHotKey(hWnd: HWND; id: Integer): BOOL; stdcall;
  3467. {$EXTERNALSYM UnregisterHotKey}
  3468. const
  3469.   MOD_ALT     = $0001;
  3470.   {$EXTERNALSYM MOD_ALT}
  3471.   MOD_CONTROL = $0002;
  3472.   {$EXTERNALSYM MOD_CONTROL}
  3473.   MOD_SHIFT   = $0004;
  3474.   {$EXTERNALSYM MOD_SHIFT}
  3475.   MOD_WIN     = $0008;
  3476.   {$EXTERNALSYM MOD_WIN}
  3477.   IDHOT_SNAPWINDOW  = DWORD(-1); // SHIFT-PRINTSCRN
  3478.   {$EXTERNALSYM IDHOT_SNAPWINDOW}
  3479.   IDHOT_SNAPDESKTOP = DWORD(-2); // PRINTSCRN
  3480.   {$EXTERNALSYM IDHOT_SNAPDESKTOP}
  3481. const
  3482.   ENDSESSION_LOGOFF = DWORD($80000000);
  3483.   {$EXTERNALSYM ENDSESSION_LOGOFF}
  3484.   EWX_LOGOFF      = 0;
  3485.   {$EXTERNALSYM EWX_LOGOFF}
  3486.   EWX_SHUTDOWN    = $00000001;
  3487.   {$EXTERNALSYM EWX_SHUTDOWN}
  3488.   EWX_REBOOT      = $00000002;
  3489.   {$EXTERNALSYM EWX_REBOOT}
  3490.   EWX_FORCE       = $00000004;
  3491.   {$EXTERNALSYM EWX_FORCE}
  3492.   EWX_POWEROFF    = $00000008;
  3493.   {$EXTERNALSYM EWX_POWEROFF}
  3494.   EWX_FORCEIFHUNG = $00000010;
  3495.   {$EXTERNALSYM EWX_FORCEIFHUNG}
  3496. function ExitWindows(dwReserved: DWORD; uREserved: UINT): BOOL;
  3497. {$EXTERNALSYM ExitWindows}
  3498. function ExitWindowsEx(uFlags: UINT; dwReserved: DWORD): BOOL; stdcall;
  3499. {$EXTERNALSYM ExitWindowsEx}
  3500. function SwapMouseButton(fSwap: BOOL): BOOL; stdcall;
  3501. {$EXTERNALSYM SwapMouseButton}
  3502. function GetMessagePos: DWORD; stdcall;
  3503. {$EXTERNALSYM GetMessagePos}
  3504. function GetMessageTime: LONG; stdcall;
  3505. {$EXTERNALSYM GetMessageTime}
  3506. function GetMessageExtraInfo: LPARAM; stdcall;
  3507. {$EXTERNALSYM GetMessageExtraInfo}
  3508. function SetMessageExtraInfo(lParam: LPARAM): LPARAM; stdcall;
  3509. {$EXTERNALSYM SetMessageExtraInfo}
  3510. function SendMessageA(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
  3511. {$EXTERNALSYM SendMessageA}
  3512. function SendMessageW(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
  3513. {$EXTERNALSYM SendMessageW}
  3514. {$IFDEF UNICODE}
  3515. function SendMessage(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
  3516. {$EXTERNALSYM SendMessage}
  3517. {$ELSE}
  3518. function SendMessage(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
  3519. {$EXTERNALSYM SendMessage}
  3520. {$ENDIF}
  3521. function SendMessageTimeoutA(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM;
  3522.   fuFlags, uTimeout: UINT; var lpdwResult: DWORD_PTR): LRESULT; stdcall;
  3523. {$EXTERNALSYM SendMessageTimeoutA}
  3524. function SendMessageTimeoutW(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM;
  3525.   fuFlags, uTimeout: UINT; var lpdwResult: DWORD_PTR): LRESULT; stdcall;
  3526. {$EXTERNALSYM SendMessageTimeoutW}
  3527. {$IFDEF UNICODE}
  3528. function SendMessageTimeout(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM;
  3529.   fuFlags, uTimeout: UINT; var lpdwResult: DWORD_PTR): LRESULT; stdcall;
  3530. {$EXTERNALSYM SendMessageTimeout}
  3531. {$ELSE}
  3532. function SendMessageTimeout(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM;
  3533.   fuFlags, uTimeout: UINT; var lpdwResult: DWORD_PTR): LRESULT; stdcall;
  3534. {$EXTERNALSYM SendMessageTimeout}
  3535. {$ENDIF}
  3536. function SendNotifyMessageA(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): BOOL; stdcall;
  3537. {$EXTERNALSYM SendNotifyMessageA}
  3538. function SendNotifyMessageW(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): BOOL; stdcall;
  3539. {$EXTERNALSYM SendNotifyMessageW}
  3540. {$IFDEF UNICODE}
  3541. function SendNotifyMessage(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): BOOL; stdcall;
  3542. {$EXTERNALSYM SendNotifyMessage}
  3543. {$ELSE}
  3544. function SendNotifyMessage(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): BOOL; stdcall;
  3545. {$EXTERNALSYM SendNotifyMessage}
  3546. {$ENDIF}
  3547. function SendMessageCallbackA(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM;
  3548.   lpResultCallBack: SENDASYNCPROC; dwData: ULONG_PTR): BOOL; stdcall;
  3549. {$EXTERNALSYM SendMessageCallbackA}
  3550. function SendMessageCallbackW(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM;
  3551.   lpResultCallBack: SENDASYNCPROC; dwData: ULONG_PTR): BOOL; stdcall;
  3552. {$EXTERNALSYM SendMessageCallbackW}
  3553. {$IFDEF UNICODE}
  3554. function SendMessageCallback(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM;
  3555.   lpResultCallBack: SENDASYNCPROC; dwData: ULONG_PTR): BOOL; stdcall;
  3556. {$EXTERNALSYM SendMessageCallback}
  3557. {$ELSE}
  3558. function SendMessageCallback(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM;
  3559.   lpResultCallBack: SENDASYNCPROC; dwData: ULONG_PTR): BOOL; stdcall;
  3560. {$EXTERNALSYM SendMessageCallback}
  3561. {$ENDIF}
  3562. type
  3563.   BSMINFO = record
  3564.     cbSize: UINT;
  3565.     hdesk: HDESK;
  3566.     hwnd: HWND;
  3567.     luid: LUID;
  3568.   end;
  3569.   {$EXTERNALSYM BSMINFO}
  3570.   PBSMINFO = ^BSMINFO;
  3571.   TBsmInfo = BSMINFO;
  3572. function BroadcastSystemMessageExA(dwFlags: DWORD; lpwRecipients: LPDWORD; uiMessage: UINT;
  3573.   wParam: WPARAM; lParam: LPARAM; pBSMInfo: PBSMINFO): Longint; stdcall;
  3574. {$EXTERNALSYM BroadcastSystemMessageExA}
  3575. function BroadcastSystemMessageExW(dwFlags: DWORD; lpwRecipients: LPDWORD; uiMessage: UINT;
  3576.   wParam: WPARAM; lParam: LPARAM; pBSMInfo: PBSMINFO): Longint; stdcall;
  3577. {$EXTERNALSYM BroadcastSystemMessageExW}
  3578. {$IFDEF UNICODE}
  3579. function BroadcastSystemMessageEx(dwFlags: DWORD; lpwRecipients: LPDWORD; uiMessage: UINT;
  3580.   wParam: WPARAM; lParam: LPARAM; pBSMInfo: PBSMINFO): Longint; stdcall;
  3581. {$EXTERNALSYM BroadcastSystemMessageEx}
  3582. {$ELSE}
  3583. function BroadcastSystemMessageEx(dwFlags: DWORD; lpwRecipients: LPDWORD; uiMessage: UINT;
  3584.   wParam: WPARAM; lParam: LPARAM; pBSMInfo: PBSMINFO): Longint; stdcall;
  3585. {$EXTERNALSYM BroadcastSystemMessageEx}
  3586. {$ENDIF}
  3587. function BroadcastSystemMessageA(dwFlags: DWORD; lpdwRecipients: LPDWORD;
  3588.   uiMessage: UINT; wParam: WPARAM; lParam: LPARAM): Longint; stdcall;
  3589. {$EXTERNALSYM BroadcastSystemMessageA}
  3590. function BroadcastSystemMessageW(dwFlags: DWORD; lpdwRecipients: LPDWORD;
  3591.   uiMessage: UINT; wParam: WPARAM; lParam: LPARAM): Longint; stdcall;
  3592. {$EXTERNALSYM BroadcastSystemMessageW}
  3593. {$IFDEF UNICODE}
  3594. function BroadcastSystemMessage(dwFlags: DWORD; lpdwRecipients: LPDWORD;
  3595.   uiMessage: UINT; wParam: WPARAM; lParam: LPARAM): Longint; stdcall;
  3596. {$EXTERNALSYM BroadcastSystemMessage}
  3597. {$ELSE}
  3598. function BroadcastSystemMessage(dwFlags: DWORD; lpdwRecipients: LPDWORD;
  3599.   uiMessage: UINT; wParam: WPARAM; lParam: LPARAM): Longint; stdcall;
  3600. {$EXTERNALSYM BroadcastSystemMessage}
  3601. {$ENDIF}
  3602. //Broadcast Special Message Recipient list
  3603. const
  3604.   BSM_ALLCOMPONENTS      = $00000000;
  3605.   {$EXTERNALSYM BSM_ALLCOMPONENTS}
  3606.   BSM_VXDS               = $00000001;
  3607.   {$EXTERNALSYM BSM_VXDS}
  3608.   BSM_NETDRIVER          = $00000002;
  3609.   {$EXTERNALSYM BSM_NETDRIVER}
  3610.   BSM_INSTALLABLEDRIVERS = $00000004;
  3611.   {$EXTERNALSYM BSM_INSTALLABLEDRIVERS}
  3612.   BSM_APPLICATIONS       = $00000008;
  3613.   {$EXTERNALSYM BSM_APPLICATIONS}
  3614.   BSM_ALLDESKTOPS        = $00000010;
  3615.   {$EXTERNALSYM BSM_ALLDESKTOPS}
  3616. //Broadcast Special Message Flags
  3617.   BSF_QUERY              = $00000001;
  3618.   {$EXTERNALSYM BSF_QUERY}
  3619.   BSF_IGNORECURRENTTASK  = $00000002;
  3620.   {$EXTERNALSYM BSF_IGNORECURRENTTASK}
  3621.   BSF_FLUSHDISK          = $00000004;
  3622.   {$EXTERNALSYM BSF_FLUSHDISK}
  3623.   BSF_NOHANG             = $00000008;
  3624.   {$EXTERNALSYM BSF_NOHANG}
  3625.   BSF_POSTMESSAGE        = $00000010;
  3626.   {$EXTERNALSYM BSF_POSTMESSAGE}
  3627.   BSF_FORCEIFHUNG        = $00000020;
  3628.   {$EXTERNALSYM BSF_FORCEIFHUNG}
  3629.   BSF_NOTIMEOUTIFNOTHUNG = $00000040;
  3630.   {$EXTERNALSYM BSF_NOTIMEOUTIFNOTHUNG}
  3631.   BSF_ALLOWSFW           = $00000080;
  3632.   {$EXTERNALSYM BSF_ALLOWSFW}
  3633.   BSF_SENDNOTIFYMESSAGE  = $00000100;
  3634.   {$EXTERNALSYM BSF_SENDNOTIFYMESSAGE}
  3635.   BSF_RETURNHDESK        = $00000200;
  3636.   {$EXTERNALSYM BSF_RETURNHDESK}
  3637.   BSF_LUID               = $00000400;
  3638.   {$EXTERNALSYM BSF_LUID}
  3639.   BROADCAST_QUERY_DENY = $424D5144; // Return this value to deny a query.
  3640.   {$EXTERNALSYM BROADCAST_QUERY_DENY}
  3641. // RegisterDeviceNotification
  3642. type
  3643.   HDEVNOTIFY = PVOID;
  3644.   {$EXTERNALSYM HDEVNOTIFY}
  3645.   PHDEVNOTIFY = ^HDEVNOTIFY;
  3646.   {$EXTERNALSYM PHDEVNOTIFY}
  3647. const
  3648.   DEVICE_NOTIFY_WINDOW_HANDLE  = $00000000;
  3649.   {$EXTERNALSYM DEVICE_NOTIFY_WINDOW_HANDLE}
  3650.   DEVICE_NOTIFY_SERVICE_HANDLE = $00000001;
  3651.   {$EXTERNALSYM DEVICE_NOTIFY_SERVICE_HANDLE}
  3652.   DEVICE_NOTIFY_ALL_INTERFACE_CLASSES = $00000004;
  3653.   {$EXTERNALSYM DEVICE_NOTIFY_ALL_INTERFACE_CLASSES}
  3654. function RegisterDeviceNotificationA(hRecipient: HANDLE; NotificationFilter: LPVOID;
  3655.   Flags: DWORD): HDEVNOTIFY; stdcall;
  3656. {$EXTERNALSYM RegisterDeviceNotificationA}
  3657. function RegisterDeviceNotificationW(hRecipient: HANDLE; NotificationFilter: LPVOID;
  3658.   Flags: DWORD): HDEVNOTIFY; stdcall;
  3659. {$EXTERNALSYM RegisterDeviceNotificationW}
  3660. {$IFDEF UNICODE}
  3661. function RegisterDeviceNotification(hRecipient: HANDLE; NotificationFilter: LPVOID;
  3662.   Flags: DWORD): HDEVNOTIFY; stdcall;
  3663. {$EXTERNALSYM RegisterDeviceNotification}
  3664. {$ELSE}
  3665. function RegisterDeviceNotification(hRecipient: HANDLE; NotificationFilter: LPVOID;
  3666.   Flags: DWORD): HDEVNOTIFY; stdcall;
  3667. {$EXTERNALSYM RegisterDeviceNotification}
  3668. {$ENDIF}
  3669. function UnregisterDeviceNotification(Handle: HDEVNOTIFY): BOOL; stdcall;
  3670. {$EXTERNALSYM UnregisterDeviceNotification}
  3671. function PostMessageA(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): BOOL; stdcall;
  3672. {$EXTERNALSYM PostMessageA}
  3673. function PostMessageW(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): BOOL; stdcall;
  3674. {$EXTERNALSYM PostMessageW}
  3675. {$IFDEF UNICODE}
  3676. function PostMessage(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): BOOL; stdcall;
  3677. {$EXTERNALSYM PostMessage}
  3678. {$ELSE}
  3679. function PostMessage(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): BOOL; stdcall;
  3680. {$EXTERNALSYM PostMessage}
  3681. {$ENDIF}
  3682. function PostThreadMessageA(idThread: DWORD; Msg: UINT; wParam: WPARAM; lParam: LPARAM): BOOL; stdcall;
  3683. {$EXTERNALSYM PostThreadMessageA}
  3684. function PostThreadMessageW(idThread: DWORD; Msg: UINT; wParam: WPARAM; lParam: LPARAM): BOOL; stdcall;
  3685. {$EXTERNALSYM PostThreadMessageW}
  3686. {$IFDEF UNICODE}
  3687. function PostThreadMessage(idThread: DWORD; Msg: UINT; wParam: WPARAM; lParam: LPARAM): BOOL; stdcall;
  3688. {$EXTERNALSYM PostThreadMessage}
  3689. {$ELSE}
  3690. function PostThreadMessage(idThread: DWORD; Msg: UINT; wParam: WPARAM; lParam: LPARAM): BOOL; stdcall;
  3691. {$EXTERNALSYM PostThreadMessage}
  3692. {$ENDIF}
  3693. function PostAppMessageA(idThread: DWORD; wMsg: UINT; wParam: WPARAM; lParam: LPARAM): BOOL;
  3694. {$EXTERNALSYM PostAppMessageA}
  3695. function PostAppMessageW(idThread: DWORD; wMsg: UINT; wParam: WPARAM; lParam: LPARAM): BOOL;
  3696. {$EXTERNALSYM PostAppMessageW}
  3697. {$IFDEF UNICODE}
  3698. function PostAppMessage(idThread: DWORD; wMsg: UINT; wParam: WPARAM; lParam: LPARAM): BOOL;
  3699. {$EXTERNALSYM PostAppMessage}
  3700. {$ELSE}
  3701. function PostAppMessage(idThread: DWORD; wMsg: UINT; wParam: WPARAM; lParam: LPARAM): BOOL;
  3702. {$EXTERNALSYM PostAppMessage}
  3703. {$ENDIF}
  3704. //
  3705. // Special HWND value for use with PostMessage() and SendMessage()
  3706. //
  3707. const
  3708.   HWND_BROADCAST = HWND($ffff);
  3709.   {$EXTERNALSYM HWND_BROADCAST}
  3710.   HWND_MESSAGE = HWND(-3);
  3711.   {$EXTERNALSYM HWND_MESSAGE}
  3712. function AttachThreadInput(idAttach, idAttachTo: DWORD; fAttach: BOOL): BOOL; stdcall;
  3713. {$EXTERNALSYM AttachThreadInput}
  3714. function ReplyMessage(lResult: LRESULT): BOOL; stdcall;
  3715. {$EXTERNALSYM ReplyMessage}
  3716. function WaitMessage: BOOL; stdcall;
  3717. {$EXTERNALSYM WaitMessage}
  3718. function WaitForInputIdle(hProcess: HANDLE; dwMilliseconds: DWORD): DWORD; stdcall;
  3719. {$EXTERNALSYM WaitForInputIdle}
  3720. function DefWindowProcA(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
  3721. {$EXTERNALSYM DefWindowProcA}
  3722. function DefWindowProcW(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
  3723. {$EXTERNALSYM DefWindowProcW}
  3724. {$IFDEF UNICODE}
  3725. function DefWindowProc(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
  3726. {$EXTERNALSYM DefWindowProc}
  3727. {$ELSE}
  3728. function DefWindowProc(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
  3729. {$EXTERNALSYM DefWindowProc}
  3730. {$ENDIF}
  3731. procedure PostQuitMessage(nExitCode: Integer); stdcall;
  3732. {$EXTERNALSYM PostQuitMessage}
  3733. function CallWindowProcA(lpPrevWndFunc: WNDPROC; hWnd: HWND; Msg: UINT;
  3734.   wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
  3735. {$EXTERNALSYM CallWindowProcA}
  3736. function CallWindowProcW(lpPrevWndFunc: WNDPROC; hWnd: HWND; Msg: UINT;
  3737.   wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
  3738. {$EXTERNALSYM CallWindowProcW}
  3739. {$IFDEF UNICODE}
  3740. function CallWindowProc(lpPrevWndFunc: WNDPROC; hWnd: HWND; Msg: UINT;
  3741.   wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
  3742. {$EXTERNALSYM CallWindowProc}
  3743. {$ELSE}
  3744. function CallWindowProc(lpPrevWndFunc: WNDPROC; hWnd: HWND; Msg: UINT;
  3745.   wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
  3746. {$EXTERNALSYM CallWindowProc}
  3747. {$ENDIF}
  3748. function InSendMessage: BOOL; stdcall;
  3749. {$EXTERNALSYM InSendMessage}
  3750. function InSendMessageEx(lpReserved: LPVOID): DWORD; stdcall;
  3751. {$EXTERNALSYM InSendMessageEx}
  3752. //
  3753. // InSendMessageEx return value
  3754. //
  3755. const
  3756.   ISMEX_NOSEND   = $00000000;
  3757.   {$EXTERNALSYM ISMEX_NOSEND}
  3758.   ISMEX_SEND     = $00000001;
  3759.   {$EXTERNALSYM ISMEX_SEND}
  3760.   ISMEX_NOTIFY   = $00000002;
  3761.   {$EXTERNALSYM ISMEX_NOTIFY}
  3762.   ISMEX_CALLBACK = $00000004;
  3763.   {$EXTERNALSYM ISMEX_CALLBACK}
  3764.   ISMEX_REPLIED  = $00000008;
  3765.   {$EXTERNALSYM ISMEX_REPLIED}
  3766. function GetDoubleClickTime: UINT; stdcall;
  3767. {$EXTERNALSYM GetDoubleClickTime}
  3768. function SetDoubleClickTime(uInterval: UINT): BOOL; stdcall;
  3769. {$EXTERNALSYM SetDoubleClickTime}
  3770. function RegisterClassA(const lpWndClass: WNDCLASSA): ATOM; stdcall;
  3771. {$EXTERNALSYM RegisterClassA}
  3772. function RegisterClassW(const lpWndClass: WNDCLASSW): ATOM; stdcall;
  3773. {$EXTERNALSYM RegisterClassW}
  3774. {$IFDEF UNICODE}
  3775. function RegisterClass(const lpWndClass: WNDCLASSW): ATOM; stdcall;
  3776. {$EXTERNALSYM RegisterClass}
  3777. {$ELSE}
  3778. function RegisterClass(const lpWndClass: WNDCLASSA): ATOM; stdcall;
  3779. {$EXTERNALSYM RegisterClass}
  3780. {$ENDIF}
  3781. function UnregisterClassA(lpClassName: LPCSTR; hInstance: HINSTANCE): BOOL; stdcall;
  3782. {$EXTERNALSYM UnregisterClassA}
  3783. function UnregisterClassW(lpClassName: LPCWSTR; hInstance: HINSTANCE): BOOL; stdcall;
  3784. {$EXTERNALSYM UnregisterClassW}
  3785. {$IFDEF UNICODE}
  3786. function UnregisterClass(lpClassName: LPCWSTR; hInstance: HINSTANCE): BOOL; stdcall;
  3787. {$EXTERNALSYM UnregisterClass}
  3788. {$ELSE}
  3789. function UnregisterClass(lpClassName: LPCSTR; hInstance: HINSTANCE): BOOL; stdcall;
  3790. {$EXTERNALSYM UnregisterClass}
  3791. {$ENDIF}
  3792. function GetClassInfoA(hInstance: HINSTANCE; lpClassName: LPCSTR;
  3793.   var lpWndClass: WNDCLASSA): BOOL; stdcall;
  3794. {$EXTERNALSYM GetClassInfoA}
  3795. function GetClassInfoW(hInstance: HINSTANCE; lpClassName: LPCWSTR;
  3796.   var lpWndClass: WNDCLASSW): BOOL; stdcall;
  3797. {$EXTERNALSYM GetClassInfoW}
  3798. {$IFDEF UNICODE}
  3799. function GetClassInfo(hInstance: HINSTANCE; lpClassName: LPCWSTR;
  3800.   var lpWndClass: WNDCLASSW): BOOL; stdcall;
  3801. {$EXTERNALSYM GetClassInfo}
  3802. {$ELSE}
  3803. function GetClassInfo(hInstance: HINSTANCE; lpClassName: LPCSTR;
  3804.   var lpWndClass: WNDCLASSA): BOOL; stdcall;
  3805. {$EXTERNALSYM GetClassInfo}
  3806. {$ENDIF}
  3807. function RegisterClassExA(const lpwcx: WNDCLASSEXA): ATOM; stdcall;
  3808. {$EXTERNALSYM RegisterClassExA}
  3809. function RegisterClassExW(const lpwcx: WNDCLASSEXW): ATOM; stdcall;
  3810. {$EXTERNALSYM RegisterClassExW}
  3811. {$IFDEF UNICODE}
  3812. function RegisterClassEx(const lpwcx: WNDCLASSEXW): ATOM; stdcall;
  3813. {$EXTERNALSYM RegisterClassEx}
  3814. {$ELSE}
  3815. function RegisterClassEx(const lpwcx: WNDCLASSEXA): ATOM; stdcall;
  3816. {$EXTERNALSYM RegisterClassEx}
  3817. {$ENDIF}
  3818. function GetClassInfoExA(hinst: HINSTANCE; lpszClass: LPCSTR; var lpwcx: WNDCLASSEXA): BOOL; stdcall;
  3819. {$EXTERNALSYM GetClassInfoExA}
  3820. function GetClassInfoExW(hinst: HINSTANCE; lpszClass: LPCWSTR; var lpwcx: WNDCLASSEXW): BOOL; stdcall;
  3821. {$EXTERNALSYM GetClassInfoExW}
  3822. {$IFDEF UNICODE}
  3823. function GetClassInfoEx(hinst: HINSTANCE; lpszClass: LPCWSTR; var lpwcx: WNDCLASSEXW): BOOL; stdcall;
  3824. {$EXTERNALSYM GetClassInfoEx}
  3825. {$ELSE}
  3826. function GetClassInfoEx(hinst: HINSTANCE; lpszClass: LPCSTR; var lpwcx: WNDCLASSEXA): BOOL; stdcall;
  3827. {$EXTERNALSYM GetClassInfoEx}
  3828. {$ENDIF}
  3829. const
  3830.   CW_USEDEFAULT = Integer($80000000);
  3831.   {$EXTERNALSYM CW_USEDEFAULT}
  3832. //
  3833. // Special value for CreateWindow, et al.
  3834. //
  3835. const
  3836.   HWND_DESKTOP = HWND(0);
  3837.   {$EXTERNALSYM HWND_DESKTOP}
  3838. type
  3839.   PREGISTERCLASSNAMEW = function (p: LPCWSTR): LongBool; stdcall;
  3840.   {$EXTERNALSYM PREGISTERCLASSNAMEW}
  3841. function CreateWindowExA(dwExStyle: DWORD; lpClassName, lpWindowName: LPCSTR;
  3842.   dwStyle: DWORD; X, Y, nWidth, nHeight: Integer; hWndParent: HWND;
  3843.   hMenu: HMENU; hInstance: HINSTANCE; lpParam: LPVOID): HWND; stdcall;
  3844. {$EXTERNALSYM CreateWindowExA}
  3845. function CreateWindowExW(dwExStyle: DWORD; lpClassName, lpWindowName: LPCWSTR;
  3846.   dwStyle: DWORD; X, Y, nWidth, nHeight: Integer; hWndParent: HWND;
  3847.   hMenu: HMENU; hInstance: HINSTANCE; lpParam: LPVOID): HWND; stdcall;
  3848. {$EXTERNALSYM CreateWindowExW}
  3849. {$IFDEF UNICODE}
  3850. function CreateWindowEx(dwExStyle: DWORD; lpClassName, lpWindowName: LPCWSTR;
  3851.   dwStyle: DWORD; X, Y, nWidth, nHeight: Integer; hWndParent: HWND;
  3852.   hMenu: HMENU; hInstance: HINSTANCE; lpParam: LPVOID): HWND; stdcall;
  3853. {$EXTERNALSYM CreateWindowEx}
  3854. {$ELSE}
  3855. function CreateWindowEx(dwExStyle: DWORD; lpClassName, lpWindowName: LPCSTR;
  3856.   dwStyle: DWORD; X, Y, nWidth, nHeight: Integer; hWndParent: HWND;
  3857.   hMenu: HMENU; hInstance: HINSTANCE; lpParam: LPVOID): HWND; stdcall;
  3858. {$EXTERNALSYM CreateWindowEx}
  3859. {$ENDIF}
  3860. function CreateWindowA(lpClassName, lpWindowName: LPCSTR; dwStyle: DWORD;
  3861.   x, y, nWidth, nHeight: Integer; hWndParent: HWND; hMenu: HMENU;
  3862.   hInstance: HINSTANCE; lpParam: LPVOID): HWND;
  3863. {$EXTERNALSYM CreateWindowA}
  3864. function CreateWindowW(lpClassName, lpWindowName: LPCWSTR; dwStyle: DWORD;
  3865.   x, y, nWidth, nHeight: Integer; hWndParent: HWND; hMenu: HMENU;
  3866.   hInstance: HINSTANCE; lpParam: LPVOID): HWND;
  3867. {$EXTERNALSYM CreateWindowW}
  3868. {$IFDEF UNICODE}
  3869. function CreateWindow(lpClassName, lpWindowName: LPCWSTR; dwStyle: DWORD;
  3870.   x, y, nWidth, nHeight: Integer; hWndParent: HWND; hMenu: HMENU;
  3871.   hInstance: HINSTANCE; lpParam: LPVOID): HWND;
  3872. {$EXTERNALSYM CreateWindow}
  3873. {$ELSE}
  3874. function CreateWindow(lpClassName, lpWindowName: LPCSTR; dwStyle: DWORD;
  3875.   x, y, nWidth, nHeight: Integer; hWndParent: HWND; hMenu: HMENU;
  3876.   hInstance: HINSTANCE; lpParam: LPVOID): HWND;
  3877. {$EXTERNALSYM CreateWindow}
  3878. {$ENDIF}
  3879. function IsWindow(hWnd: HWND): BOOL; stdcall;
  3880. {$EXTERNALSYM IsWindow}
  3881. function IsMenu(hMenu: HMENU): BOOL; stdcall;
  3882. {$EXTERNALSYM IsMenu}
  3883. function IsChild(hWndParent, hWnd: HWND): BOOL; stdcall;
  3884. {$EXTERNALSYM IsChild}
  3885. function DestroyWindow(hWnd: HWND): BOOL; stdcall;
  3886. {$EXTERNALSYM DestroyWindow}
  3887. function ShowWindow(hWnd: HWND; nCmdShow: Integer): BOOL; stdcall;
  3888. {$EXTERNALSYM ShowWindow}
  3889. function AnimateWindow(hWnd: HWND; dwTime, dwFlags: DWORD): BOOL; stdcall;
  3890. {$EXTERNALSYM AnimateWindow}
  3891. function UpdateLayeredWindow(hWnd: HWND; hdcDst: HDC; pptDst: LPPOINT;
  3892.   psize: LPSIZE; hdcSrc: HDC; pptSrc: LPPOINT; crKey: COLORREF;
  3893.   pblend: LPBLENDFUNCTION; dwFlags: DWORD): BOOL; stdcall;
  3894. {$EXTERNALSYM UpdateLayeredWindow}
  3895. function GetLayeredWindowAttributes(hwnd: HWND; pcrKey: LPCOLORREF; pbAlpha: LPBYTE;
  3896.   pdwFlags: LPWORD): BOOL; stdcall;
  3897. {$EXTERNALSYM GetLayeredWindowAttributes}
  3898. const
  3899.   PW_CLIENTONLY = $00000001;
  3900.   {$EXTERNALSYM PW_CLIENTONLY}
  3901. function PrintWindow(hwnd: HWND; hdcBlt: HDC; nFlags: UINT): BOOL; stdcall;
  3902. {$EXTERNALSYM PrintWindow}
  3903. function SetLayeredWindowAttributes(hwnd: HWND; crKey: COLORREF; bAlpha: BYTE;
  3904.   dwFlags: DWORD): BOOL; stdcall;
  3905. {$EXTERNALSYM SetLayeredWindowAttributes}
  3906. const
  3907.   LWA_COLORKEY = $00000001;
  3908.   {$EXTERNALSYM LWA_COLORKEY}
  3909.   LWA_ALPHA    = $00000002;
  3910.   {$EXTERNALSYM LWA_ALPHA}
  3911.   ULW_COLORKEY = $00000001;
  3912.   {$EXTERNALSYM ULW_COLORKEY}
  3913.   ULW_ALPHA    = $00000002;
  3914.   {$EXTERNALSYM ULW_ALPHA}
  3915.   ULW_OPAQUE   = $00000004;
  3916.   {$EXTERNALSYM ULW_OPAQUE}
  3917. function ShowWindowAsync(hWnd: HWND; nCmdShow: Integer): BOOL; stdcall;
  3918. {$EXTERNALSYM ShowWindowAsync}
  3919. function FlashWindow(hWnd: HWND; bInvert: BOOL): BOOL; stdcall;
  3920. {$EXTERNALSYM FlashWindow}
  3921. type
  3922.   PFLASH_INFO = ^FLASH_INFO;
  3923.   {$EXTERNALSYM PFLASH_INFO}
  3924.   FLASH_INFO = record
  3925.     cbSize: UINT;
  3926.     hwnd: HWND;
  3927.     dwFlags: DWORD;
  3928.     uCount: UINT;
  3929.     dwTimeout: DWORD;
  3930.   end;
  3931.   {$EXTERNALSYM FLASH_INFO}
  3932.   TFlashInfo = FLASH_INFO;
  3933.   PFlashInfo = PFLASH_INFO;
  3934. function FlashWindowEx(var pfwi: FLASH_INFO): BOOL; stdcall;
  3935. {$EXTERNALSYM FlashWindowEx}
  3936. const
  3937.   FLASHW_STOP      = 0;
  3938.   {$EXTERNALSYM FLASHW_STOP}
  3939.   FLASHW_CAPTION   = $00000001;
  3940.   {$EXTERNALSYM FLASHW_CAPTION}
  3941.   FLASHW_TRAY      = $00000002;
  3942.   {$EXTERNALSYM FLASHW_TRAY}
  3943.   FLASHW_ALL       = (FLASHW_CAPTION or FLASHW_TRAY);
  3944.   {$EXTERNALSYM FLASHW_ALL}
  3945.   FLASHW_TIMER     = $00000004;
  3946.   {$EXTERNALSYM FLASHW_TIMER}
  3947.   FLASHW_TIMERNOFG = $0000000C;
  3948.   {$EXTERNALSYM FLASHW_TIMERNOFG}
  3949. function ShowOwnedPopups(hWnd: HWND; fShow: BOOL): BOOL; stdcall;
  3950. {$EXTERNALSYM ShowOwnedPopups}
  3951. function OpenIcon(hWnd: HWND): BOOL; stdcall;
  3952. {$EXTERNALSYM OpenIcon}
  3953. function CloseWindow(hWnd: HWND): BOOL; stdcall;
  3954. {$EXTERNALSYM CloseWindow}
  3955. function MoveWindow(hWnd: HWND; X, Y, nWidth, nHeight: Integer; bRepaint: BOOL): BOOL; stdcall;
  3956. {$EXTERNALSYM MoveWindow}
  3957. function SetWindowPos(hWnd, hWndInsertAfter: HWND; X, Y, cx, cy: Integer;
  3958.   uFlags: UINT): BOOL; stdcall;
  3959. {$EXTERNALSYM SetWindowPos}
  3960. function GetWindowPlacement(hWnd: HWND; var lpwndpl: WINDOWPLACEMENT): BOOL; stdcall;
  3961. {$EXTERNALSYM GetWindowPlacement}
  3962. function SetWindowPlacement(hWnd: HWND; const lpwndpl: WINDOWPLACEMENT): BOOL; stdcall;
  3963. {$EXTERNALSYM SetWindowPlacement}
  3964. function BeginDeferWindowPos(nNumWindows: Integer): HDWP; stdcall;
  3965. {$EXTERNALSYM BeginDeferWindowPos}
  3966. function DeferWindowPos(hWinPosInfo: HDWP; hWnd, hWndInsertAfter: HWND;
  3967.   x, y, cx, cy: Integer; uFlags: UINT): HDWP; stdcall;
  3968. {$EXTERNALSYM DeferWindowPos}
  3969. function EndDeferWindowPos(hWinPosInfo: HDWP): BOOL; stdcall;
  3970. {$EXTERNALSYM EndDeferWindowPos}
  3971. function IsWindowVisible(hWnd: HWND): BOOL; stdcall;
  3972. {$EXTERNALSYM IsWindowVisible}
  3973. function IsIconic(hWnd: HWND): BOOL; stdcall;
  3974. {$EXTERNALSYM IsIconic}
  3975. function AnyPopup: BOOL; stdcall;
  3976. {$EXTERNALSYM AnyPopup}
  3977. function BringWindowToTop(hWnd: HWND): BOOL; stdcall;
  3978. {$EXTERNALSYM BringWindowToTop}
  3979. function IsZoomed(hWnd: HWND): BOOL; stdcall;
  3980. {$EXTERNALSYM IsZoomed}
  3981. //
  3982. // SetWindowPos Flags
  3983. //
  3984. const
  3985.   SWP_NOSIZE         = $0001;
  3986.   {$EXTERNALSYM SWP_NOSIZE}
  3987.   SWP_NOMOVE         = $0002;
  3988.   {$EXTERNALSYM SWP_NOMOVE}
  3989.   SWP_NOZORDER       = $0004;
  3990.   {$EXTERNALSYM SWP_NOZORDER}
  3991.   SWP_NOREDRAW       = $0008;
  3992.   {$EXTERNALSYM SWP_NOREDRAW}
  3993.   SWP_NOACTIVATE     = $0010;
  3994.   {$EXTERNALSYM SWP_NOACTIVATE}
  3995.   SWP_FRAMECHANGED   = $0020; // The frame changed: send WM_NCCALCSIZE
  3996.   {$EXTERNALSYM SWP_FRAMECHANGED}
  3997.   SWP_SHOWWINDOW     = $0040;
  3998.   {$EXTERNALSYM SWP_SHOWWINDOW}
  3999.   SWP_HIDEWINDOW     = $0080;
  4000.   {$EXTERNALSYM SWP_HIDEWINDOW}
  4001.   SWP_NOCOPYBITS     = $0100;
  4002.   {$EXTERNALSYM SWP_NOCOPYBITS}
  4003.   SWP_NOOWNERZORDER  = $0200; // Don't do owner Z ordering
  4004.   {$EXTERNALSYM SWP_NOOWNERZORDER}
  4005.   SWP_NOSENDCHANGING = $0400; // Don't send WM_WINDOWPOSCHANGING
  4006.   {$EXTERNALSYM SWP_NOSENDCHANGING}
  4007.   SWP_DRAWFRAME    = SWP_FRAMECHANGED;
  4008.   {$EXTERNALSYM SWP_DRAWFRAME}
  4009.   SWP_NOREPOSITION = SWP_NOOWNERZORDER;
  4010.   {$EXTERNALSYM SWP_NOREPOSITION}
  4011.   SWP_DEFERERASE     = $2000;
  4012.   {$EXTERNALSYM SWP_DEFERERASE}
  4013.   SWP_ASYNCWINDOWPOS = $4000;
  4014.   {$EXTERNALSYM SWP_ASYNCWINDOWPOS}
  4015.   HWND_TOP       = HWND(0);
  4016.   {$EXTERNALSYM HWND_TOP}
  4017.   HWND_BOTTOM    = HWND(1);
  4018.   {$EXTERNALSYM HWND_BOTTOM}
  4019.   HWND_TOPMOST   = HWND(-1);
  4020.   {$EXTERNALSYM HWND_TOPMOST}
  4021.   HWND_NOTOPMOST = HWND(-2);
  4022.   {$EXTERNALSYM HWND_NOTOPMOST}
  4023. //
  4024. // WARNING:
  4025. // The following structures must NOT be DWORD padded because they are
  4026. // followed by strings, etc that do not have to be DWORD aligned.
  4027. //
  4028. // #include <pshpack2.h>
  4029. //