AutoHotkey Community

It is currently May 26th, 2012, 6:48 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 73 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
 Post subject:
PostPosted: June 18th, 2009, 4:15 pm 
Offline
User avatar

Joined: September 8th, 2008, 12:26 am
Posts: 1048
Location: Ploieşti, RO
If it's good code, I think it's worth updating every once in a blue moon. :roll:

Anyway, thanks again for the help and patience; I'll see to following the advices when I get back home (gotta leave now). Have a good one! ;)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 18th, 2009, 5:46 pm 
Online

Joined: March 10th, 2008, 12:55 am
Posts: 1907
Location: Minnesota, USA
Having some issues setting it to RGB mode.
if I do this:
Code:
GetColor()
{
   VarSetCapacity(nColor, 6)
   SendMessage, 1046, 0, 0,, A
   DllCall("wsprintf", "str", nColor, "str", "%06X", "Uint", ErrorLevel, "Cdecl")
   
   StringRight,red,nColor,2
   StringTrimRight,nColor,nColor,2
   StringLeft,blue,nColor,2
   StringTrimLeft,nColor,nColor,2
   
   nColor=%red%%nColor%%blue%
  Return nColor
}

to swap the RR an BB, it works well when pasted to clipboard, however, in the display tooltip, the color of the tooltip and the text inside the tooltip are not accurate. I've tried inserting my modification right before the tooltip displays, but it then shows completely inaccurate colorcodes.

any help appreciated.

_________________
rawr. be very afraid
*poke*
Note: My name is all lowercase for a reason.
"I think Bigfoot is blurry, that's the problem. It's not the photographer's fault, Bigfoot is blurry. So there's a large, out-of-focus monster roaming the countryside."


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 18th, 2009, 11:01 pm 
Offline
User avatar

Joined: September 8th, 2008, 12:26 am
Posts: 1048
Location: Ploieşti, RO
All I got with the script pointed to (ScreenCapture) was a black bitmap. Will see if the functions listed in your previous post make any difference in the current script. Sorry for all the fuss. :oops:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 19th, 2009, 12:14 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
tidbit wrote:
it works well when pasted to clipboard, however, in the display tooltip,
GetColor() has nothing to do with the displayed text, is used when copying to clipboard. Change appropriately inside Zoomer().


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 19th, 2009, 12:17 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
Drugwash wrote:
All I got with the script pointed to (ScreenCapture) was a black bitmap.
It doesn't really matter in this case whether the whole script works or not.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 19th, 2009, 12:33 am 
Offline
User avatar

Joined: September 8th, 2008, 12:26 am
Posts: 1048
Location: Ploieşti, RO
True... Just sayin'.
Anyway, I've changed the code as advised and indeed the magnified window doesn't flicker anymore, however its contents is always static, nothing but garbled colors and the magnified cursor image suffers from accumulative effect. :? I don't see oBM used anywhere so maybe there's something missing (Strike that - oBM seems to be the same with hBM, after the replacement)... or not :? .
EDIT: I've been testing the DC (hDC_SC, is it OK?) against RASTERCAPS->RC_BITBLT capability and it's OK. I'm a bit stuck now - best if I let it lie down for a while.

Apologies if it's a bit hard for me to delve into hard coding at 43. :oops: Will keep performing tests, maybe something good will eventually come out.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 19th, 2009, 3:26 am 
Online

Joined: March 10th, 2008, 12:55 am
Posts: 1907
Location: Minnesota, USA
Sean wrote:
tidbit wrote:
it works well when pasted to clipboard, however, in the display tooltip,
GetColor() has nothing to do with the displayed text, is used when copying to clipboard. Change appropriately inside Zoomer().

I tried that, as I stated:
"I've tried inserting my modification right before the tooltip displays, but it then shows completely inaccurate colorcodes."
I've tried it in several parts of zoomer() (right before the tooltip display, right after nColor:=DLLcall() [even disabling that line] and a couple other spots.)
depending where i put it/what other code I modify, different things happen. sometimes i get all FFFFFF's, sometimes the color code is completely off (I might click on the color FF4400, in the tooltip it might show up as 404041).

So..any help is appreciated.
Thanks.

_________________
rawr. be very afraid
*poke*
Note: My name is all lowercase for a reason.
"I think Bigfoot is blurry, that's the problem. It's not the photographer's fault, Bigfoot is blurry. So there's a large, out-of-focus monster roaming the countryside."


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 19th, 2009, 4:58 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
tidbit wrote:
I tried that, as I stated:
There is similar line inside Zoomer(), change it to
Code:
DllCall("wsprintf", "str", nColor, "str", " 0x%06X    (#RRGGBB) ", "Uint", (nColor&0x0000FF)<<16 | (nColor&0x00FF00) | (nColor&0xFF0000)>>16, "Cdecl")


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 19th, 2009, 5:18 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
Drugwash wrote:
I don't see oBM used anywhere so maybe there's something missing
oBM is not supposed to be used, it's just 1x1 monochrome bitmap which is useless.
Quote:
(Strike that - oBM seems to be the same with hBM, after the replacement)
That means hBM is also created as 1x1 monochrome bitmap, i.e., something wasn't or couldn't be created properly in your system. Have you checked?
Code:
MsgBox % hDC_SC " | " hDC_TT " | " hDC_LW " | " hBM " | " oBM " | " nW " | " nH

