AutoHotkey Community

It is currently May 26th, 2012, 2:11 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: gdi32 help please
PostPosted: January 6th, 2008, 3:24 pm 
Offline

Joined: November 9th, 2007, 4:44 pm
Posts: 20
Location: http://taplpoker.com/
does anyone have a complete list of function calls to gdi32 ??
and also when it asks for a structure such as bezier with 5 sets of points, how do you do that with ahk?

_________________
visit my website


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 6th, 2008, 4:57 pm 
Offline

Joined: October 15th, 2007, 7:23 pm
Posts: 252
At http://msdn2.microsoft.com/en-us/librar ... 85%29.aspx is a source for info on the Windows GDI. The DllCall function in AHK fits with the use of the Flat API very well.

Or you can get a SDK helpfile (click here). To do much of anything with the API you would also need a list of Windows constants. Those are in C include/header (winuser.h, wingdi.h etc) files so you would either need them or access to these constants. SKAN has posted a useful tool for fetching constants here:
http://www.autohotkey.com/forum/topic19766.html

As far as doing structures you first use VarSetCapacity to create a variable, then you use NumPut and NumGet to put in data or get out data. You send the Variable (psuedo-structure) address in the DllCall to the particular GDI function. For instance a call using a structure looks something like this:
Code:
VarSetCapacity(LpPoint, 8, 0)
DllCall("MoveToEx", UInt, hCDC, Int, XTopL, Int, YTopL, str, LpPoint,UInt)
XTopL:=NumGet(LpPoint, 0, Int)
YTopL:=NumGet(LpPoint, 4, Int)
As you can see from the DllCall, addresses of structures can be sent as a string (str). Most other variables involved with Windows GDI can be sent with UInt or Int. All handles (hWnd for example) are UInt and numbers like XTopL and YTopL are sent as Int. When counting bytes to a particular offset into a stucture you start at 0 and each HANDLE, DWORD, UINT, INT, LONG occupies 4 bytes. That's why YTopL is found at offset 4 in the above example.

I would recommend getting MoveToEx, LineTo or some simpler function to work first so that the learning curve won't be quite so high. You also have to deal with creating/selecting/deleting objects to get GDI to work so there's quite a lot involved (at least for me). Just holler back if you need more info, if I can't help I bet someone can.

Eited to Add:

I see from looking at your Yahtze game (looks great) that you probably already know all this so.....

Anyway, hope this helps.

dmatch


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Retro Gamer, tank, tommy, vsub and 18 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group