MsgBox: big windows Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
User avatar
jeeswg
Posts: 5166
Joined: 19 Dec 2016, 01:58
Location: UK

MsgBox: big windows  Topic is solved

21 Nov 2017, 19:04

- I have a script that takes printscreens, and it took a printscreen of the active window, a MsgBox, and there were a lot of black pixels at the bottom.
- It turns out that when you create a MsgBox with a lot of text, it creates a very large window.
- I might either make a mod of the MsgBox function to prevent this and/or edit my printscreens script to ignore pixels beyond a certain width/height.

Code: Select all

q:: ;MsgBox: get dimensions
vOutput := ""
VarSetCapacity(vOutput, 1000000*2)
Loop, 1000
	vOutput .= "a`r`n"
SetTimer, MsgBoxGetPos, -1
MsgBox, % vOutput
return

MsgBoxGetPos:
WinGetPos, vWinX, vWinY, vWinW, vWinH, A
SendMessage, 0xE, 0, 0, Static1, A ;WM_GETTEXTLENGTH := 0xE
vLen := ErrorLevel
MsgBox, % Format("x{} y{} w{} h{}", vWinX, vWinY, vWinW, vWinH) "`r`n" "text length: " vLen
return

;note: I use a large font
;e.g. 100 lines: x504 y0 w279 h3012
;e.g. 1000 lines: x504 y0 w279 h28209 ;taller MsgBox than for 10000 lines?
;e.g. 10000 lines: x504 y0 w279 h11142

Return to “Ask For Help”

Who is online

Users browsing this forum: codude, Google [Bot], MannyKSoSo, masok, Quadzilla and 29 guests