Quote:
EDIT: I've been testing the DC (hDC_SC, is it OK?) against RASTERCAPS->RC_BITBLT capability and it's OK.
You mean you had checked GetDeviceCaps? What was the return value?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 19th, 2009, 7:43 am 
Offline
User avatar

Joined: September 8th, 2008, 12:26 am
Posts: 1048
Location: Ploieşti, RO
Sorry about the oBM confusion, I've read the MSDN docs again after posting and cleared that up. hBM is not the same as oBM, I checked that too after posting - my bad.

Yes, I've checked GetDeviceCaps - it returned 0x1107 (with the RASTERCAPS mask).
Code:
rcaps := DllCall("GetDeviceCaps", UInt, hDC_SC, Int, 38, Int) ; RASTERCAPS


Sorry for the delay, been working on something else. Gotta sleep now, it's almost 10AM and it's been a long night. :? Laterz! ;)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 19th, 2009, 10:08 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
Drugwash wrote:
Yes, I've checked GetDeviceCaps - it returned 0x1107 (with the RASTERCAPS mask).
The capability of your screen's hDC is very limited. How about hDC_LW and hDC_TT? I suppose the same for them, but then the zooming should have been impossible... Looks like you better stick with the old code.

Code:
/* Raster Capabilities */
#define RC_NONE
#define RC_BITBLT           1       /* Can do standard BLT.             */
#define RC_BANDING          2       /* Device requires banding support  */
#define RC_SCALING          4       /* Device requires scaling support  */
#define RC_BITMAP64         8       /* Device can support >64K bitmap   */
#define RC_GDI20_OUTPUT     0x0010      /* has 2.0 output calls         */
#define RC_GDI20_STATE      0x0020
#define RC_SAVEBITMAP       0x0040
#define RC_DI_BITMAP        0x0080      /* supports DIB to memory       */
#define RC_PALETTE          0x0100      /* supports a palette           */
#define RC_DIBTODEV         0x0200      /* supports DIBitsToDevice      */
#define RC_BIGFONT          0x0400      /* supports >64K fonts          */
#define RC_STRETCHBLT       0x0800      /* supports StretchBlt          */
#define RC_FLOODFILL        0x1000      /* supports FloodFill           */
#define RC_STRETCHDIB       0x2000      /* supports StretchDIBits       */
#define RC_OP_DX_OUTPUT     0x4000
#define RC_DEVBITS          0x8000


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 19th, 2009, 4:21 pm 
Offline
User avatar

Joined: September 8th, 2008, 12:26 am
Posts: 1048
Location: Ploieşti, RO
Ugh, I was too tired and it showed. :oops: The result was actually negative (-0x1107) because I had erroneously specified the return type as signed integer.

I now changed it to UInt and - somehow odd - it returned 0xFFFFEEF9. Of course, the same value was returned for all DC handles. Well, I just ignored the high word and by decoding the low word I got a pretty large list:
Code:
RC_BITBLT           1       /* Can do standard BLT.             */
RC_BITMAP64         8       /* Device can support >64K bitmap   */
RC_GDI20_OUTPUT     0x0010      /* has 2.0 output calls         */
RC_GDI20_STATE      0x0020
RC_SAVEBITMAP       0x0040
RC_DI_BITMAP        0x0080      /* supports DIB to memory       */
RC_DIBTODEV         0x0200      /* supports DIBitsToDevice      */
RC_BIGFONT          0x0400      /* supports >64K fonts          */
RC_STRETCHBLT       0x0800      /* supports StretchBlt          */
RC_STRETCHDIB       0x2000      /* supports StretchDIBits       */
RC_OP_DX_OUTPUT     0x4000
RC_DEVBITS          0x8000
The card is a MSI GeForce4 Ti4200 VTD8X with 128MB VRAM so it's not that limited in capabilities but nevertheless, old. The driver though is very old (v45.32) but anything other than official MSI driver offered at their site (and the above is the latest) would disable Direct3D, which is a real show stopper. :(


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 20th, 2009, 12:32 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
Drugwash wrote:
I now changed it to UInt and - somehow odd - it returned 0xFFFFEEF9.
OK, then, I think the loop is too fast for your system, I suggest to experiment adding some Sleep inside the loop. And, as you said your system doesn't support a layered window, you may change the flag in the script 0x40CC0020 simply to 0x00CC0020. Or stick with the old code. That's all I can offer in this case.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 20th, 2009, 3:18 am 
Offline
User avatar

Joined: September 8th, 2008, 12:26 am
Posts: 1048
Location: Ploieşti, RO
Well, third time is the lucky one, they say. The flag change to 0x00CC0020 did the trick! However, an odd drawback: tooltips got disabled system-wide. :? Will get back to this issue later, gotta hit the sack now.
Thank you so much for all the help!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 20th, 2009, 6:30 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
Drugwash wrote:
The flag change to 0x00CC0020 did the trick!
FYI, in that case hDC_LW is redundant, whose purpose is to capture layered windows (LW stands for Layered Windows). The code would look like very similar to Zoomer() then.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 73 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: fusion1920, infogulch, Ragnar, Retro Gamer and 10 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