Screenshot function available in the API

Share your ideas how the software could be improved
Message
Author
Wessel
Posts: 63
Joined: Tue Oct 12, 2010 6:45 pm

Screenshot function available in the API

#1 Postby Wessel » Fri Jul 29, 2011 4:21 pm

Could you please export the screenshot function to the API so we can make screen shots from Scripts, Indicators and strategies?

Many thanks in advance

Wessel

dackjaniels
Posts: 151
Joined: Tue Feb 24, 2009 1:03 pm

#2 Postby dackjaniels » Fri Sep 16, 2011 5:06 am

I second this :-)

Steve

FT Support
Posts: 905
Joined: Sat Jul 11, 2009 10:54 am

#3 Postby FT Support » Fri Sep 16, 2011 1:31 pm

Hello,

We'll add this functionality later (sorry, for now i cannot say when) but for now you can use a work-around.
It is possible to capture the screenshot of any window if you know its handle (see details here: http://delphi.about.com/od/adptips2006/ ... active.htm ).

To retrieve the handle of FT main window you can use "FindWindowByCaption" function (see below)

Code: Select all

{-----Enumerate windows------------------------------------------------------}
function EnumWindowsProc(handle: HWND; value: integer): boolean; stdcall;
var
  buff: array[0..1023] of char;
  s: string;
begin
  GetWindowText(handle, @buff[0], 1024);
  s := string(PChar(@buff[0]));
  if (pos(_CaptionText, s) <> 0) and (IsWindowVisible(handle)) then
    WindowHandle := handle;
  result := (WindowHandle <> 0);
end;

{-----Find program window----------------------------------------------------}
function FindWindowByCaption(CaptionText: string): HWND;
begin
  WindowHandle := 0;
  _CaptionText := CaptionText;
  EnumWindows(@EnumWindowsProc, 0);
  result := WindowHandle;
end;
Check our other product here:
http://www.forexcopier.com


Return to “New Feature Suggestions”

Who is online

Users browsing this forum: No registered users and 19 guests