program finder;
{$macro on}
{$define _WIN32_WINNT := $0500}
uses windows,crt,sysutils;
const
DC_BRUSH=18;
const
DC_PEN=19;
type
colour =packed record
case integer of
0:(r,g,b:byte);
1:(c:longword);
end;
function Printf(mask : pchar):integer; cdecl; varargs; external 'msvcrt.dll' name 'printf';
function system(s:pchar):integer ; cdecl external 'msvcrt.dll' name 'system';
function SetDCBrushColor(p:hdc;colour:COLORREF): COLORREF; stdcall external 'gdi32.dll' name 'SetDCBrushColor';
function SetDCPenColor(p:hdc;colour:COLORREF): COLORREF; stdcall external 'gdi32.dll' name 'SetDCPenColor';
Function SetProcessDPIAware():boolean ;stdcall external 'User32.dll' name 'SetProcessDPIAware';
procedure hidecursor();
var
consoleHandle:handle;
info:CONSOLE_CURSOR_INFO ;
begin
consolehandle := GetStdHandle(STD_OUTPUT_HANDLE);
info.dwSize := 100;
info.bVisible := FALSE ;
SetConsoleCursorInfo(consoleHandle, @info);
End;
Var
p:hwnd;
h,wh:hdc;
pt:point;
clr:colour;
r:integer=50;
s:pchar;
begin
p := GetConsoleWindow();
setwindowpos(p, HWND_TOPMOST, 100, 100, 230, 280, SWP_SHOWWINDOW);
system('title [MOVE]');
SetWindowLong(p,GWL_STYLE, GetWindowLong(p, GWL_STYLE) and not(WS_MAXIMIZEBOX) and not( WS_SIZEBOX));
SetProcessDPIAware;
hidecursor();
h:=GetDC(0);
wh:=GetDC(p);
SelectObject(wh,GetStockObject(DC_BRUSH));
SelectObject(wh,GetStockObject(DC_PEN));
while p<>1 do
begin
getcursorpos(@pt);
clr.c:=getpixel(h,pt.x,pt.y);
ShowScrollBar(p, SB_BOTH, FALSE);
SetDCBrushColor(wh,clr.c);
SetDCPenColor(wh,clr.c);
ellipse(wh,trunc(105-r),trunc(70-r),trunc(105+r),trunc(70+r));
gotoxy(3,10);
printf('Red %s',' ');
gotoxy(3,10);
printf('Red %d',clr.r);
gotoxy(3,11);
printf('Green %s',' ');
gotoxy(3,11);
printf('Green %d',clr.g);
gotoxy(3,12);
printf('Blue %s',' ');
gotoxy(3,12);
printf('Blue %d',clr.b);
gotoxy(3,13);
printf('HEX %s',' ');
gotoxy(3,13);
s:=pchar(IntToHex(clr.c,8));
printf('HEX %s',' $');
printf('%s',s);
gotoxy(3,14);
printf('RAW %s',' ');
gotoxy(3,14);
printf('RAW %d',clr.c);
gotoxy(3,15);
printf('X,Y %s',' ');
gotoxy(3,15);
printf('X,Y %d ,%s %d',pt.x,'',pt.y);
sleep(20);
end;
readln;
end.