Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2008-09

WinCE api calls info

19 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Paul

Hi,

where can I find a list of available api calls for WinCE/Arm ? I need to make a screenshot, set the cursor postion and inject keypresses.

thanks,

Paul

Reply by email

Paul
to Paul

Found some in InterfaceBase; docs are very hard to find for a starter though .
Why doesn't TBitmap.Create exist in WinCE?
I'm trying to take a screenshot..

Paul

Earlier message 19 lines
----- Original Message ----- From: "Paul" To: "FPC-Pascal users discussions" Sent: Saturday, September 13, 2008 4:50 PM Subject: [fpc-pascal] WinCE api calls info > Hi, > > where can I find a list of available api calls for WinCE/Arm ? > I need to make a screenshot, set the cursor postion and inject keypresses. > > thanks, > > Paul _______________________________________________ > fpc-pascal maillist - > http://lists.freepascal.org/mailman/listinfo/fpc-pascal > >

Reply by email

Felipe Monteiro de Carvalho
to Paul
where can I find a list of available api calls for WinCE/Arm ?

Please note that your post is ambiguous. It is not clear what API you are trying to use. In the first post it seams to be the Windows CE API developed by Microsoft, which you can find searching in google for the following example string:

site:msdn2.microsoft.com GetWindow CE

In the second post it seams that you are talking about the Lazarus APIs, which are documented in the wiki and here:

http://wiki.lazarus.freepascal.org/Lazarus_Documentation

http://lazarus-ccr.sourceforge.net/docs/lcl/

I need to ..... set the cursor postion
uses Forms;
Mouse.CursorPos.X := 80;
Mouse.CursorPos.Y := 80;
Why doesn't TBitmap.Create exist in WinCE?

Of course it exists. It's in the Graphics unit and it is part of Lazarus. You need to install Lazarus to use it, not just Free Pascal.

I'm trying to take a screenshot..

For most platform you can use this:

http://wiki.lazarus.freepascal.org/Developing_with_Graphics#Taking_a_screenshot_of_the_screen

I don't know if it works on Windows CE.

Felipe Monteiro de Carvalho

Reply by email

Paul
to Felipe Monteiro de Carvalho

thanks for this link.

> Why doesn't TBitmap.Create exist in WinCE? Of course it exists. It's in the Graphics unit and it is part of Lazarus. You need to install Lazarus to use it, not just Free Pascal.

is installed this way.

I already found this and wanted to use it.
Unfortunalety, TBitmap.create is not recognized by the lazarus IDE (WinCE)

Paul

Reply by email

Felipe Monteiro de Carvalho
to Paul
Paul wrote
Unfortunalety, TBitmap.create is not recognized by the lazarus IDE (WinCE)

Is the Graphics unit in your uses clause?

TBitmap works in Windows CE, so there is something wrong with your code.

Felipe Monteiro de Carvalho

Reply by email

Mattias Gaertner
to Felipe Monteiro de Carvalho: Please note that your post is ambiguous. It is not clear what API you are trying to use.…
Show quoted text 22 lines
> where can I find a list of available api calls for WinCE/Arm ? Please note that your post is ambiguous. It is not clear what API you are trying to use. In the first post it seams to be the Windows CE API developed by Microsoft, which you can find searching in google for the following example string: site:msdn2.microsoft.com GetWindow CE In the second post it seams that you are talking about the Lazarus APIs, which are documented in the wiki and here: http://wiki.lazarus.freepascal.org/Lazarus_Documentation http://lazarus-ccr.sourceforge.net/docs/lcl/ > I need to ..... set the cursor postion uses Forms; Mouse.CursorPos.X := 80; Mouse.CursorPos.Y := 80;

The above won't do anything.
Use this:

Mouse.CursorPos:=Point(80,80);

Mattias

Reply by email

Mattias Gaertner
to Paul
Show quoted text 7 lines
----- Original Message ----- From: "Mattias Gaertner" >> Mouse.CursorPos.X := 80; >> Mouse.CursorPos.Y := 80; this is accepted in the IDE

Yes, because it is syntactically correct. But it only changes some temporary stack variables. Nothing will happen.

> Mouse.CursorPos:=Point(80,80); this isn't accepted

What error do you get?

procedure TMainForm.Button1Click(Sender: TObject);
begin
  Mouse.CursorPos:=Point(80,80);
end;

Mattias

Reply by email

Paul
to Mattias Gaertner: On Sat, 13 Sep 2008 22:44:43 +0200 Yes, because it is syntactically correct. But it only…

Cursorpos solved.

I had units InterfaceBase, LCLIntf, LCLType still in the uses clause.

Paul

I has unuts

Earlier message 39 lines
----- Original Message ----- From: "Mattias Gaertner" To: Sent: Saturday, September 13, 2008 10:57 PM Subject: Re: [fpc-pascal] WinCE api calls info > On Sat, 13 Sep 2008 22:44:43 +0200 > "Paul" wrote: > >> >> ----- Original Message ----- >> From: "Mattias Gaertner" >> >> Mouse.CursorPos.X := 80; >> >> Mouse.CursorPos.Y := 80; >> >> this is accepted in the IDE > > Yes, because it is syntactically correct. But it only changes some > temporary stack variables. Nothing will happen. > > >> > Mouse.CursorPos:=Point(80,80); >> this isn't accepted > > What error do you get? > > procedure TMainForm.Button1Click(Sender: TObject); > begin > Mouse.CursorPos:=Point(80,80); > end; > > > Mattias > _______________________________________________ > fpc-pascal maillist - > http://lists.freepascal.org/mailman/listinfo/fpc-pascal > >

