Re: Efecto Aero Glass en AMS by Agotaras123
Publicado: 09 May 2011 04:20
o, lo siento no lo habia notado :( pero gracias por hacermelo notar (:
Foro Especializado en Autoplay Media Studio y más...
http://www.amsspecialist.com/
function ExtendFrameIntoClientArea(nWndHnd, nLeft, nRight, nTop, nBottom)
local sOSName = System.GetOSName();
local nReturn = 0; -- Returns 0 if DWM Composition is disabled, one of the function returned an error, or the wrong OS is running for this.
local sError = "";
if(sOSName=="Windows Vista")or(sOSName=="Windows 7")then
Memory.OpenLibrary(1, "dwmapi.dll")
local lpdwEnabled = Memory.Allocate(4);
if(lpdwEnabled>0)then
local F_DWM_ICE = Memory.OpenFunction(1, "DwmIsCompositionEnabled", DLL_CALL_STDCALL, DLL_RETURN_VOID);
local s_ice = Memory.CallFunction(F_DWM_ICE,lpdwEnabled);
if(Memory.GetInt(lpdwEnabled)>0)then
lptrMARGIN = Memory.CreateStructure("int,int,int,int");
if(lptrMARGIN>0)then
Memory.SetStructureData(lptrMARGIN, 1, 0, nLeft, "");
Memory.SetStructureData(lptrMARGIN, 2, 0, nRight, "");
Memory.SetStructureData(lptrMARGIN, 3, 0, nTop, "");
Memory.SetStructureData(lptrMARGIN, 4, 0, nBottom, "");
local F_DWM_EFICA = Memory.OpenFunction(1, "DwmExtendFrameIntoClientArea", DLL_CALL_STDCALL, DLL_RETURN_VOID);
if(Memory.CallFunction(F_DWM_EFICA, nWndHnd, lptrMARGIN)==0)then -- Returns S_OK (0)
nReturn = 1;
sError = "OK";
else
sError = "DwmExtendFrameIntoClientAre returned an error code!";
end
Memory.Free(lptrMARGIN); -- Free it, DWM copies the data.
else
sError = "Could not allocate MARGIN structure!";
end
else
sError = "Dwm Composition is not enabled!";
end
Memory.Free(lpdwEnabled); -- Free those 4 bytes too ofcourse.
else
sError = "Could not allocate memory for lpdwEnabled";
end
Memory.CloseLibrary(1);
end
return nReturn,sError;
end
--***********************************************************************************---
function SHBrowseForFolder(strTitle)
assert( type( strTitle ) == "string", "SHERR: Title not a string: "..type(strTitle));
lpszTitle = Memory.Allocate(String.Length(strTitle)+1);
pbuff = Memory.Allocate(1024);
Memory.PutString(lpszTitle, strTitle,-1,"Ascii");
LPBROWSEINFO = Memory.CreateStructure("long, long, long, long, long, long, long, long");
--[[
typedef struct _browseinfo {
HWND hwndOwner;
PCIDLIST_ABSOLUTE pidlRoot;
LPTSTR pszDisplayName;
LPCTSTR lpszTitle;
UINT ulFlags;
BFFCALLBACK lpfn;
LPARAM lParam;
int iImage;
]]--
--handle
hwndOwner=Application.GetWndHandle();
--Flags
--BIF_STATUSTEXT=4
BIF_RETURNONLYFSDIRS=1
--BIF_EDITBOX=16
--BIF_NEWDIALOGSTYLE=64
BIF_DONTGOBELOWDOMAIN=2
BIF_BROWSEFORCOMPUTER=4096
--set flags
ulFlags=BIF_RETURNONLYFSDIRS+BIF_BROWSEFORCOMPUTER+BIF_DONTGOBELOWDOMAIN;
Memory.SetStructureData(LPBROWSEINFO, 1, 0, hwndOwner, "");
Memory.SetStructureData(LPBROWSEINFO, 4, 0, lpszTitle, "");
Memory.SetStructureData(LPBROWSEINFO, 5, 0, ulFlags, "");
pidl = DLL.CallFunction(_SystemFolder .. "\\shell32.dll", "SHBrowseForFolder", LPBROWSEINFO, DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL)
DLL.CallFunction(_SystemFolder .. "\\shell32.dll", "SHGetPathFromIDList", pidl .. "," .. pbuff, DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL)
nResult = Memory.GetString(pbuff, -1, "Ascii");
if nResult == "" then
nResult = "CANCEL"
end
--clean
Memory.FreeStructure(LPBROWSEINFO)
Memory.Free(pbuff)
Memory.Free(lpszTitle)
return nResult;
end
--Test
folder = SHBrowseForFolder("Put your text here :)")
ExtendFrameIntoClientArea(Application.GetWndHandle(), 0, 0, 0, -1);