Search found 1906 matches

by FanaticGuru
29 Apr 2023, 19:46
Forum: Scripts and Functions (v2)
Topic: Snipper - Window Snipping Tool
Replies: 125
Views: 26762

Re: Snipper - Window Snipping Tool

Snipper - Extensions Snipper - Extension - Acrobat This is an Adobe Acrobat extension for Snipper that adds an item to the context menu of a snipped image that allows for the image to be sent by the clipboard to Adobe Acrobat to create a PDF. ; Snipper - Extension - Acrobat Extensions.Push({ Acroba...
by FanaticGuru
25 Apr 2023, 12:01
Forum: Ask for Help (v2)
Topic: Create Properties Automatically as Needed for Object Topic is solved
Replies: 2
Views: 383

Re: Create Properties Automatically as Needed for Object Topic is solved

@FanaticGuru, Would this do it? ObjectDefault() ObjectDefault() => Object.Prototype.DefineProp('__Get', {Call: (this, Name, Params) => this.%Name% := {}}) MyObj := Object() MyObj.One := 1 MsgBox MyObj.One MyObj.Two.Three := 23 MsgBox MyObj.Two.Three MyObj.Four.Five.Six := 456 MsgBox MyObj.Four.Five...
by FanaticGuru
24 Apr 2023, 15:48
Forum: Ask for Help (v2)
Topic: Create Properties Automatically as Needed for Object Topic is solved
Replies: 2
Views: 383

Create Properties Automatically as Needed for Object Topic is solved

I have this script that creates a default value for an object. ObjectDefault() ObjectDefault() { Object.Prototype.DefineProp('__Get', { Call: __Get_Default }) Object.Prototype.DefineProp('Default', { Set: Set_Default, Get: Get_Default }) Set_Default(this, DefaultValue) { this.DefaultValue := Default...
by FanaticGuru
24 Apr 2023, 14:50
Forum: Tips and Tricks
Topic: A caution about combining Gui.Add and onEvent functions
Replies: 5
Views: 2039

Re: A caution about combining Gui.Add and onEvent functions

Single line and single expression: (RA := main.addRadio("vTesting", "Test1")).onEvent("Click", React) ;here RA = the GuiCtrl object for the added radio button) That seems pretty good. I am surprised I have not seen it or thought of it myself. Makes for kind of long lines but I like having a control...
by FanaticGuru
23 Apr 2023, 17:30
Forum: Scripts and Functions (v1)
Topic: AHK Startup (Consolidate AHK Scripts' Tray Icons)
Replies: 115
Views: 73432

Re: AHK Startup (Consolidate AHK Scripts' Tray Icons)

Just curious if there are plans to port this over to v2? I was thinking of doing it myself, but want to see if (the more skilled) author or members were planning to. The v1 version can start both v1 and v2 scripts if the flags are set to tell it which version to use for each script. But even though...
by FanaticGuru
23 Apr 2023, 17:19
Forum: Scripts and Functions (v2)
Topic: Snipper - Window Snipping Tool
Replies: 125
Views: 26762

Re: Snipper - Window Snipping Tool

However I noticed some problems with the advanced selection. The window when moved does not always capture the right position (after pressing the enter key) :think: . I corrected the problem by adding this fix to line 269: guiSSR.GetPos(&x, &y, &w, &h) ; <--- the fix guiSSR.Hide() Return { X: X, Y:...
by FanaticGuru
21 Apr 2023, 12:32
Forum: Tips and Tricks
Topic: A caution about combining Gui.Add and onEvent functions
Replies: 5
Views: 2039

Re: A caution about combining Gui.Add and onEvent functions

Can’t you just loop over the GUI object to loop through the controls? That is true. That was a poor example. The main take away is that a Gui object is still very much like a standard object in that other objects can be nested inside it. Whether they are other gui, gui controls, maps, arrays, prope...
by FanaticGuru
20 Apr 2023, 19:41
Forum: Tips and Tricks
Topic: A caution about combining Gui.Add and onEvent functions
Replies: 5
Views: 2039

Re: A caution about combining Gui.Add and onEvent functions

Combining Gui.Add() and onEvent() functions on a single line is appealing as a programming technique (see below). However, this can lead to unexpected issues. .OnEvent on the end looked cool when I first saw it but I pretty much never do it now unless the script is really simple. You can do this if...
by FanaticGuru
20 Apr 2023, 16:44
Forum: Scripts and Functions (v2)
Topic: Snipper - Window Snipping Tool
Replies: 125
Views: 26762

Re: Snipper - Window Snipping Tool

Updated in First Post Change Log: 2023 04 20 Borders are now created with Gui controls which eliminated the need for many GDIp functions. I was running into serious problems with GDIp which I believe could be solved with WS_EX_NOREDIRECTIONBITMAP suggestion from malcev but I had already rewritten a...
by FanaticGuru
20 Apr 2023, 15:47
Forum: Scripts and Functions (v2)
Topic: Snipper - Window Snipping Tool
Replies: 125
Views: 26762

Re: Snipper - Window Snipping Tool

PrintWindow with PW_RENDERFULLCONTENT flag on win11 does not work. May be microsoft changed something. I tested and see that it will work if We add WS_EX_NOREDIRECTIONBITMAP style to our gui. Very nice find! It does appear to fix the problem with my limited testing. This basic script now works. ; C...
by FanaticGuru
19 Apr 2023, 20:06
Forum: Scripts and Functions (v2)
Topic: Snipper - Window Snipping Tool
Replies: 125
Views: 26762

Re: Snipper - Window Snipping Tool

You should not call hdc := GetDC(Hwnd) hdc should be saved after creating. Therefore I wrote that if it is not Your process, You need to inject and hook. Yes, it does work if I save the hdc. And don't SelectObject(hdc, obm) or DeleteDC(hdc) . I was trying to avoid keeping a log of every Gui. I had ...
by FanaticGuru
19 Apr 2023, 19:29
Forum: Scripts and Functions (v2)
Topic: Snipper - Window Snipping Tool
Replies: 125
Views: 26762

Re: Snipper - Window Snipping Tool

Algorithm can be like this:: hCaptureDC := CreateCompatibleDC(hdc) hCaptureBitmap := CreateCompatibleBitmap(hdc, width, height) SelectObject(hCaptureDC, hCaptureBitmap) BitBlt(hCaptureDC, 0, 0, width, height, hdc, 0, 0) pBitmap := Gdip_CreateBitmapFromHBITMAP(hCaptureBitmap) Works for typical Gui b...
by FanaticGuru
19 Apr 2023, 18:15
Forum: Scripts and Functions (v2)
Topic: Snipper - Window Snipping Tool
Replies: 125
Views: 26762

Re: Snipper - Window Snipping Tool

That version of gdi+ hasn't been updated in ages. Does the show window script I posted still work? Is it the window styles? If you want to test your theory set the scale (variable s) to something other than 1 in my script. Then it will use GDI+ pGraphics to scale the object. You script works regard...
by FanaticGuru
19 Apr 2023, 17:40
Forum: Scripts and Functions (v2)
Topic: Snipper - Window Snipping Tool
Replies: 125
Views: 26762

Re: Snipper - Window Snipping Tool

FanaticGuru , why do You want to get screenshot for Your own window with PrintWindow, but not with BitBlt? PrintWindow with PW_RENDERFULLCONTENT flag on win11 does not work. May be microsoft changed something. Yea, I have about concluded that something changed with PW_RENDERFULLCONTENT and PrintWin...
by FanaticGuru
19 Apr 2023, 13:40
Forum: Scripts and Functions (v2)
Topic: Snipper - Window Snipping Tool
Replies: 125
Views: 26762

Re: Snipper - Window Snipping Tool

the PW_RENDERFULLCONTENT flag was introduced on win8.1, and it usually only comes into play on hardware accelerated windows, such as those with Chrome based window classes (like Chrome itself and ElectronJS apps like Skype). on many normal windows, it has no effect and is not needed, if i remember ...
by FanaticGuru
19 Apr 2023, 02:54
Forum: Scripts and Functions (v2)
Topic: Snipper - Window Snipping Tool
Replies: 125
Views: 26762

Re: Snipper - Window Snipping Tool

You need to use something like this: since he's already using GDIP, he can just migrate the GdipBitmapFromHwnd() func, which calls PrintWindow. just need to add that -3 flag which the gdip lib omits Man, I am really confused now. I just tried GdipBitmapFromHwnd() on an older computer because everyo...
by FanaticGuru
19 Apr 2023, 01:59
Forum: Scripts and Functions (v2)
Topic: Snipper - Window Snipping Tool
Replies: 125
Views: 26762

Re: Snipper - Window Snipping Tool

Another alternative is to put the pBitmap into the GWL_USERDATA field of the window. You can store exactly one pointer there (and if you need more, you can GlobalAlloc your own memory and free it, or store the pointer of an AutoHotkey Buffer Object). You seem to collect the windows in an array in y...
by FanaticGuru
18 Apr 2023, 10:27
Forum: Scripts and Functions (v2)
Topic: Snipper - Window Snipping Tool
Replies: 125
Views: 26762

Re: Snipper - Window Snipping Tool

run tic's tutorials and find out. Yeah, it happens with tic's tutorials as well. All of my functions are just derivatives of tic's Gdip work. No wonder I could not find a solution to getting the bitmap, it was not so much a problem with my method for getting the bitmap, it was more a problem of how...
by FanaticGuru
17 Apr 2023, 20:09
Forum: Scripts and Functions (v2)
Topic: Snipper - Window Snipping Tool
Replies: 125
Views: 26762

Re: Snipper - Window Snipping Tool

Need to see about getting a bitmap from a layered window that is not fully displayed because something is on top of it or off screen. Or storing a copy of the bitmaps separate from the window. Yeah same issue here. The images when I save to file are all cropped with black borders: You need to use s...
by FanaticGuru
17 Apr 2023, 20:04
Forum: Ask for Help (v2)
Topic: Get Bitmap of Layered Window Gui
Replies: 2
Views: 281

Get Bitmap of Layered Window Gui

Say I have a Gui that has the flag 0x80000 which makes it a layered window and then I put a bitmap into that Gui to make a nice little picture Gui, ie like my Snipper script: https://www.autohotkey.com/boards/viewtopic.php?f=83&t=115622 Now how do I get the bitmap back out of that Gui layered window...

Go to advanced search