Search found 18 matches

by kkleinfelter
23 Sep 2019, 07:53
Forum: Scripts and Functions
Topic: hWnd_to_hBmp() : Capture full screen, Window, Control or user defined area of these
Replies: 13
Views: 1324

Re: hWnd_to_hBmp() : Capture full screen, Window, Control or user defined area of these

My solution was to combine WinGetPosEx and ClientToWin. ClientToWin addressed the bulk of the big black strip, and WinGetPosEx addressed the remaining sliver. As a reminder, my complaint was NOT about the stripe itself, but about being able to identify an 'accurate' XY coordinate within the screensh...
by kkleinfelter
18 Sep 2019, 14:24
Forum: Scripts and Functions
Topic: hWnd_to_hBmp() : Capture full screen, Window, Control or user defined area of these
Replies: 13
Views: 1324

Re: hWnd_to_hBmp() : Capture full screen, Window, Control or user defined area of these

OK. I think I've got a similar, but not identical problem. I understand the Aero changes to the title bar and the width of the shadow around the window accounts for the narrow black stripe, but when I turn off the Address Bar in IE, I get a *big* black stripe at the bottom of the window. The narrow ...
by kkleinfelter
17 Sep 2019, 11:50
Forum: Ask For Help
Topic: Dark Band Around GDI+ Screenshot
Replies: 2
Views: 180

Dark Band Around GDI+ Screenshot

When I take a screenshot of a File Explorer window using GDI+, the title bar come out with a black background, although the icons are rendered properly. My real File Explorer window has white background. The status bar and the scroll bar also come out black. Attached image shows the title bar. The b...
by kkleinfelter
15 Sep 2019, 15:13
Forum: Ask For Help
Topic: Process Left-click AFTER the Active Window Change
Replies: 3
Views: 201

Re: Process Left-click AFTER the Active Window Change

I gave up on directly getting click coordinates relative to the *clicked* (not the active) window. My 'solution' was to get the coordinates in *screen* mode, get the origin of the window the mouse is over (in screen mode), and subtract the window origin from the mouse position. i.e. I calculated the...
by kkleinfelter
10 Sep 2019, 14:22
Forum: Ask For Help
Topic: Process Left-click AFTER the Active Window Change
Replies: 3
Views: 201

Re: Process Left-click AFTER the Active Window Change

No, that still isn't working. I keep getting negative values for X or Y. I'm clearly not getting the X/Y coordinate relative to the clicked window because I'm clicking in the window and I'm getting things like -400
by kkleinfelter
10 Sep 2019, 14:03
Forum: Ask For Help
Topic: Process Left-click AFTER the Active Window Change
Replies: 3
Views: 201

Re: Process Left-click AFTER the Active Window Change

Well, the best I can come up with is the following. Is there a better way? Is there a drawback to my method I should be aware of?

Code: Select all

    CoordMode, Mouse, Window
    MouseGetPos, mx, my, buttonHwnd
    WinActivate, ahk_id %buttonHwnd%
    MouseGetPos, mx, my, buttonHwnd
by kkleinfelter
10 Sep 2019, 13:28
Forum: Ask For Help
Topic: Process Left-click AFTER the Active Window Change
Replies: 3
Views: 201

Process Left-click AFTER the Active Window Change

When I ~lbutton:: CoordMode, Mouse, Window MouseGetPos, mx, my, buttonHwnd and the user clicks on a window other than the active window, the x, y, and hwnd are for the window which is losing focus and not the window which was clicked on. At least sometimes. This *is* what the doc says: "Relative: Co...
by kkleinfelter
09 Sep 2019, 14:53
Forum: Ask For Help
Topic: Any way to make #warn only check the current script (without #include file)?
Replies: 3
Views: 451

Re: Any way to make #warn only check the current script (without #include file)?

Sort of... I put all of my #include at the bottom of my script. Immediately before the first #include, I place "#warn All, Off". It seems to have the desired effect.
by kkleinfelter
29 Aug 2019, 12:17
Forum: Ask For Help
Topic: IE Visible Without Active With COM
Replies: 2
Views: 206

IE Visible Without Active With COM

When I execute the following code, IE is launched, made visible, and the IE window is ACTIVATED. Is there a way to make it visible without activating it? wb := ComObjCreate("InternetExplorer.Application") wb.visible := true Yuck! It looks like this activates IE too. Is it possible to automate IE wit...
by kkleinfelter
19 Aug 2019, 07:55
Forum: Ask For Help
Topic: Cast COM Object IWebBrowser2 to IServiceProvider
Replies: 3
Views: 384

