Access the answers to your technology questions today.
Subscribe Now
30-day free trial. Register in 60 seconds.
What Makes Experts Exchange Unique?
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.
Try it out and discover for yourself.
Subscribe Now
30-day free trial. Register in 60 seconds.
Join the Community
Give a Little. Get a Lot.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Join the Community
by: ashok111Posted on 2005-02-16 at 21:10:31ID: 13331764
@danselmo
key, MapVirtualKey(shiftkeys[j] .vkey, 0), 0, 0) ;
key, MapVirtualKey(shiftkeys[j] .vkey, 0), KEYEVENTF_KEYUP, 0) ;
: TObject); s; MAP) then gn(Clipboa rd); 'c:\FormTe st.bmp');
// Here is the exact size of the form created in Bitmap format and saved to a file. The form you are trying to save must be the active window.
procedure PostKeyEx32(key: Word; const shift: TShiftState; specialkey: Boolean) ;
type
TShiftKeyInfo = record
shift: Byte ;
vkey: Byte ;
end;
ByteSet = set of 0..7 ;
const
shiftkeys: array [1..3] of TShiftKeyInfo =
((shift: Ord(ssCtrl) ; vkey: VK_CONTROL),
(shift: Ord(ssShift) ; vkey: VK_SHIFT),
(shift: Ord(ssAlt) ; vkey: VK_MENU)) ;
var
flag: DWORD;
bShift: ByteSet absolute shift;
j: Integer;
begin
for j := 1 to 3 do
begin
if shiftkeys[j].shift in bShift then
keybd_event(shiftkeys[j].v
end;
if specialkey then
flag := KEYEVENTF_EXTENDEDKEY
else
flag := 0;
keybd_event(key, MapvirtualKey(key, 0), flag, 0) ;
flag := flag or KEYEVENTF_KEYUP;
keybd_event(key, MapvirtualKey(key, 0), flag, 0) ;
for j := 3 downto 1 do
begin
if shiftkeys[j].shift in bShift then
keybd_event(shiftkeys[j].v
end;
end;
procedure TForm1.Button6Click(Sender
begin
// Simulate PRINTSCREEN - snapshot of the active window
PostKeyEx32(VK_SNAPSHOT, [ssAlt], False);
Application.ProcessMessage
if Clipboard.HasFormat(CF_BIT
begin
Image1.Height := Height;
Image1.Width := Width;
Image1.Picture.Bitmap.Assi
Image1.Picture.SaveToFile(
end;
end;