Code: Select all
CheckErrorLevel:
{
WinWaitActive, , , 0.5
If ErrorLevel
Return
else
Return
}
Code: Select all
CheckErrorLevel:
{
WinWaitActive, , , 0.5
If ErrorLevel
Return
else
Return
}
Code: Select all
^!d::
{
Run C:\Documents\
WinWaitActive, F,,1
Gosub, CheckErrorLevel
Gosub, Center
Return
}
Center:
{
WinGetPos, , , WinW, WinH, A
WinMove, A, , A_ScreenWidth/2-WinW/2, A_ScreenHeight/2-WinH/2-60
Return
}
CheckErrorLevel:
{
MsgBox, ErrorLevel = '%ErrorLevel%'
If ErrorLevel
MsgBox, Text
Return
}
Yesterday it wasn't, today the code works for me too, textbox and all, no idea what happened; it just loses focus the first time it happens, so it doesn't center it.DyaTactic wrote:It does show the textbox on my pc. Is the window centered anyway?
Code: Select all
^!d::
{
Run C:\Documents\
WinWaitActive, Documents,,1
Gosub, CheckErrorLevel
Gosub, Center
Return
}
Center:
{
WinGetPos, , , WinW, WinH, A
WinMove, A, , A_ScreenWidth/2-WinW/2, A_ScreenHeight/2-WinH/2-60
Return
}
CheckErrorLevel:
{
Return
}
Code: Select all
Run ...
WinWait, Documents, , 2
If !ErrorLevel
WinActivate, Documents
Code: Select all
^!d::
{
Run C:\Documents\
WinWaitActive, D,,0.5
Gosub, CheckErrorLevel
Gosub, Center
Return
}
Center:
{
WinGetPos, , , WinW, WinH, A
WinMove, A, , A_ScreenWidth/2-WinW/2, A_ScreenHeight/2-WinH/2-60
Return
}
CheckErrorLevel:
{
if ErrorLevel
MsgBox, The window does not exist.
else
MsgBox, The window exists.
Return
}
Code: Select all
CheckErrorLevel:
{ ; This block is not necessary.
if ErrorLevel
{
MsgBox, The window does not exist.
Exit
} Else
MsgBox, The window exists.
Return
}
Users browsing this forum: Bing [Bot], Draken, Google [Bot], oktavimark and 311 guests