Reply by email

Paul
to Felipe Monteiro de Carvalho: Please copy here your entire unit. Felipe Monteiro de Carvalho

----- Original Message -----

Earlier message 65 lines
From: "Felipe Monteiro de Carvalho" To: "FPC-Pascal users discussions" Sent: Saturday, September 13, 2008 11:01 PM Subject: Re: [fpc-pascal] WinCE api calls info > Please copy here your entire unit. > {$mode objfpc}{$H+} {.$smartlink on} {.$DEFINE RELEASE} {.$FPC_LINK_SMART} interface uses Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls, windows; type { TForm1 } TForm1 = class(TForm) Button1: TButton; Button2: TButton; Image1: TImage; Label1: TLabel; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); private { private declarations } public { public declarations } end; var Form1: TForm1; implementation { TForm1 } procedure captureScreen; var MyBitmap: TBitmap; ScreenDC: HDC; begin MyBitmap := TBitmap.create; ScreenDC := GetDC(0); MyBitmap.LoadFromDevice(ScreenDC); ReleaseDC(ScreenDC); end; procedure TForm1.Button2Click(Sender: TObject); begin Mouse.CursorPos:= point(10, 10); // WidgetSet.setcursorpos(10, 10); // uses InterfaceBase end;

Reply by email

Paul
to Felipe Monteiro de Carvalho: Please copy here your entire unit. Felipe Monteiro de Carvalho

There are conflicts :
when I remove Windows from the uses clause, then TBitmap.create is OK. But then HDC is not anymore

Paul

Earlier message 16 lines
----- Original Message ----- From: "Felipe Monteiro de Carvalho" To: "FPC-Pascal users discussions" Sent: Saturday, September 13, 2008 11:01 PM Subject: Re: [fpc-pascal] WinCE api calls info > Please copy here your entire unit. > > -- > Felipe Monteiro de Carvalho > _______________________________________________ > fpc-pascal maillist - > http://lists.freepascal.org/mailman/listinfo/fpc-pascal > >

Reply by email

Felipe Monteiro de Carvalho
to Paul
Paul wrote
when I remove Windows from the uses clause, then TBitmap.create is OK. But then HDC is not anymore

Try specifing Graphics.TBitmap

Felipe Monteiro de Carvalho

Reply by email

Paul
to Felipe Monteiro de Carvalho

Already done,

uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,

  ExtCtrls, windows;
procedure captureScreen;
var
  MyBitmap: Graphics.TBitmap;
  ScreenDC: HDC;
begin
  MyBitmap := Graphics.TBitmap.Create;
  try
    Mybitmap.Canvas.CopyMode:= cmSrcInvert;   //OK
    ScreenDC := GetDC(0);
    MyBitmap.LoadFromDevice(ScreenDC);
   .
  finally
    ReleaseDC(ScreenDC);  <-- error wrong number of parameters
  end;
end;

I haven't found what the parameters have to be this way

Paul

Earlier message 20 lines
----- Original Message ----- From: "Felipe Monteiro de Carvalho" To: "FPC-Pascal users discussions" Sent: Sunday, September 14, 2008 12:11 AM Subject: Re: [fpc-pascal] WinCE api calls info > On Sat, Sep 13, 2008 at 6:17 PM, Paul wrote: >> when I remove Windows from the uses clause, then TBitmap.create is OK. >> But then HDC is not anymore > > Try specifing Graphics.TBitmap > > -- > Felipe Monteiro de Carvalho > _______________________________________________ > fpc-pascal maillist - > http://lists.freepascal.org/mailman/listinfo/fpc-pascal > >

Reply by email

Mattias Gaertner
to Paul
Show quoted text 26 lines
Already done, uses Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls, windows; procedure captureScreen; var MyBitmap: Graphics.TBitmap; ScreenDC: HDC; begin MyBitmap := Graphics.TBitmap.Create; try Mybitmap.Canvas.CopyMode:= cmSrcInvert; //OK ScreenDC := GetDC(0); MyBitmap.LoadFromDevice(ScreenDC); . finally ReleaseDC(ScreenDC); <-- error wrong number of parameters end; end; I haven't found what the parameters have to be this way

Move cursor in the bracket and press Ctrl+Shift+Space. Or use 'Find declaration' (Alt+Up) to jump to ReleaseDC and see its definition.

Mattias

Reply by email

Felipe Monteiro de Carvalho
to Mattias Gaertner

The problem is too much ambiguity because the Windows unit declares a lot of stuff with the same names as LCL, so drop the Windows unit if you don't really need it and add LCLType and LCLIntf instead. Create a separate unit to isolate direct calls to the Windows API.

Felipe Monteiro de Carvalho

Reply by email