Search found 156 matches

by LinearSpoon
14 May 2014, 00:44
Forum: Scripts and Functions
Topic: A collection of small ahk functions
Replies: 78
Views: 43498

Re: A collection of small ahk functions

ScaleToFit Accepts the dimensions of a source rectangle and the dimensions of a destination rectangle. Returns the dimensions of the scaled source rectangle that fits within the destination rectangle, at the largest possible size and while maintaining aspect ratio. Also returns the x and y offsets ...
by LinearSpoon
14 May 2014, 00:32
Forum: Offtopic
Topic: « What's on your mind? »
Replies: 4491
Views: 1069813

Re: « What's on your mind? »

After seeing Poly's new front page and rolling my eyes, my thoughts turned to my own contribution to the community. I rarely post outside of support. Not to ask questions though, only to answer. I have little patience for simple requests, like how to create a hotkey that sends keystrokes in a loop. ...
by LinearSpoon
30 Apr 2014, 16:31
Forum: Ask For Help
Topic: While Loop without Sleep
Replies: 7
Views: 3829

Re: While Loop without Sleep

In the first, it will hit return and stop executing code (before the second loop iteration).
In the second, it continues until send_email_alert window can no longer be found, then it will stop.
by LinearSpoon
27 Apr 2014, 18:58
Forum: Ask For Help
Topic: DllCall msdn datatypes?
Replies: 9
Views: 3613

Re: DllCall msdn datatypes?

UPTR, UInt, etc were never given values, so you're essentially passing a blank string for each type parameter, which explains Errorlevel = -2.

Use the = operator to assign or use quotes to make them strings.
by LinearSpoon
27 Apr 2014, 18:26
Forum: Ask For Help
Topic: DllCall msdn datatypes?
Replies: 9
Views: 3613

Re: DllCall msdn datatypes?

Well you don't have negative memory addresses, so I guess it's technically unsigned, but it won't make a difference in the majority of scripts. It's also not supported in 64 bit AHK. http://ahkscript.org/docs/commands/DllCall.htm#ptr I would suggest "str" type for LPCTSTR and "wstr" for LPCWSTR, how...
by LinearSpoon
23 Apr 2014, 08:11
Forum: Ask For Help
Topic: Displayig different-level elements of an object
Replies: 6
Views: 2258

Re: Displayig different-level elements of an object

Commas in a variable are not considered parameter separators. You'll have to parse the address list yourself.

Code: Select all

