int EList::ExecCommand(int Command, ExState &State) { int W = 1; int H = 1; if (View && View->MView && View->MView->Win) { View->MView->ConQuerySize(&W, &H); H--; } FixPos(); switch (Command) { case ExMoveLeft: return MoveLeft(); case ExMoveRight: return MoveRight(); case ExMoveUp: return MoveUp(); case ExMoveDown: return MoveDown(); case ExMovePageUp: return MovePageUp(); case ExMovePageDown: return MovePageDown(); case ExScrollLeft: return ScrollLeft(8); case ExScrollRight: return ScrollRight(8); case ExMovePageStart: return MovePageStart(); case ExMovePageEnd: return MovePageEnd(); case ExMoveFileStart: return MoveFileStart(); case ExMoveFileEnd: return MoveFileEnd(); case ExMoveLineStart: return MoveLineStart(); case ExMoveLineEnd: return MoveLineEnd(); case ExRescan: RescanList(); return ErOK; case ExActivate: return Activate(); case ExListMark: return Mark(); case ExListUnmark: return Unmark(); case ExListToggleMark: return ToggleMark(); case ExListMarkAll: return MarkAll(); case ExListUnmarkAll: return UnmarkAll(); case ExListToggleMarkAll: return ToggleMarkAll(); } return EModel::ExecCommand(Command, State); }
BOOL FixPosition(HWND hWnd, wchar_t *className, int flags, int *Y, int *cy) { // as we have full control over position and height, // we try to detect correct position and size BOOL result = FALSE; __try { if (settingPositionFixEnabled == TRUE) { if (IsWindow(hWnd) == TRUE && (GetParent(hWnd) == NULL || ((GetWindowLong(hWnd, GWL_STYLE) & WS_CHILD) == NULL))) { if (ShouldBeProcessed(className)) { int displayHeight = GetSystemMetrics(SM_CYSCREEN); // some applications aren't high-res aware // example: pocketmusic installer. BOOL halfSize = isHalfSize(displayHeight); if (halfSize == TRUE) { displayHeight = displayHeight << 1; *Y = *Y << 1; *cy = *cy << 1; } int oldY = *Y, oldHeight = *cy; if (wcscmp(className, L"SipWndClass") == 0) { // special position fix optimized for SIP if (CheckLowestPosition(*Y + *cy, displayHeight) == TRUE) { int currentPosition = *Y + *cy; int neededPosition = displayHeight - sizeSoftkeyBar; int difference = currentPosition - neededPosition; *Y = *Y - difference; result = TRUE; } } else { // fixing position if needed if ((flags & SWP_NOMOVE) == NULL) { if (FixPos(Y) == TRUE) result = TRUE; } // fixing size if needed if ((flags & SWP_NOSIZE) == NULL) { if (FixSize(cy, displayHeight) == TRUE) result = TRUE; } } if (halfSize == TRUE) { *Y = *Y >> 1; *cy = *cy >> 1; } } } } }