 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Drugwash
Joined: 08 Sep 2008 Posts: 608 Location: Ploiesti, RO
|
Posted: Thu Jun 18, 2009 4:15 pm Post subject: |
|
|
If it's good code, I think it's worth updating every once in a blue moon.
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!  |
|
| Back to top |
|
 |
tidbit
Joined: 10 Mar 2008 Posts: 674 Location: USA
|
Posted: Thu Jun 18, 2009 5:46 pm Post subject: |
|
|
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 affraid
*poke*
Note: My name is all lowercase for a reason. |
|
| Back to top |
|
 |
Drugwash
Joined: 08 Sep 2008 Posts: 608 Location: Ploiesti, RO
|
Posted: Thu Jun 18, 2009 11:01 pm Post subject: |
|
|
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.  |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 2195
|
Posted: Fri Jun 19, 2009 12:14 am Post subject: |
|
|
| 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(). |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 2195
|
Posted: Fri Jun 19, 2009 12:17 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
Drugwash
Joined: 08 Sep 2008 Posts: 608 Location: Ploiesti, RO
|
Posted: Fri Jun 19, 2009 12:33 am Post subject: |
|
|
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. Will keep performing tests, maybe something good will eventually come out. |
|
| Back to top |
|
 |
tidbit
Joined: 10 Mar 2008 Posts: 674 Location: USA
|
Posted: Fri Jun 19, 2009 3:26 am Post subject: |
|
|
| 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 affraid
*poke*
Note: My name is all lowercase for a reason. |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 2195
|
Posted: Fri Jun 19, 2009 4:58 am Post subject: |
|
|
| 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") |
|
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 2195
|
Posted: Fri Jun 19, 2009 5:18 am Post subject: |
|
|
| 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? |
|
| Back to top |
|
 |
Drugwash
Joined: 08 Sep 2008 Posts: 608 Location: Ploiesti, RO
|
Posted: Fri Jun 19, 2009 7:43 am Post subject: |
|
|
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!  |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 2195
|
Posted: Fri Jun 19, 2009 10:08 am Post subject: |
|
|
| 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
|
|
|
| Back to top |
|
 |
Drugwash
Joined: 08 Sep 2008 Posts: 608 Location: Ploiesti, RO
|
Posted: Fri Jun 19, 2009 4:21 pm Post subject: |
|
|
Ugh, I was too tired and it showed. 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.  |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 2195
|
Posted: Sat Jun 20, 2009 12:32 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
Drugwash
Joined: 08 Sep 2008 Posts: 608 Location: Ploiesti, RO
|
Posted: Sat Jun 20, 2009 3:18 am Post subject: |
|
|
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! |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 2195
|
Posted: Sat Jun 20, 2009 6:30 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|