Автор: KerberX
Дата сообщения: 01.02.2016 20:25
Grasss
Могу предложить такое. Требуется плагин MemoryEx.
[more]
Код: function Input.SetStyle(sObjectName)
local tInfo = Input.GetProperties(sObjectName);
if tInfo ~= nil then
Input.SetProperties(sObjectName, {Border = BORDER_SUNKEN});
--
local GWL_STYLE = -16;
local WS_CHILD = 0x40000000;
local WS_VISIBLE = 0x10000000;
local WS_TABSTOP = 0x00010000;
local ES_AUTOHSCROLL = 0x0080;
local WS_VSCROLL = 0x00200000;
local ES_MULTILINE = 0x0004;
--
local hWnd = Input.GetProperties(sObjectName).WindowHandle;
local nStyle = WS_CHILD + WS_VISIBLE + WS_TABSTOP + ES_AUTOHSCROLL;
if tInfo.Multiline == true then
nStyle = WS_CHILD + WS_VISIBLE + WS_TABSTOP + ES_AUTOHSCROLL + ES_MULTILINE + WS_VSCROLL;
end
--
local hDLL = Library.Load("user32.dll", false);
hDLL.SetWindowLongA(hWnd, GWL_STYLE, nStyle);
hDLL:Close_();
--
local tSize = Input.GetSize(sObjectName);
Input.SetSize(sObjectName, tSize.Width, tSize.Height + 1);
Input.SetSize(sObjectName, tSize.Width, tSize.Height);
end
end
function Input.SetPlaceholder(sObjectName, sPlaceholder, bAlways)
local tInfo = Input.GetProperties(sObjectName);
if tInfo ~= nil then
local hWnd = Input.GetProperties(sObjectName).WindowHandle;
local EM_SETCUEBANNER = 0x1501;
--
local hBuffer = MemoryEx.Allocate(256);
MemoryEx.String(hBuffer, #sPlaceholder, MEMEX_UNICODE, sPlaceholder);
--
local nAlways = 0;
if bAlways == true then
nAlways = 1;
end
--
local hDLL = Library.Load("user32.dll", false);
hDLL.SendMessageA(hWnd, EM_SETCUEBANNER, nAlways, hBuffer);
hDLL:Close_();
MemoryEx.Free(hBuffer);
--
local tSize = Input.GetSize(sObjectName);
Input.SetSize(sObjectName, tSize.Width, tSize.Height + 1);
Input.SetSize(sObjectName, tSize.Width, tSize.Height);
end
end