ShowIt(Object, address)
{
  t := object
  Loop, parse, address, `,
   t := t[A_LoopField]
  msgbox % t
}
by LinearSpoon
17 Apr 2014, 10:32
Forum: Ask For Help
Topic: Gdip memory leak.
Replies: 4
Views: 2159

Re: Gdip memory leak.

STM_SETIMAGE returns a handle to the bitmap previously assigned to the control. DeleteObject(ErrorLevel) after SendMessage might fix it. You should use Gdip_DisposeImage with gdi+ bitmaps ("pBitmap") and DeleteObject with gdi bitmaps ("hBitmap").
by LinearSpoon
17 Apr 2014, 06:04
Forum: Offtopic
Topic: « What's on your mind? »
Replies: 4491
Views: 1069813

Re: « What's on your mind? »

Chrome keeps offering to translate autohotkey.com from arabic...

Image
by LinearSpoon
16 Apr 2014, 12:55
Forum: Wish List
Topic: Debugging.
Replies: 6
Views: 3104

Re: Debugging.

AHK implements DBGp for debugging, which specifies messages are passed with base64 encoding. source: http://xdebug.org/docs-dbgp.php#debugger-engine-to-ide-communications For example, your error decoded: Error in #include file "D:\AHK Studio Git\Projects\Untitled\Untitled3\flan.ahk": A control's var...
by LinearSpoon
11 Apr 2014, 07:44
Forum: Ask For Help
Topic: AHK Gui simulate drag and drop?
Replies: 10
Views: 4627

Re: AHK Gui simulate drag and drop?

I have used this before. This relies on an undocumented feature of Windows, so use at your own risk. There are also multiple ways of handling drag & drop, so this may work for some windows but not all. I do realize you want to drop a picture and not a list of files. Hint: Save the picture as a tempo...
by LinearSpoon
10 Apr 2014, 13:28
Forum: Ask For Help
Topic: Why "" is treated as negative number?
Replies: 6
Views: 2150

Re: Why "" is treated as negative number?

It's comparing them alphabetically. "" (ascii 0) < "0" (ascii 48)

http://www.autohotkey.com/docs/Variables.htm#Operators
by LinearSpoon
06 Apr 2014, 03:13
Forum: Ask For Help
Topic: [Solved]Name of Subclass
Replies: 2
Views: 1207

Re: Name of Subclass

If an key doesn't exist in an object, its __Get method is called. rty is not a key in qwe , so qwe.__Get("rty") is called. I believe this is what you're asking for, but I could be mistaken... class asd { __Call(p*) { Loop, % p.MaxIndex() MsgBox, % p[A_Index] ", Call" } __Set(p*) { Loop, % p.MaxIndex...
by LinearSpoon
29 Mar 2014, 21:01
Forum: Ask For Help
Topic: [SOLVED] How to create a 1x1 semi-transparent png?
Replies: 5
Views: 2212

Re: How to create a 1x1 semi-transparent png?

Pretty easy with gdip.ahk #Include gdip.ahk pToken := Gdip_startup() pBitmap := GetTransparentBitmap(0xFF4D00, 0.8) Gdip_SaveBitmapToFile(pBitmap, "trans.png") Gdip_shutdown(pToken) ;Accepts color in the form of 0xRRGGBB and transparency as a float in the range [0,1] ;Gdip must be started with Gdip_...
by LinearSpoon
24 Mar 2014, 14:48
Forum: Offtopic
Topic: « What's on your mind? »
Replies: 4491
Views: 1069813

Re: « What's on your mind? »

I just spent longer than I would like to admit trying to figure out why my program was telling me that 8*4 = 20...
Apparently I had cout set to hex output >.<
by LinearSpoon
24 Mar 2014, 10:16
Forum: Ask For Help
Topic: GDI+: Why the script fails when I repeat the action?
Replies: 29
Views: 8393

Re: GDI+: How to correct image height?

Try sleeping after scrolling down
by LinearSpoon
24 Mar 2014, 07:41
Forum: Ask For Help
Topic: GDI+: Why the script fails when I repeat the action?
Replies: 29
Views: 8393

Re: GDI+: How to correct image height?

Gdip_DisposeImage...
by LinearSpoon
24 Mar 2014, 01:47
Forum: Ask For Help
Topic: GDI+: Why the script fails when I repeat the action?
Replies: 29
Views: 8393

Re: GDI+: How to correct image height?

4 problems that I can see. 1. You passed "weight" instead of "width" to GdipDrawImageRectRect 2. You passed "newheight" instead of "height" (which stretches the bitmap across the entire joined bitmap vertically) 3. You create the graphics object from the screen DC instead of the memory DC 4. You pas...
by LinearSpoon
23 Mar 2014, 15:52
Forum: Ask For Help
Topic: GDI+: Why the script fails when I repeat the action?
Replies: 29
Views: 8393

Re: GDI+: How to correct image height?

pGraphics is not a bitmap of any sort. Once you finish drawing with it, you don't need it anymore. You haven't posted a recent copy of what you have, so I can only guess that the bitmap is still called "hBM". Think of the bitmap as a piece of paper. The graphics object is like the artist who takes b...
by LinearSpoon
23 Mar 2014, 14:22
Forum: Ask For Help
Topic: GDI+: Why the script fails when I repeat the action?
Replies: 29
Views: 8393

Re: GDI+: How to correct image height?

You selected a bitmap into a DC which you used to create the graphics object and did some drawing with it. That drawing affected the original bitmap you selected into the DC. You shouldn't need to convert anything; the final result is already in that bitmap. The only exception would be if you intend...

Go to advanced search