Sign in Join

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

Mailing lists / fpc-pascal / 2000-10

fpc 1.0.2 question

6 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

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

Martin Hankovec

Hello,
after I have installed win32 and Dos stuff, the ppc386.exe was in go32v2 directory only (not in win32). Is it for purpose or is it a bug ? :-)))

It's simple to copy it to another dir (from go23v2 to win32), I'd like to know only, if there is a reason for only one copy of it :-)))

Have a nice day

Martin

MPDJ
to Martin Hankovec

Hi,

I'm new to FPC under Windows, and I'm having trouble finding any information on using Windows API calls. I've cut a snippet from the WinAmp website, which is what I'm trying to control:

External applications can find the Winamp window using the following piece of code (written in C, but other languages that support the Win32 API should be very similar).

HWND hwndWinamp = FindWindow("Winamp v1.x",NULL);

Winamp responds to three messages in particular: WM_USER, WM_COMMAND, and WM_COPYDATA. WM_USER and WM_COPYDATA allow you to control some of the more advanced aspects of Winamp while WM_COMMAND lets you do simple things such as simulate the pause button being pressed.

#define IPC_STARTPLAY 102

/*
** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_STARTPLAY); **
** Using IPC_STARTPLAY is like hitting 'Play' in Winamp, mostly. */

All the source examples are in C/C++. Can anyone help me with a small example snippet, or point me in the right direction with a link !?

I'd be more than grateful.

Andy

PS. Sorry if this topic has come up before, but I've only been on the mailing list a couple of months.

Sebastian Günther
to MPDJ
MPDJ wrote 5 lines
Hi, I'm new to FPC under Windows, and I'm having trouble finding any information on using Windows API calls.

Just add the unit 'Windows' to the 'uses' list of your program, and you can use almost all Win32 functions and declarations as you would use them in C.

HWND hwndWinamp = FindWindow("Winamp v1.x",NULL);
program Test;
uses Windows;
var
  hwndWinamp: HWND;
begin
  hwndWinamp := FindWindow('Winamp v1.x', nil);
  ...
end.
Show quoted text 7 lines
#define IPC_STARTPLAY 102 /* ** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_STARTPLAY); ** ** Using IPC_STARTPLAY is like hitting 'Play' in Winamp, mostly. */

in Pascal:

  ...
  const
    IPC_STARTPLAY = 102;
  begin
    ...
    SendMessage(hwnd_winamp, WM_WA_IPC, 0, IPC_STARTPLAY);
    ...
  end;

If you have the source code of the Free Pascal RTL, just have a look at the files in the rtl\win32\wininc directory. There you can find all declarations; it it very useful to have a 'grep'-like utility available for searching them.

- Sebastian

JPT
to MPDJ: I'm new to FPC under Windows, and I'm having trouble finding any information on using…

Hi!

More than a year ago, i wrote a delphi plugin for winamp. It is just a plain plugin that opens a window. i did not go any further, 'cause I had problems using OpenGL.

Do not ask any qestions, i really do not remember anything. ;-)

Perhaps someone finds it helpful.

Jan

Earlier message 14 lines
----- Original Message ----- From: "MPDJ" To: Sent: Saturday, October 14, 2000 11:38 PM Subject: [fpc-pascal]Wiindows API calls. > Hi, > > I'm new to FPC under Windows, and I'm having trouble finding any information > on using Windows API calls. I've cut a snippet from the WinAmp website, > which is what I'm trying to control: >
Jeff Patterson
to MPDJ: I'm new to FPC under Windows, and I'm having trouble finding any information on using…

A bit out of date, and probably still not well commented. You can check out a WinAmp unit I made at:

FPC-WA02.ZIP
http://www.geocities.com/SiliconValley/Vista/7104/fpc.htm

Earlier message 56 lines
----- Original Message ----- From: "MPDJ" To: Sent: Saturday, October 14, 2000 6:38 PM Subject: [fpc-pascal]Wiindows API calls. > Hi, > > I'm new to FPC under Windows, and I'm having trouble finding any information > on using Windows API calls. I've cut a snippet from the WinAmp website, > which is what I'm trying to control: > > > > External applications can find the Winamp window using the following piece > of code (written in C, but other languages that support the Win32 API should > be very similar). > > HWND hwndWinamp = FindWindow("Winamp v1.x",NULL); > > > Winamp responds to three messages in particular: WM_USER, WM_COMMAND, and > WM_COPYDATA. WM_USER and WM_COPYDATA allow you to control some of the more > advanced aspects of Winamp while WM_COMMAND lets you do simple things such > as simulate the pause button being pressed. > > > > #define IPC_STARTPLAY 102 > > /* > ** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_STARTPLAY); > ** > ** Using IPC_STARTPLAY is like hitting 'Play' in Winamp, mostly. > */ > > > All the source examples are in C/C++. Can anyone help me with a small > example snippet, or point me in the right direction with a link !? > > I'd be more than grateful. > > > Andy > > > PS. Sorry if this topic has come up before, but I've only been on the > mailing list a couple of months. > > > _______________________________________________ > fpc-pascal maillist - > http://lists.freepascal.org/mailman/listinfo/fpc-pascal