Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pToken := Gdip_Startup()
- WinGet, list, list
- nlist := {}
- loop % list
- {
- WinGet, style, style, % "ahk_id " list%A_Index%
- Transform, result, BitAnd, %style%, 0x10000000
- if (result != 0)
- nlist.Insert(list%A_Index%)
- }
- data := {}, totalHeight := maxWidth := 0
- loop % nlist.MaxIndex()
- {
- x := {}
- x.bitmap := Gdip_BitmapFromHWND(nlist[A_Index])
- Gdip_GetImageDimensions(x.bitmap, width, height)
- x.width := width, x.height := height
- totalHeight += x.height, maxWidth := (A_Index = 1 || x.width > data[A_Index-1].width) ? x.width : maxWidth
- data.Insert(x)
- }
- pBitmap := Gdip_CreateBitmap(maxWidth, totalHeight), G := Gdip_GraphicsFromImage(pBitmap), y := 0
- loop % nlist.MaxIndex()
- {
- Gdip_DrawImage(G, data[A_Index].bitmap, 0, y, data[A_Index].width, data[A_Index].height)
- Gdip_DisposeImage(data[A_Index].bitmap)
- y += data[A_Index].height
- }
- Gdip_SaveBitmapToFile(pBitmap, "AllVisibleWindows.png")
- Gdip_DeleteGraphics(G), Gdip_DisposeImage(pBitmap)
- Gdip_Shutdown(pToken)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement