View Single Post
  #102  
Old 10-16-2007, 10:52 PM
_dave_ _dave_ is offline
Senior Member
 
Join Date: Feb 2005
Location: UK
Posts: 2,628
Default Re: PokerPad - AHK hotkey script

This looks much cleaner than the stuff I emailed you [img]/images/graemlins/smile.gif[/img] Awesome.

[ QUOTE ]

restricting the size of the buffer to the size of the window


[/ QUOTE ]

Required - a cheapo hack I just put in there because it was enough for testing at the time [img]/images/graemlins/smile.gif[/img]

[ QUOTE ]

also the use of ReleaseDC instead of DeleteDC.


[/ QUOTE ]

I'll have to read up on this, but I think you are correct. All I know is that without the DeleteDC commands, it stops working after a while (running out of GDI resources imo). What you say rings a bell - but it is >3 years since I did any C++ Win32-GDI coding, so I need to check. I *think* DeleteDC does enough to free the resources - but it certainly can't hurt to ReleaseDC too.

Another thisn - not mentioned above, but in your email - about the PrintWindow options:

Either the documentation or the function is backwards [img]/images/graemlins/frown.gif[/img]

0 provides ClientOnly, 1 adds AFAICT borders (but not caption) to the captured DC.

[ QUOTE ]

I have converted everything in PokerPad 0.1.5 (not yet released) to use these functions instead of reading from the screen and everything seems to work as before (This usually scares me into thinking I really didn't change anything!


[/ QUOTE ]

Fantastic [img]/images/graemlins/smile.gif[/img]

You can be sur using these functions it is using the PrintWindow method - so if it all continues to work without noticable difference - sweet [img]/images/graemlins/smile.gif[/img]

I am halfway thru converting BetPot to use these (with ImageMatch also) ... about to fall asleep [img]/images/graemlins/frown.gif[/img]


You don't use ity in the above functions, but there MUST be a better way of adding a +/- for "Shades of variation" than my crapola method of SetFormat -> StringMid -> add/subtract ->recombine Hex - SetFormat, which I'm sure is horrific but works.

I guess The Binary / BitShift operators, but hose confuse me no end [img]/images/graemlins/frown.gif[/img]

dave.
Reply With Quote