Solved

Form Image including TitleBar

Posted on 2003-11-12
11
321 Views
Last Modified: 2013-11-18
Hi Friends

I want to take the image of an invisible Form.

I have tried it using GetFormImage and PaintTo
But this all gives only the image of the client area. But i want to get the image including title bar Like we use Alt + PrintScreen

Thanks


Cheers
0
Comment
Question by:Bijith
  • 4
  • 3
  • 2
11 Comments
 
LVL 4

Expert Comment

by:kabix
Comment Utility
you want to make a screen shot of a program or what? Please explain more...
0
 
LVL 26

Accepted Solution

by:
EddieShipman earned 50 total points
Comment Utility
If it is invisible, you can't get an image of it.
0
 
LVL 3

Author Comment

by:Bijith
Comment Utility
Thanks for your comments

kabix,

Yes, I want to get the image of the form. similar to screenshort.


 EddieShipman,

Using GetFormImage,  PaintTo you can take the image of the form. But  it have only the image of clientarea(Excluding titlebar and border).

But I want the image of complete form

thanks


0
 
LVL 26

Expert Comment

by:EddieShipman
Comment Utility
Like I said...
"If it is invisible, you can't get an image of it."
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 3

Author Comment

by:Bijith
Comment Utility
EddieShipman,

Using  GetFormImage,  PaintTo  you can take the image of windows client area

thanks
0
 
LVL 4

Expert Comment

by:kabix
Comment Utility
Is the form invisible or you can see it? Because if the form is invisible you can not take a screen shot of it like you do with printscreen
0
 
LVL 26

Expert Comment

by:EddieShipman
Comment Utility
Here is your solution even thought it won't work on an INVISIBLE window.
Like I said before, YOU CAN NOT GET AN IMAGE OF AN INVISIBLE FORM.


  function GetWindowBitmap(hWindow:hWnd):HBitmap;
  var
    DC,MemDC:HDC;
    bmWidth,bmHeight:Integer;
    TR:tRect;
    bm,obm:HBitmap;
  begin
    // full window bitmap
    GetWindowRect(hWindow,TR);
    { note the +1 }
    bmWidth:=TR.Right-TR.Left+1;
    bmHeight:=TR.Bottom-TR.Top+1;
    // Full Screen DC
    DC:=GetDC(0);
    MemDC:=CreateCompatibleDC(DC);

    bm:=CreateCompatibleBitmap(DC,bmWidth,bmHeight);
    // now select the bitmap to memDC
    obm:=SelectObject(MemDC,bm);
    // and copy the window

    BitBlt(MemDC,0,0,bmWidth,bmHeight,DC,tr.left,tr.top,SRCCOPY);
    // clean up
    SelectObject(MemDC,obm);
    DeleteDC(MemDC);
    ReleaseDC(hWindow,DC);
    // here is your bitmap
    GetWindowBitmap:=bm;
  end;
0
 
LVL 3

Author Comment

by:Bijith
Comment Utility
Screen is invisible

EddieShipman,

Thanks for your code. But this is not what i required, This was what my program was doing previously. But now i want to take the image in another way.

Also You are still holding on the point that "YOU CAN NOT GET AN IMAGE OF AN INVISIBLE FORM."

But now i am getting the image of the client area of the invisible form.
I am using PaintTo method. I will supply a deveice context to it . So it will contain the image of the client area and the controls inside client area.


regards
Bijith
0
 
LVL 26

Expert Comment

by:EddieShipman
Comment Utility
But as you said, you use PaintTo and it does only clientarea of the form.
You are going to have to live with that or make your form visible to get caption.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
The viewer will learn how to dynamically set the form action using jQuery.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now