R
Rocky5
Can any one tell me what does Space(512) do?
' Get the Caption of the SQL Design window
sCaption = Space(512)
lngRet = GetWindowText(hWndOQry, sCaption, 256)
sCaption = Left(sCaption, lngRet)
If Len(sCaption & vbNullString) = 0 Then Exit Function
' Find the window of class ODsk
hwndODsk = FindWindowEx(hWndOQry, 0&, "ODsk", vbNullString)
' If does nto exist then we are not in the Query Design window
If hwndODsk = 0 Then Exit Function
' If this Window is Visible then we are not in the
' SQL View window!
lngRet = IsWindowVisible(hwndODsk)
If lngRet <> 0 Then Exit Function
' Get the Text of the SQL Design window
s = Space(4096)
lngRet = GetWindowText(hWndOKttbx, s, 2048)
s = Left(s, lngRet)
If Len(s & vbNullString) = 0 Then Exit Function
' Get the Caption of the SQL Design window
sCaption = Space(512)
lngRet = GetWindowText(hWndOQry, sCaption, 256)
sCaption = Left(sCaption, lngRet)
If Len(sCaption & vbNullString) = 0 Then Exit Function
' Find the window of class ODsk
hwndODsk = FindWindowEx(hWndOQry, 0&, "ODsk", vbNullString)
' If does nto exist then we are not in the Query Design window
If hwndODsk = 0 Then Exit Function
' If this Window is Visible then we are not in the
' SQL View window!
lngRet = IsWindowVisible(hwndODsk)
If lngRet <> 0 Then Exit Function
' Get the Text of the SQL Design window
s = Space(4096)
lngRet = GetWindowText(hWndOKttbx, s, 2048)
s = Left(s, lngRet)
If Len(s & vbNullString) = 0 Then Exit Function