I can blt a bitmap to the client area of a window - how about to the desktop (ie. on the desktop itself) and also to position it where abouts I'd like e.g. in a corner of the center, etc. I tried to simply pass the desktop handle but this doesn't seem to work (maybe I'm missing something - rectangle? :)) Thanks, Tedd.
Posted on 2000-12-05 08:38:00 by Tedd
Tedd, Disp db "DISPLAY",0 invoke LoadBitmap,hInst,800 mov hBmp, eax invoke CreateDC,ADDR Disp,NULL,NULL,NULL mov DeskDC, eax invoke CreateCompatibleDC,DeskDC mov NewDC, eax invoke SelectObject,NewDC,hBmp invoke BitBlt,DeskDC,182,178,436,244,NewDC,NULL,NULL,SRCCOPY invoke Sleep,2000 that will do what your asking, the only thing is, you'll need to cover up the bitmap to make it go away. -PhantasmP :: http://hwa-security.net
Posted on 2000-12-05 11:14:00 by PhantasmP
you wanted to draw something directly on the desktop, right? ok, do it like this to draw an rectangle on it: (MASM) invoke GetDesktopWindow mov hwnddesk,eax invoke GetWindowDC,eax or invoke GetDC,eax (read in the win32.hlp what the difference is) mov hdcdesk,eax and then invoke Rectangle,hdcdesk,x1,y1,x2,y2 (you must put numbers in here) thats all. to draw a bitmap for example on the desktop, you should use LoadBitmap and BitBlt or smth like that. ive never done it. hope i could help. ahh, i forgot smth: dont forget to declare hwnddesk, and hwnddc in the .data section
Posted on 2000-12-05 14:55:00 by [SaFc0n]
What I found is that desktop window (I mean - shell) is merely a Listview control: (Any spy shows "SysList32" winclass) So You can e.c. set backgr. image: Hope maube this will be interestinnf for you to, thouuh it is somewhat "off-topic" .DATA hList HWND ? .CODE ... SetBackImage PROC LOCAL lvbki:LVBKIMAGE LOCAL Errors:DWORD szText ImagePath, "C:\IMAGES\SKY.bmp",0 szText szError1, "Coinitialize Failed !" mov Errors, 0 invoke CoInitialize, 0 .if eax==S_OK mov lvbki.ulFlags,LVBKIF_SOURCE_HBITMAP+LVBKIF_STYLE_TILE invoke LoadBitmap,hInstance,addr ImagePath .if eax!=0 mov lvbki.hbm,eax invoke SendMessage,hList,LVM_SETBKIMAGE,0,addr lvbki .else nop ;invoke DisplayLastError,addr ImagePath,0 .endif .else mov Errors,1 jmp Errors .endif errors: .if Errors == 1 ;mov eax, offset szError1 invoke MessageBox,NULL,addr szError1,NULL,MB_ICONERROR invoke CoUninitialize ;.elseif .endif ret SetBackImage ENDP
Posted on 2000-12-05 17:03:00 by AndyCar