Click here to Skip to main content
15,902,445 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: where can find the fastest Pin
G.Richard12-Jul-01 20:01
G.Richard12-Jul-01 20:01 
GeneralRe: where can find the fastest Pin
Tomasz Sowinski12-Jul-01 23:44
Tomasz Sowinski12-Jul-01 23:44 
GeneralTranspareten window -(CBitmap::BitBlt) Pin
11-Jul-01 23:12
suss11-Jul-01 23:12 
GeneralRe: Transpareten window -(CBitmap::BitBlt) Pin
Tomasz Sowinski12-Jul-01 1:11
Tomasz Sowinski12-Jul-01 1:11 
GeneralRe: Transpareten window -(CBitmap::BitBlt) Pin
12-Jul-01 1:40
suss12-Jul-01 1:40 
GeneralError ... Pin
12-Jul-01 2:33
suss12-Jul-01 2:33 
GeneralRe: Error ... Pin
Tomasz Sowinski12-Jul-01 2:42
Tomasz Sowinski12-Jul-01 2:42 
GeneralRe: Error ... Pin
12-Jul-01 3:16
suss12-Jul-01 3:16 
This is code from program in VB :

Function hDCToPicture(ByVal hDCSrc As Long, ByVal LeftSrc As Long, ByVal TopSrc As Long, ByVal WidthSrc As Long, ByVal HeightSrc As Long) As Picture
Dim hDCMemory As Long, hBmp As Long, hBmpPrev As Long, R As Long
Dim hPal As Long, hPalPrev As Long, RasterCapsScrn As Long, HasPaletteScrn As Long
Dim PaletteSizeScrn As Long, LogPal As LOGPALETTE

'Create a compatible device context
hDCMemory = CreateCompatibleDC(hDCSrc)
'Create a compatible bitmap
hBmp = CreateCompatibleBitmap(hDCSrc, WidthSrc, HeightSrc)
'Select the compatible bitmap into our compatible device context
hBmpPrev = SelectObject(hDCMemory, hBmp)
R = BitBlt(hDCMemory, 0, 0, WidthSrc, HeightSrc, hDCSrc, LeftSrc, TopSrc, vbSrcCopy)
hBmp = SelectObject(hDCMemory, hBmpPrev)


R = DeleteDC(hDCMemory)

Set hDCToPicture = CreateBitmapPicture(hBmp, hPal)
End Function
Private Sub Form_Load()
dsk = GetDesktopWindow()
'Create a picture object from the screen
Screen.TwipsPerPixelX, Screen.Height / Screen.TwipsPerPixelY)
srcdc = GetDC(dsk)
Set Me.Picture = hDCToPicture(srcdc, Left / Screen.TwipsPerPixelX, Top / Screen.TwipsPerPixelY, Width / Screen.TwipsPerPixelX, Height / Screen.TwipsPerPixelY)
End sub

Function CreateBitmapPicture(ByVal hBmp As Long, ByVal hPal As Long) As Picture
Dim R As Long, Pic As PicBmp, IPic As IPicture, IID_IDispatch As GUID

'Fill GUID info
With IID_IDispatch
.Data1 = &H20400
.Data4(0) = &HC0
.Data4(7) = &H46
End With

'Fill picture info
With Pic
.Size = Len(Pic) ' Length of structure
.Type = vbPicTypeBitmap ' Type of Picture (bitmap)
.hBmp = hBmp ' Handle to bitmap
.hPal = hPal ' Handle to palette (may be null)
End With

'Create the picture
R = OleCreatePictureIndirect(Pic, IID_IDispatch, 1, IPic)

'Return the new picture
Set CreateBitmapPicture = IPic
End Function

GeneralRe: Error ... Pin
Tomasz Sowinski12-Jul-01 3:31
Tomasz Sowinski12-Jul-01 3:31 
GeneralMemory monitoring Pin
Geetha11-Jul-01 22:38
Geetha11-Jul-01 22:38 
GeneralRe: Memory monitoring Pin
Tomasz Sowinski12-Jul-01 1:25
Tomasz Sowinski12-Jul-01 1:25 
GeneralUsing of one object in three dialog ... Pin
Hadi Rezaee11-Jul-01 22:37
Hadi Rezaee11-Jul-01 22:37 
GeneralRe: Using of one object in three dialog ... Pin
Tomasz Sowinski12-Jul-01 1:07
Tomasz Sowinski12-Jul-01 1:07 
GeneralRe: Using of one object in three dialog ... Pin
Hadi Rezaee12-Jul-01 2:15
Hadi Rezaee12-Jul-01 2:15 
GeneralRe: Using of one object in three dialog ... Pin
Tomasz Sowinski12-Jul-01 2:36
Tomasz Sowinski12-Jul-01 2:36 
GeneralRe: Using of one object in three dialog ... Pin
Hadi Rezaee12-Jul-01 4:18
Hadi Rezaee12-Jul-01 4:18 
GeneralRe: Using of one object in three dialog ... Pin
Tomasz Sowinski12-Jul-01 4:24
Tomasz Sowinski12-Jul-01 4:24 
GeneralRe: Using of one object in three dialog ... Pin
Stan Shannon12-Jul-01 4:59
Stan Shannon12-Jul-01 4:59 
GeneralRe: Using of one object in three dialog ... Pin
Tomasz Sowinski12-Jul-01 7:00
Tomasz Sowinski12-Jul-01 7:00 
GeneralRe: Using of one object in three dialog ... Pin
Hadi Rezaee13-Jul-01 18:26
Hadi Rezaee13-Jul-01 18:26 
GeneralRe: Using of one object in three dialog ... Pin
CMFC6.0VS.NETUser12-Jul-01 4:48
CMFC6.0VS.NETUser12-Jul-01 4:48 
GeneralRe: Using of one object in three dialog ... Pin
Stan Shannon12-Jul-01 5:49
Stan Shannon12-Jul-01 5:49 
GeneralRe: Using of one object in three dialog ... Pin
Hadi Rezaee13-Jul-01 18:19
Hadi Rezaee13-Jul-01 18:19 
GeneralRe: Using of one object in three dialog ... Pin
Hadi Rezaee14-Jul-01 1:49
Hadi Rezaee14-Jul-01 1:49 
GeneralRe: Using of one object in three dialog ... Pin
Stan Shannon14-Jul-01 3:38
Stan Shannon14-Jul-01 3:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.