2) Как и где объявить переменные и константы, примеры пожалуйста в студию ?
непонятный вопрос. Вероятно вы про: w_W, w_H, то они создаются и назначаются в команде WinGetPos.
В Delphi есть функция GetClientRect - Считывает кооpдинаты пользователя окна.
GetClientRect(WinExist("A"), rX, rY, rWidth, rHeight)
MsgBox % "rX = " rX
. "`nrY = " rY
. "`nrWidth = " rWidth
. "`nrHeight = " rHeight
GetClientRect(hwnd, ByRef rX, ByRef rY, ByRef rWidth, ByRef rHeight) {
WinGetPos, , , , Window_Height, ahk_id %hwnd%
VarSetCapacity(rcClient, 16, 0)
DllCall("user32\GetClientRect","uint", hwnd ,"uint",&rcClient)
rcClient_b := NumGet(rcClient, 12)
VarSetCapacity(pwi, 68, 0)
DllCall("GetWindowInfo", "UInt", hwnd, "UInt", &pwi)
rX := NumGet(pwi, 48) , by := NumGet(pwi, 52)
rY := Window_Height - by - rcClient_b
rWidth := NumGet(rcClient, 8)
rHeight := NumGet(rcClient, 12)
}
Только размеры:
GetClientSize(WinExist("A"), rcRealWidth, rcRealHeight)
MsgBox % "rWidth = " rcRealWidth
. "`nrHeight = " rcRealHeight
GetClientSize(hwnd, ByRef RealWidth, ByRef RealHeight) {
VarSetCapacity(rcClient, 16, 0)
DllCall("user32\GetClientRect","uint", hwnd ,"uint",&rcClient)
RealWidth := NumGet(rcClient, 8)
RealHeight := NumGet(rcClient, 12)
}
это не понял.
По вопросам возмездной помощи пишите на
E-Mail: serzh82saratov@mail.ru Telegram:
https://t.me/sergiol982Win10x64
AhkSpy,
Hotkey,
ClockGui