Delphi Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
델파이 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
FreePascal/Lazarus
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
델마당
볼랜드포럼 광고 모집

델파이 팁&트릭
Delphi Programming Tip&Tricks
[242] 윈도 스냅샷
civilian [civilian] 5980 읽음    2008-04-28 19:42
사용방법

WindowSnap(Self.Handle, Image1.Picture.Bitmap) ;
Image1.Refresh;

함수선언

function WindowSnap(windowHandle: HWND; bmp: TBitmap): boolean;
var
  r: TRect;
  user32DLLHandle: THandle;
  printWindowAPI: function(sourceHandle: HWND; destinationHandle: HDC; nFlags: UINT): BOOL; stdcall;
begin
  result := False;
  user32DLLHandle := GetModuleHandle(user32) ;
  if user32DLLHandle <> 0 then
  begin
    @printWindowAPI := GetProcAddress(huser32, 'PrintWindow') ;
    if @printWindowAPI <> nil then
    begin
      GetWindowRect(windowHandle, r) ;
      bmp.Width := r.Right - r.Left;
      bmp.Height := r.Bottom - r.Top;
      bmp.Canvas.Lock;
      try
        result := printWindowAPI(windowHandle, bmp.Canvas.Handle, 0) ;
      finally
        bmp.Canvas.Unlock;
      end;
    end;
  end;
end; (*WindowSnap*)

출처 : http://delphi.about.com/od/delphitips2008/qt/print_window.htm
반영재 [ycom]   2008-04-29 12:15 X
제 내공이 워낙 바닥이라...실행해 봤는데 안되요...어떻게 해야 정상적으로 될까요?
푸른꿈 [bluedream]   2008-04-29 17:15 X
@printWindowAPI := GetProcAddress(huser32, 'PrintWindow') ;

@printWindowAPI := GetProcAddress(user32DLLHandle , 'PrintWindow') ;
로 하면...

+ -

관련 글 리스트
242 윈도 스냅샷 civilian 5980 2008/04/28
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.