PDA

View Full Version : Windows API



Chris Holbrook
12-01-2009, 18:29
How would I go about converting PowerBasic code which uses the API? The interpreter doesn't like "getdlgitem" for example. Do I have to include other modules than GUI to do this, and if so, which?

ErosOlmi
12-01-2009, 19:00
Chris,

thinBasic API declaration is almost the same as PowerBasic or FreeBasic. Just add the same DECLARE you would do in PowerBasic:





DECLARE FUNCTION GetDlgItem LIB "USER32.DLL" ALIAS "GetDlgItem" (BYVAL hDlg AS DWORD, BYVAL nIDDlgItem AS LONG) AS DWORD





Than use GetDlgItem(...) as you would in PowerBasic.
In general thinBasic declares are very compatible with PowerBasic INC files apart MACRO command. thinBasic does not manage macro commands (for the moment).

Some often used API has been created in thinBasic as native keywords. For example API IsIconic has its thinBasic equivalent WIN_IsIconic (http://www.thinbasic.com/public/products/thinBasic/help/html/win_isiconic.htm), API GetForeGroundWindow has its thinBasic equivalent WIN_GetForeGround (http://www.thinbasic.com/public/products/thinBasic/help/html/win_getforeground.htm), and so on.

Regarding standard windows equates, we have included a lot in UI (User Interface) module. You can get the list of them using the following attached script.

Hope to have replied to your question.
Ciao
Eros

Chris Holbrook
12-01-2009, 19:43
Thanks Eros!