[release] Curscreen Desklet

ok well i was messing around.. i was wondering if it would be possible to make

curscreen skew the images that gets displayed.. so you can use it on the angled icons as well... just an idea..

like for the settings it could prob look like this..

Onclick=shell:DriveFolder

TopLeft=x,y

TopRight=x,y

BottomLeft=x,y

BottomRight=x,y

UpdateIntervalInMs=5000

#168473

FYI, i was playing around with this Desklette and couldn't get it to do what I wanted, because I kept modifying the INI file and changes didn't occur. If you make any changes to the INI file, simply closing down AveDesk and restarting it won't apply the changes, it seems the settings for the desklette you make are stored elsewhere, delete the desklette and make a new one after the INI has been edited. Works like a breeze.

#175238

hi

1. it consumes to much cpu and updates even when nothing changed. when settings up the interval to 60000 = 1 minute it even updates every 5(+/-5) seconds.

2. under win2k the cursor hides when making the screenshot, why u hide the cursor???? one couldnt see it on that small image.

3. make a screenchange and screenshot - thread with lower priority and then pass the bitmap over to the mainthread.

4. better u use hooks or a fast polling algorythm

#177106

hi

Hi too.

1. it consumes to much cpu and updates even when nothing changed. when settings up the interval to 60000 = 1 minute it even updates every 5(+/-5) seconds.

3% CPU usage for every update isn't that bad I think. I haven't had any other reports about an error with the update interval :blink:

2. under win2k the cursor hides when making the screenshot, why u hide the cursor???? one couldnt see it on that small image.

Normal GDI functions doesn't allow me to grab the cursor. besides that, it wouldn't be visible on the screenshot. Also, GDI hides the cursos when bitblt from the desktop DC.

3. make a screenchange and screenshot - thread with lower priority and then pass the bitmap over to the mainthread.

What's the advantage of having a producer and a consumer thread in this case? A desktop-grab is made every 5 - 20 seconds depending on the user settings, so a timer would be suffient enough.

CPU usage won't drop when using more threads <_<

4. better u use hooks or a fast polling algorythm

Better I use hooks. Ahh, what do you want me to hook? WM_PAINT ? WM_DRAWITEM ? GDI isn't designed that way to allow apps in user mode to detect changes.

Should I inject my screenshot creating code into gdi.dll maybe? <_<

A fast polling algorithm? So comparing 800x800 pixels? A simple and quick redraw would be better.

#177120

I think 3%-6% cpu usage for 2 Seconds is not too good. Even when under my win2k the cursor hides for 1-2 seconds.

gdi hides cursor? Ok i made a little (Delphi) Program

var
dc: HDC;
B1: TBitmap;
begin
dc:= getDC(0);
B1:= TBitmap.create;
B1.width:= Screen.Width;
B1.height:= Screen.Height;
bitblt(B1.Canvas.Handle, 0, 0, B1.width, B1.height, dc, 0, 0, SRCCOPY);
releaseDC(0, DC);
Image1.Picture.Assign(B1);
B1.free;
end;

It does not hide, are you sure?

The advantage of threads is, when i use cpuintensive apps the lowlevel thread stops. when i set avedesk to low priority everything there stops.

Maybe its enough to hook windowcreation/destroying and moving. On the small image one cant see so much details.

Polling -> dont compare every pixel a raster of 50x50 or bigger would do it. U dont need 100% exact code there.

:-( -> dont be pissed just wanted to help.

(put your code between

-tags for easier reading, ave)

#177488

   Bitmap bm(GetSystemMetrics(SM_CXSCREEN),GetSystemMetrics(SM_CYSCREEN)); 
     Graphics g(&bm);

     HDC bmDC=g.GetHDC();

 HDC desktopDC = GetDC(0);
     BitBlt(bmDC,0,0,bm.GetWidth(),bm.GetHeight(),desktopDC,0,0,SRCCOPY | CAPTUREBLT );

     ReleaseDC(0, desktopDC);

     g.ReleaseHDC(bmDC);

You forgat the CAPTURBLT flag.

Maybe its enough to hook windowcreation/destroying and moving. On the small image one cant see so much details.

That's not enough. I have seen people running this at 400 * 400. That shows details. Also fullscreen windows that repaint themselves are not captured this way.

Polling -> It's the Bitblt from desktop together with the CAPTUREBLT flag that causes the high CPU usage.

I might implement a DirectX8 capturing:

pd3dDevice->CreateImageSurface(ScreenWidth,ScreenHeight,D3DFMT_A8R8G8B8,&pSurface);
device->GetFrontBuffer(pSurface);

D3DLOCKED_RECT lockedRect = {0};

pSurface->LockRect(&lockedRect,NULL,D3DLOCK_NO_DIRTY_UPDATE|D3DLOCK_NOSYSLOCK|D3DLOCK_READONLY)));

for( int i=0; i < ScreenHeight; i++){

   memcpy( (BYTE*) bufferBits+ i * ScreenWidth * BITSPERPIXEL / 8 , (BYTE*)  lockedRect.pBits + i* lockedRect.Pitch , ScreenWidth * BITSPERPIXEL / 8);
}

pSurface->UnlockRect();
pSurface->Release();  

#177512

Yep you are right with CAPTUREBLT it hides the cursor. Never heard of this flag before. At times, i used bitblt there werent transparent windows and no layers, thats why i didnt believe u.

Can u make an option wether the plugin uses captureblt or not?

Polling -> I meant scan the screen in a 50x50 matrix and only bitblt when changes occured.

400x400? Okay i expected the Symbol in standard width/height. And there is Polling/simple Hooking not usable.

Then i give up :-P

#177531