{
INPUT_RECORD er;
+ DPRINT1("Menu item ID: %d\n", CmdId);
+
+ if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) return;
+
er.EventType = MENU_EVENT;
er.Event.MenuEvent.dwCommandId = CmdId;
-
- DPRINT("Menu item ID: %d\n", CmdId);
ConioProcessInputEvent(Console, &er);
+
+ LeaveCriticalSection(&Console->Lock);
}
static VOID
static VOID
Mark(PGUI_CONSOLE_DATA GuiData)
{
- PCONSOLE Console = GuiData->Console;
PCONSOLE_SCREEN_BUFFER ActiveBuffer = GuiData->ActiveBuffer;
/* Clear the old selection */
// UpdateSelection(GuiData, NULL);
- Console->Selection.dwFlags = CONSOLE_NO_SELECTION;
+ GuiData->Selection.dwFlags = CONSOLE_NO_SELECTION;
/* Restart a new selection */
- Console->dwSelectionCursor.X = ActiveBuffer->ViewOrigin.X;
- Console->dwSelectionCursor.Y = ActiveBuffer->ViewOrigin.Y;
- Console->Selection.dwSelectionAnchor = Console->dwSelectionCursor;
- UpdateSelection(GuiData, &Console->Selection.dwSelectionAnchor);
+ GuiData->dwSelectionCursor.X = ActiveBuffer->ViewOrigin.X;
+ GuiData->dwSelectionCursor.Y = ActiveBuffer->ViewOrigin.Y;
+ GuiData->Selection.dwSelectionAnchor = GuiData->dwSelectionCursor;
+ UpdateSelection(GuiData, &GuiData->Selection.dwSelectionAnchor);
}
static VOID
SelectAll(PGUI_CONSOLE_DATA GuiData)
{
- PCONSOLE Console = GuiData->Console;
PCONSOLE_SCREEN_BUFFER ActiveBuffer = GuiData->ActiveBuffer;
/* Clear the old selection */
// UpdateSelection(GuiData, NULL);
- Console->Selection.dwFlags = CONSOLE_NO_SELECTION;
+ GuiData->Selection.dwFlags = CONSOLE_NO_SELECTION;
/*
* The selection area extends to the whole screen buffer's width.
*/
- Console->Selection.dwSelectionAnchor.X = 0;
- Console->Selection.dwSelectionAnchor.Y = 0;
- Console->dwSelectionCursor.X = ActiveBuffer->ScreenBufferSize.X - 1;
+ GuiData->Selection.dwSelectionAnchor.X = 0;
+ GuiData->Selection.dwSelectionAnchor.Y = 0;
+ GuiData->dwSelectionCursor.X = ActiveBuffer->ScreenBufferSize.X - 1;
/*
* Determine whether the selection must extend to just some part
* We select all the characters from the first line
* to the line where the cursor is positioned.
*/
- Console->dwSelectionCursor.Y = ActiveBuffer->CursorPosition.Y;
+ GuiData->dwSelectionCursor.Y = ActiveBuffer->CursorPosition.Y;
}
else /* if (GetType(ActiveBuffer) == GRAPHICS_BUFFER) */
{
/*
* We select all the screen buffer area.
*/
- Console->dwSelectionCursor.Y = ActiveBuffer->ScreenBufferSize.Y - 1;
+ GuiData->dwSelectionCursor.Y = ActiveBuffer->ScreenBufferSize.Y - 1;
}
/* Restart a new selection */
- Console->Selection.dwFlags |= CONSOLE_MOUSE_SELECTION;
- UpdateSelection(GuiData, &Console->dwSelectionCursor);
+ GuiData->Selection.dwFlags |= CONSOLE_MOUSE_SELECTION;
+ UpdateSelection(GuiData, &GuiData->dwSelectionCursor);
}
static LRESULT
LRESULT Ret = TRUE;
PCONSOLE Console = GuiData->Console;
- if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE))
- {
- Ret = FALSE;
- goto Quit;
- }
-
/*
* In case the selected menu item belongs to the user-reserved menu id range,
* send to him a menu event and return directly. The user must handle those
if (GuiData->CmdIdLow <= (UINT)wParam && (UINT)wParam <= GuiData->CmdIdHigh)
{
SendMenuEvent(Console, (UINT)wParam);
- goto Unlock_Quit;
+ goto Quit;
}
/* ... otherwise, perform actions. */
break;
}
-Unlock_Quit:
- LeaveCriticalSection(&Console->Lock);
Quit:
if (!Ret)
Ret = DefWindowProcW(GuiData->hWindow, WM_SYSCOMMAND, wParam, lParam);
er.Event.FocusEvent.bSetFocus = SetFocus;
ConioProcessInputEvent(Console, &er);
+ LeaveCriticalSection(&Console->Lock);
+
if (SetFocus)
DPRINT1("TODO: Create console caret\n");
else
DPRINT1("TODO: Destroy console caret\n");
-
- LeaveCriticalSection(&Console->Lock);
}
static VOID
PCONSOLE Console = GuiData->Console;
RECT oldRect;
- SmallRectToRect(GuiData, &oldRect, &Console->Selection.srSelection);
+ SmallRectToRect(GuiData, &oldRect, &GuiData->Selection.srSelection);
if (coord != NULL)
{
SMALL_RECT rc;
/* Exchange left/top with right/bottom if required */
- rc.Left = min(Console->Selection.dwSelectionAnchor.X, coord->X);
- rc.Top = min(Console->Selection.dwSelectionAnchor.Y, coord->Y);
- rc.Right = max(Console->Selection.dwSelectionAnchor.X, coord->X);
- rc.Bottom = max(Console->Selection.dwSelectionAnchor.Y, coord->Y);
+ rc.Left = min(GuiData->Selection.dwSelectionAnchor.X, coord->X);
+ rc.Top = min(GuiData->Selection.dwSelectionAnchor.Y, coord->Y);
+ rc.Right = max(GuiData->Selection.dwSelectionAnchor.X, coord->X);
+ rc.Bottom = max(GuiData->Selection.dwSelectionAnchor.Y, coord->Y);
SmallRectToRect(GuiData, &newRect, &rc);
- if (Console->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY)
+ if (GuiData->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY)
{
- if (memcmp(&rc, &Console->Selection.srSelection, sizeof(SMALL_RECT)) != 0)
+ if (memcmp(&rc, &GuiData->Selection.srSelection, sizeof(SMALL_RECT)) != 0)
{
HRGN rgn1, rgn2;
InvalidateRect(GuiData->hWindow, &newRect, FALSE);
}
- Console->Selection.dwFlags |= CONSOLE_SELECTION_NOT_EMPTY;
- Console->Selection.srSelection = rc;
- Console->dwSelectionCursor = *coord;
+ GuiData->Selection.dwFlags |= CONSOLE_SELECTION_NOT_EMPTY;
+ GuiData->Selection.srSelection = rc;
+ GuiData->dwSelectionCursor = *coord;
- if ((Console->Selection.dwFlags & CONSOLE_SELECTION_IN_PROGRESS) == 0)
+ if ((GuiData->Selection.dwFlags & CONSOLE_SELECTION_IN_PROGRESS) == 0)
{
LPWSTR SelectionType, WindowTitle = NULL;
SIZE_T Length = 0;
/* Clear the old selection */
- if (Console->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY)
+ if (GuiData->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY)
{
InvalidateRect(GuiData->hWindow, &oldRect, FALSE);
}
- if (Console->Selection.dwFlags & CONSOLE_MOUSE_SELECTION)
+ if (GuiData->Selection.dwFlags & CONSOLE_MOUSE_SELECTION)
{
SelectionType = L"Selection - ";
}
SetWindowText(GuiData->hWindow, WindowTitle);
ConsoleFreeHeap(WindowTitle);
- Console->Selection.dwFlags |= CONSOLE_SELECTION_IN_PROGRESS;
+ GuiData->Selection.dwFlags |= CONSOLE_SELECTION_IN_PROGRESS;
ConioPause(Console, PAUSED_FROM_SELECTION);
}
}
else
{
/* Clear the selection */
- if (Console->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY)
+ if (GuiData->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY)
{
InvalidateRect(GuiData->hWindow, &oldRect, FALSE);
}
- Console->Selection.dwFlags = CONSOLE_NO_SELECTION;
+ GuiData->Selection.dwFlags = CONSOLE_NO_SELECTION;
ConioUnpause(Console, PAUSED_FROM_SELECTION);
SetWindowText(GuiData->hWindow, Console->Title.Buffer);
static VOID
OnPaint(PGUI_CONSOLE_DATA GuiData)
{
- BOOL Success = TRUE;
- PCONSOLE Console = GuiData->Console;
PCONSOLE_SCREEN_BUFFER ActiveBuffer;
PAINTSTRUCT ps;
RECT rcPaint;
- if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE))
- {
- Success = FALSE;
- goto Quit;
- }
ActiveBuffer = GuiData->ActiveBuffer;
BeginPaint(GuiData->hWindow, &ps);
rcPaint.top,
SRCCOPY);
- if (Console->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY)
+ if (GuiData->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY)
{
- SmallRectToRect(GuiData, &rcPaint, &Console->Selection.srSelection);
+ SmallRectToRect(GuiData, &rcPaint, &GuiData->Selection.srSelection);
/* Invert the selection */
if (IntersectRect(&rcPaint, &ps.rcPaint, &rcPaint))
}
EndPaint(GuiData->hWindow, &ps);
-Quit:
- if (Success)
- LeaveCriticalSection(&Console->Lock);
- else
- DefWindowProcW(GuiData->hWindow, WM_PAINT, 0, 0);
-
return;
}
ActiveBuffer = GuiData->ActiveBuffer;
- if (Console->Selection.dwFlags & CONSOLE_SELECTION_IN_PROGRESS)
+ if (GuiData->Selection.dwFlags & CONSOLE_SELECTION_IN_PROGRESS)
{
WORD VirtualKeyCode = LOWORD(wParam);
goto Quit;
}
- if ((Console->Selection.dwFlags & CONSOLE_MOUSE_SELECTION) == 0)
+ if ((GuiData->Selection.dwFlags & CONSOLE_MOUSE_SELECTION) == 0)
{
/* Keyboard selection mode */
BOOL Interpreted = FALSE;
case VK_LEFT:
{
Interpreted = TRUE;
- if (Console->dwSelectionCursor.X > 0)
- Console->dwSelectionCursor.X--;
+ if (GuiData->dwSelectionCursor.X > 0)
+ GuiData->dwSelectionCursor.X--;
break;
}
case VK_RIGHT:
{
Interpreted = TRUE;
- if (Console->dwSelectionCursor.X < ActiveBuffer->ScreenBufferSize.X - 1)
- Console->dwSelectionCursor.X++;
+ if (GuiData->dwSelectionCursor.X < ActiveBuffer->ScreenBufferSize.X - 1)
+ GuiData->dwSelectionCursor.X++;
break;
}
case VK_UP:
{
Interpreted = TRUE;
- if (Console->dwSelectionCursor.Y > 0)
- Console->dwSelectionCursor.Y--;
+ if (GuiData->dwSelectionCursor.Y > 0)
+ GuiData->dwSelectionCursor.Y--;
break;
}
case VK_DOWN:
{
Interpreted = TRUE;
- if (Console->dwSelectionCursor.Y < ActiveBuffer->ScreenBufferSize.Y - 1)
- Console->dwSelectionCursor.Y++;
+ if (GuiData->dwSelectionCursor.Y < ActiveBuffer->ScreenBufferSize.Y - 1)
+ GuiData->dwSelectionCursor.Y++;
break;
}
case VK_HOME:
{
Interpreted = TRUE;
- Console->dwSelectionCursor.X = 0;
- Console->dwSelectionCursor.Y = 0;
+ GuiData->dwSelectionCursor.X = 0;
+ GuiData->dwSelectionCursor.Y = 0;
break;
}
case VK_END:
{
Interpreted = TRUE;
- Console->dwSelectionCursor.Y = ActiveBuffer->ScreenBufferSize.Y - 1;
+ GuiData->dwSelectionCursor.Y = ActiveBuffer->ScreenBufferSize.Y - 1;
break;
}
case VK_PRIOR:
{
Interpreted = TRUE;
- Console->dwSelectionCursor.Y -= ActiveBuffer->ViewSize.Y;
- if (Console->dwSelectionCursor.Y < 0)
- Console->dwSelectionCursor.Y = 0;
+ GuiData->dwSelectionCursor.Y -= ActiveBuffer->ViewSize.Y;
+ if (GuiData->dwSelectionCursor.Y < 0)
+ GuiData->dwSelectionCursor.Y = 0;
break;
}
case VK_NEXT:
{
Interpreted = TRUE;
- Console->dwSelectionCursor.Y += ActiveBuffer->ViewSize.Y;
- if (Console->dwSelectionCursor.Y >= ActiveBuffer->ScreenBufferSize.Y)
- Console->dwSelectionCursor.Y = ActiveBuffer->ScreenBufferSize.Y - 1;
+ GuiData->dwSelectionCursor.Y += ActiveBuffer->ViewSize.Y;
+ if (GuiData->dwSelectionCursor.Y >= ActiveBuffer->ScreenBufferSize.Y)
+ GuiData->dwSelectionCursor.Y = ActiveBuffer->ScreenBufferSize.Y - 1;
break;
}
if (Interpreted)
{
if (!MajPressed)
- Console->Selection.dwSelectionAnchor = Console->dwSelectionCursor;
+ GuiData->Selection.dwSelectionAnchor = GuiData->dwSelectionCursor;
- UpdateSelection(GuiData, &Console->dwSelectionCursor);
+ UpdateSelection(GuiData, &GuiData->dwSelectionCursor);
}
else if (!IsSystemKey(VirtualKeyCode))
{
}
}
- if ((Console->Selection.dwFlags & CONSOLE_SELECTION_IN_PROGRESS) == 0)
+ if ((GuiData->Selection.dwFlags & CONSOLE_SELECTION_IN_PROGRESS) == 0)
{
MSG Message;
goto Quit;
}
- if ( (Console->Selection.dwFlags & CONSOLE_SELECTION_IN_PROGRESS) ||
+ if ( (GuiData->Selection.dwFlags & CONSOLE_SELECTION_IN_PROGRESS) ||
(Console->QuickEdit) )
{
switch (msg)
{
/* Clear the old selection */
// UpdateSelection(GuiData, NULL);
- Console->Selection.dwFlags = CONSOLE_NO_SELECTION;
+ GuiData->Selection.dwFlags = CONSOLE_NO_SELECTION;
/* Restart a new selection */
- Console->Selection.dwSelectionAnchor = PointToCoord(GuiData, lParam);
+ GuiData->Selection.dwSelectionAnchor = PointToCoord(GuiData, lParam);
SetCapture(GuiData->hWindow);
- Console->Selection.dwFlags |= CONSOLE_MOUSE_SELECTION | CONSOLE_MOUSE_DOWN;
- UpdateSelection(GuiData, &Console->Selection.dwSelectionAnchor);
+ GuiData->Selection.dwFlags |= CONSOLE_MOUSE_SELECTION | CONSOLE_MOUSE_DOWN;
+ UpdateSelection(GuiData, &GuiData->Selection.dwSelectionAnchor);
break;
}
{
// COORD c;
- if (!(Console->Selection.dwFlags & CONSOLE_MOUSE_DOWN)) break;
+ if (!(GuiData->Selection.dwFlags & CONSOLE_MOUSE_DOWN)) break;
// c = PointToCoord(GuiData, lParam);
- Console->Selection.dwFlags &= ~CONSOLE_MOUSE_DOWN;
+ GuiData->Selection.dwFlags &= ~CONSOLE_MOUSE_DOWN;
// UpdateSelection(GuiData, &c);
ReleaseCapture();
* Update the selection started with the single
* left-click that preceded this double-click.
*/
- Console->Selection.dwSelectionAnchor = cL;
- Console->dwSelectionCursor = cR;
+ GuiData->Selection.dwSelectionAnchor = cL;
+ GuiData->dwSelectionCursor = cR;
- Console->Selection.dwFlags |= CONSOLE_MOUSE_SELECTION | CONSOLE_MOUSE_DOWN;
- UpdateSelection(GuiData, &Console->dwSelectionCursor);
+ GuiData->Selection.dwFlags |= CONSOLE_MOUSE_SELECTION | CONSOLE_MOUSE_DOWN;
+ UpdateSelection(GuiData, &GuiData->dwSelectionCursor);
/* Ignore the next mouse move signal */
GuiData->IgnoreNextMouseSignal = TRUE;
case WM_RBUTTONDOWN:
case WM_RBUTTONDBLCLK:
{
- if (!(Console->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY))
+ if (!(GuiData->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY))
{
Paste(GuiData);
}
COORD c;
if (!(wParam & MK_LBUTTON)) break;
- if (!(Console->Selection.dwFlags & CONSOLE_MOUSE_DOWN)) break;
+ if (!(GuiData->Selection.dwFlags & CONSOLE_MOUSE_DOWN)) break;
c = PointToCoord(GuiData, lParam); /* TODO: Scroll buffer to bring c into view */
UpdateSelection(GuiData, &c);
static VOID
OnMove(PGUI_CONSOLE_DATA GuiData)
{
- PCONSOLE Console = GuiData->Console;
RECT rcWnd;
- if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) return;
-
// TODO: Simplify the code.
// See: GuiConsoleNotifyWndProc() PM_CREATE_CONSOLE.
GetWindowRect(GuiData->hWindow, &rcWnd);
GuiData->GuiInfo.WindowOrigin.x = rcWnd.left;
GuiData->GuiInfo.WindowOrigin.y = rcWnd.top;
-
- LeaveCriticalSection(&Console->Lock);
}
/*
/* Enable or disable the Copy and Paste items */
EnableMenuItem(hMenu, ID_SYSTEM_EDIT_COPY , MF_BYCOMMAND |
- ((Console->Selection.dwFlags & CONSOLE_SELECTION_IN_PROGRESS) &&
- (Console->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY) ? MF_ENABLED : MF_GRAYED));
+ ((GuiData->Selection.dwFlags & CONSOLE_SELECTION_IN_PROGRESS) &&
+ (GuiData->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY) ? MF_ENABLED : MF_GRAYED));
// FIXME: Following whether the active screen buffer is text-mode
// or graphics-mode, search for CF_UNICODETEXT or CF_BITMAP formats.
EnableMenuItem(hMenu, ID_SYSTEM_EDIT_PASTE, MF_BYCOMMAND |
- (!(Console->Selection.dwFlags & CONSOLE_SELECTION_IN_PROGRESS) &&
+ (!(GuiData->Selection.dwFlags & CONSOLE_SELECTION_IN_PROGRESS) &&
IsClipboardFormatAvailable(CF_UNICODETEXT) ? MF_ENABLED : MF_GRAYED));
}
- if (ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE))
- {
- SendMenuEvent(Console, WM_INITMENU);
- LeaveCriticalSection(&Console->Lock);
- }
+ SendMenuEvent(Console, WM_INITMENU);
break;
}
{
if (HIWORD(wParam) == 0xFFFF) // Allow all the menu flags
{
- if (ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE))
- {
- SendMenuEvent(Console, WM_MENUSELECT);
- LeaveCriticalSection(&Console->Lock);
- }
+ SendMenuEvent(Console, WM_MENUSELECT);
}
break;
}
case PM_APPLY_CONSOLE_INFO:
{
- if (ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE))
- {
- GuiApplyUserSettings(GuiData, (HANDLE)wParam, (BOOL)lParam);
- LeaveCriticalSection(&Console->Lock);
- }
+ GuiApplyUserSettings(GuiData, (HANDLE)wParam, (BOOL)lParam);
break;
}
/* FUNCTIONS ******************************************************************/
-COLORREF RGBFromAttrib2(PCONSOLE Console, WORD Attribute)
+COLORREF PaletteRGBFromAttrib(PCONSOLE Console, WORD Attribute)
{
HPALETTE hPalette = Console->ActiveBuffer->PaletteHandle;
PALETTEENTRY pe;
* This function supposes that the system clipboard was opened.
*/
- PCONSOLE Console = Buffer->Header.Console;
-
/*
* Pressing the Shift key while copying text, allows us to copy
* text without newline characters (inline-text copy mode).
ULONG selWidth, selHeight;
ULONG xPos, yPos, size;
- selWidth = Console->Selection.srSelection.Right - Console->Selection.srSelection.Left + 1;
- selHeight = Console->Selection.srSelection.Bottom - Console->Selection.srSelection.Top + 1;
+ selWidth = GuiData->Selection.srSelection.Right - GuiData->Selection.srSelection.Left + 1;
+ selHeight = GuiData->Selection.srSelection.Bottom - GuiData->Selection.srSelection.Top + 1;
DPRINT("Selection is (%d|%d) to (%d|%d)\n",
- Console->Selection.srSelection.Left,
- Console->Selection.srSelection.Top,
- Console->Selection.srSelection.Right,
- Console->Selection.srSelection.Bottom);
+ GuiData->Selection.srSelection.Left,
+ GuiData->Selection.srSelection.Top,
+ GuiData->Selection.srSelection.Right,
+ GuiData->Selection.srSelection.Bottom);
#ifdef IS_WHITESPACE
#undef IS_WHITESPACE
ULONG length = selWidth;
ptr = ConioCoordToPointer(Buffer,
- Console->Selection.srSelection.Left,
- Console->Selection.srSelection.Top + yPos);
+ GuiData->Selection.srSelection.Left,
+ GuiData->Selection.srSelection.Top + yPos);
/* Trim whitespace from the right */
while (length > 0)
if (Buffer->Buffer == NULL) return;
+ if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) return;
+
rcFramebuffer->left = Buffer->ViewOrigin.X * GuiData->CharWidth + rcView->left;
rcFramebuffer->top = Buffer->ViewOrigin.Y * GuiData->CharHeight + rcView->top;
rcFramebuffer->right = Buffer->ViewOrigin.X * GuiData->CharWidth + rcView->right;
LastAttribute = ConioCoordToPointer(Buffer, LeftChar, TopLine)->Attributes;
- SetTextColor(GuiData->hMemDC, RGBFromAttrib2(Console, TextAttribFromAttrib(LastAttribute)));
- SetBkColor(GuiData->hMemDC, RGBFromAttrib2(Console, BkgdAttribFromAttrib(LastAttribute)));
+ SetTextColor(GuiData->hMemDC, PaletteRGBFromAttrib(Console, TextAttribFromAttrib(LastAttribute)));
+ SetBkColor(GuiData->hMemDC, PaletteRGBFromAttrib(Console, BkgdAttribFromAttrib(LastAttribute)));
OldFont = SelectObject(GuiData->hMemDC, GuiData->Font);
Attribute = From->Attributes;
if (Attribute != LastAttribute)
{
- SetTextColor(GuiData->hMemDC, RGBFromAttrib2(Console, TextAttribFromAttrib(Attribute)));
- SetBkColor(GuiData->hMemDC, RGBFromAttrib2(Console, BkgdAttribFromAttrib(Attribute)));
+ SetTextColor(GuiData->hMemDC, PaletteRGBFromAttrib(Console, TextAttribFromAttrib(Attribute)));
+ SetBkColor(GuiData->hMemDC, PaletteRGBFromAttrib(Console, BkgdAttribFromAttrib(Attribute)));
LastAttribute = Attribute;
}
}
Attribute = ConioCoordToPointer(Buffer, Buffer->CursorPosition.X, Buffer->CursorPosition.Y)->Attributes;
if (Attribute == DEFAULT_SCREEN_ATTRIB) Attribute = Buffer->ScreenDefaultAttrib;
- CursorBrush = CreateSolidBrush(RGBFromAttrib2(Console, TextAttribFromAttrib(Attribute)));
+ CursorBrush = CreateSolidBrush(PaletteRGBFromAttrib(Console, TextAttribFromAttrib(Attribute)));
OldBrush = SelectObject(GuiData->hMemDC, CursorBrush);
PatBlt(GuiData->hMemDC,
}
SelectObject(GuiData->hMemDC, OldFont);
+
+ LeaveCriticalSection(&Console->Lock);
}
/* EOF */