Re: Cast COM Object IWebBrowser2 to IServiceProvider

Thank you to both of you. Clearly, calling ControlGet is the right thing to do in this particular case, but knowing how to cast COM objects will definitely come in handy.
by kkleinfelter
16 Aug 2019, 14:35
Forum: Ask For Help
Topic: Cast COM Object IWebBrowser2 to IServiceProvider
Replies: 3
Views: 384

Cast COM Object IWebBrowser2 to IServiceProvider

I need to cast an IWebBrowser2 to an IServiceProvider, then to an IOleWindow; then call GetWindow on the IOleWindow. I have an IWebBrowser2 object (named win) for an IE tab, but calling wind.HWND returns the handle for the main frame window and not the tab. (This was by design, per Microsoft, for 'm...
by kkleinfelter
26 Jan 2019, 16:08
Forum: Ask For Help
Topic: But ImageSearch of ScreenPrint Works!
Replies: 8
Views: 596

Re: But ImageSearch of ScreenPrint Works!

CAPTUREBLT fixed it. (CAPTUREBLT = 0x00CC0020 | 0x40000000) It's been a while since I did coding at the level of BitBlt. If I understand correctly, the simplified explanation amounts to Gdip_BitmapFromScreen() will capture the whole screen if you have simple windows Upgrade to Gdip_BitmapFromScreen(...
by kkleinfelter
24 Jan 2019, 13:38
Forum: Ask For Help
Topic: But ImageSearch of ScreenPrint Works!
Replies: 8
Views: 596

Re: But ImageSearch of ScreenPrint Works!

I saved the PrintScreen bitmap and the Gdip_BitmapFromScreen bitmap to disk. The PrintScreen image shows the screen as I see it on the monitor. The Gdip image is missing the entire window of interest. The window is simply invisible to Gdip!
by kkleinfelter
24 Jan 2019, 13:30
Forum: Ask For Help
Topic: But ImageSearch of ScreenPrint Works!
Replies: 8
Views: 596

Re: But ImageSearch of ScreenPrint Works!

OK. This is really weird. I switched to using GDIP. The search call looks like this: RET := Gdip_ImageSearch(bmpHaystack,bmpNeedle,LIST, 0,0,hWidth,hHeight) If I set bmpHaystack with this code: send ^{PrintScreen} bmpHaystack := Gdip_CreateBitmapFromClipboard() it finds the image successfully. But i...
by kkleinfelter
23 Jan 2019, 16:29
Forum: Ask For Help
Topic: But ImageSearch of ScreenPrint Works!
Replies: 8
Views: 596

But ImageSearch of ScreenPrint Works!

I run an ImageSearch with an image plainly visible on the screen, and ImageSearch fails to find it. OK. I must be doing it wrong. But, I can screenprint that same visible image and paste it into MS Paint, and the same Imagesearch finds it. CoordMode, Pixel, Screen CoordMode, Mouse, Screen Image = e:...
by kkleinfelter
30 Dec 2018, 12:04
Forum: Scripts and Functions
Topic: Sort dense arrays or matrices
Replies: 5
Views: 2160

Re: Sort dense arrays or matrices

Looks like maybe this fixes the code so that Example 1 works:

Code: Select all

; BUG FIX - KPK
;	Loop % ComprM {
    LOOP % LenM {
by kkleinfelter
30 Dec 2018, 11:52
Forum: Scripts and Functions
Topic: Sort dense arrays or matrices
Replies: 5
Views: 2160

Re: Sort dense arrays or matrices

Hmmm... When I run the first example, I get

Code: Select all

1,2,3,4,5
Butterfly,Cat,Animal,Zebra,Elephant
B,C,A,Z,E
I'd really like to be able to sort those additional arrays.
by kkleinfelter
21 Dec 2018, 11:15
Forum: Ask For Help
Topic: Export a Bitmap Out of GDI Into Memory
Replies: 4
Views: 456

Export a Bitmap Out of GDI Into Memory

I need to export a bitmap out of GDI into memory. I have a need to save an image once a second. My disk can't keep up, so I can't save the image to a file. Later on, something unusual might happen. It happens infrequently (less than once an hour). IF that event happens, then I need to take the curre...

Go to advanced search