GetGUIThreadInfo missing definition lazarus / 21-General ---------------------------------------------------------------------- 440bx · 2024-04-29 02:57 Hello, For some reason the definition of Windows user32 API, GetGUIDThreadInfo GetGUIThreadInfo in redef.inc is commented out.  This is a problem when attempting to use the function. The function and the structure it uses could be defined as follows (parallel to MSDN):Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i type  PGUITHREADINFO = ^TGUITHREADINFO;  TGUITHREADINFO = record    cbSize           : DWORD;     { must be initialized before the call       }    flags            : DWORD;    hwndActive       : HWND;    hwndFocus        : HWND;    hwndCapture      : HWND;    hwndMenuOwner    : HWND;    hwndMoveSize     : HWND;    hwndCaret      : HWND;    rcCaret          : TRECT;  end; function GetGUIThreadInfo           (            InThreadId         : DWORD;          InoutGuiThreadInfo : PGUITHREADINFO           )         : BOOL; stdcall; external 'user32'; function GetGUIThreadInfo           (                InThreadId         : DWORD;            var InoutGuiThreadInfo : TGUITHREADINFO           )         : BOOL; stdcall; external 'user32'; overload; the first definition exactly mirrors the C definition.  The second definition is "Pascalish" in that it uses "var" (which in this case is appropriate since the structure must be initialized before being used.) HTH. ETA: Corrected the function's name. ---------------------------------------------------------------------- Thaddy · 2024-04-29 07:23 isn't it TGuiTHreadInfo? not related to GUID. ---------------------------------------------------------------------- 440bx · 2024-04-29 07:33 Quote from: Thaddy on April 29, 2024, 09:23:43 amisn't it TGuiTHreadInfo? not related to GUID. You are correct.  It is GetGUIThreadInfo (no "D" in there.)  Thank you for bringing that to my attention. ---------------------------------------------------------------------- marcov · 2024-04-29 08:18 Prototypes using VAR instead of pointers (in redef) are only added for Delphi compatibility or for extremely highly used functions.