This kind of Caton seems to be due to DWM.EXE, although even at peak, it occupies the CPU at about 15%, but it seems to cause a huge burden on the system.
Window, mouse and keyboard, are lost response.
Not only when creating a cardon, when the LAYERED window closes / loses focus and other events occur, it will also be the Caton system.
Is there any way to avoid this problem?
In this example, my computer, in less than a second time to create the window and show it.
Then for 30 seconds for Caton, and show the contents of the window.
If you try to close it, it will disappear after 1 minute in Caton.
Code: Select all
gui:=GuiCreate()
h:=5
idx:=2000
loop idx
text(gui.hwnd,2,A_Index*h,50,h-3)
gui.show("w155 h" 500)
return
text(hwnd,x,y,w,h){
static bit:="DWORD biSize;LONG biWidth;LONG biHeight;WORD biPlanes;WORD biBitCount;DWORD biCompression;DWORD biSizeImage;LONG biXPelsPerMeter;LONG biYPelsPerMeter;DWORD biClrUsed;DWORD biClrImportant;"
,dc:=GetDC(),pt:=Struct("x,y")
hwnd:=CreateWindowEx(0x80000, "static","",0X40000000|0x10000000,0,0,0,0,hwnd,0,0,0)
bi:=Struct(bit,{biSize:sizeof(bit),biWidth:w,biHeight:h,biPlanes:1,biBitCount:32})
hbm := CreateDIBSection(dc,bi[]),ReleaseDC(0,hdc)
hdc := CreateCompatibleDC(),obm := SelectObject(hdc, hbm)
GdipCreateFromHDC(hdc,getvar(G:=0))
GdipSetInterpolationMode(G,7)
GdipGraphicsClear(g,0xffdd00dd)
pt.x:=x,pt.y:=y
UpdateLayeredWindow(hwnd,0,pt[],getvar(temp1:=w|h<<32),hdc, getvar(temp2:=0),0,getvar(temp3:=255<<16|1<<24),2)
SelectObject(hdc, obm),DeleteObject(hbm),DeleteDC(hdc),GdipDeleteGraphics(G)
}