-
Does anyone know how to copy a specific window into a form by using "Bitblt"? If I have a handle to a specific window, how do I copy it into my form? Whether if it is minimized or maximized.
Another question, is the only way possible to load an image file is using "LoadPicture". Can I use sometype of API to tell VB where the image file is located and load it in?
If you help me, I will give you a penny, just kidding.
-
:) Hi again Nitro! :)
You need the hDC not the Hwnd for the window. Use the GetDC API:
Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
-
What's wrong with Loadpicture anyway?
-
I am taking your advice from a couple of days ago not to use too many image controls. I am now learning how to use API such as BitBlt.
BTW...For example, I put the Explorer's handle in GetDC(), but it still giving me the entire screen. I just want to copy Explorer view into the form(even when it is minimize).
**What can I use to load an image file?
Can you provide me the codes on getting the wallpaper using BitBlt. That will really help.
Thanks again Kedaman.
[Edited by Nitro on 03-29-2000 at 06:58 PM]
-
Hi Nitro,
Okay here goes:
Declarations from win api
(i have shortend them to make them fit)
Declare function GetDesktopWindow() etc
Declare function GetDC() etc
Declare function BitBlt()etc
Sub MySub()
dim MyHwnd as long
dim DskTopHwnd as long
dim DskTopDc as long
dim Dummy as long
DskTopHwnd=getdesktopwindow()
DskTopDc=GetDc(DskTopHwnd)
Dummy = BitBlt(DestDc,tLeft,tTop,tWidth,tHeight,SourceHDc,RasterOp)
I reckon the rasterop ought to SRCCOPY
SourceDC must be Hdc of the source which would be DskTopDc
DestDc would be wher yo want to paste the BitBlt output rect
Hope it helps
DocZaf
{;->
-
Hi Nitro,
I forgot to add the last posting i entered does NOT work with minimised or NOT focused forms or objects
Apologies
DocZaf
{;->
-
Thanks Zaf Khan!
I just got back and got your email. I will try your example now and keep you posted.
Thanks again.
-
Hi Nitro,
I've emailed the raster ops declarations to you as it seemed a bit daft to clutter this great site with stuff that can be found in the winapi.txt file
DocZaf
{;->