MsgBox: big windows Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
jeeswg
Posts: 6902
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
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], Rohwedder and 266 guests