Search found 156 matches

by LinearSpoon
23 Mar 2014, 13:09
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?

add bitmap from file to the graphics; command has 2nd argument source bitmap and third argument destination graphics: GpStatus WINGDIPAPI GdipDrawImageRectRect(GpGraphics *graphics, GpImage *image, REAL dstx, REAL dsty, REAL dstwidth, REAL dstheight, REAL srcx, REAL srcy, REAL srcwidth, REAL srchei...
by LinearSpoon
22 Mar 2014, 13:30
Forum: Ask For Help
Topic: GDI+: Why the script fails when I repeat the action?
Replies: 29
Views: 8393

Re: GDI: How to join images together?

To answer your problem: CaptureScreen works when it calls ImageConvert because you pass a GDI bitmap. JoinFiles fails when it calls ImageConvert because you pass a GDIP bitmap. I'm not sure why you think you're gaining by cutting parts out of Gdip.ahk to write your own functions out of, especially w...
by LinearSpoon
21 Mar 2014, 18:47
Forum: Ask For Help
Topic: GDI+: Why the script fails when I repeat the action?
Replies: 29
Views: 8393

Re: GDI: How to join images together?

I feel like much of this is copy & pasted without actually understanding what the code does. The first half of the function is a mystery to me. You take a screenshot, free the DCs used, then try to create a graphics handle from a released DC. Meanwhile you have a bitmap hanging around doing nothing....
by LinearSpoon
21 Mar 2014, 07:27
Forum: Ask For Help
Topic: !pToken gdiplus
Replies: 3
Views: 1779

Re: !pToken gdiplus

Even if an invalid token is passed to Gdip shutdown (which it is, because pToken in ReloadGdip() is local and is a blank string), it still frees the library. This alone shouldn't be enough to cause an error. The real problem is probably that your script is leaking something such a bitmap or brush. T...
by LinearSpoon
17 Mar 2014, 10:55
Forum: Offtopic
Topic: Where Does Google Get Its List Of Urls To Spider
Replies: 8
Views: 3308

Re: Where Does Google Get Its List Of Urls To Spider

What part don't you get? It's all stated in the links. When it crawls the sites it does know about, it finds links to new sites that it doesn't know about. Webmasters may also submit sitemaps to augment this process. If you register a new site, Google won't find it until people start linking to it, ...
by LinearSpoon
16 Mar 2014, 11:24
Forum: Ask For Help
Topic: select a file in a folder
Replies: 7
Views: 2262

Re: select a file in a folder

While "just click it" is an appropriate answer for the question as it's worded, one has to assume that the original poster is not an idiot and can figure that out for himself. My interpretation would be that he wants to know if it's possible to programmatically select a file in an open explorer wind...
by LinearSpoon
16 Mar 2014, 11:17
Forum: Ask For Help
Topic: Illegal character problems
Replies: 5
Views: 2878

Re: Illegal character problems

Without testing, my best guess is that AHK doesn't like your % signs (it thinks you're trying to use %var%). Try escaping them like `%. At the same time, I don't really know what it's supposed to do so that may not actually be what you need.
by LinearSpoon
15 Mar 2014, 17:00
Forum: Offtopic
Topic: Rosetta Code
Replies: 216
Views: 61078

Re: Rosetta Code

You may add it; I do not have an account with the site.
by LinearSpoon
15 Mar 2014, 16:21
Forum: Offtopic
Topic: Rosetta Code
Replies: 216
Views: 61078

Re: Rosetta Code

Apparently this task was decided inappropriate for AutoHotkey (perhaps an older version?), but it's certainly possible now... class example { foo() { Msgbox Called example.foo() } __Call(method, params*) { funcRef := Func(funcName := this.__class "." method) if !IsObject(funcRef) { str := "Called un...
by LinearSpoon
13 Mar 2014, 21:11
Forum: Ask For Help
Topic: Help with transition to v2 - InStr()
Replies: 5
Views: 2200

Re: Help with transition to v2 - InStr()

I've tested on Win7 64 bit and Win8.1 64 bit, both are working correctly.

Assuming the executable is up to date and not corrupted somehow, the only thing that would cause that error is if you redefined InStr somewhere else in the script. Specifically if you redefined it with fewer than 4 parameters.
by LinearSpoon
13 Mar 2014, 17:06
Forum: Ask For Help
Topic: Help with transition to v2 - InStr()
Replies: 5
Views: 2200

Re: Help with transition to v2 - InStr()

It works fine for me with the latest v2 version.
by LinearSpoon
12 Mar 2014, 15:53
Forum: Ask For Help
Topic: Help me to interact with Device manager window Topic is solved
Replies: 2
Views: 1674

Re: Help me to interact with Device manager window Topic is solved

Windows is simply blocking your script's keystrokes from "driving" a system/potentially dangerous interface. The workaround is to run the script with administrator privileges. if not A_IsAdmin { Run, *RunAs "%A_ScriptFullPath%" ExitApp } Run, devmgmt.msc WinWait Device Manager ControlSend, SysTreeVi...
by LinearSpoon
10 Mar 2014, 16:20
Forum: Offtopic
Topic: How Can Rockets Travel To The Moon, If MoonTravels at 6mKPM
Replies: 36
Views: 15377

Re: How Can Rockets Travel To The Moon, If MoonTravels at 6m

@ trismarck , I'm afraid I don't understand your reference, but I do realize there is a joke there. @ Sjc1000 , regarding the car & headlights question: If you believe Einstein's theory of special relativity, the answer is A. There's no reason you shouldn't believe the theory, it has been experiment...
by LinearSpoon
08 Mar 2014, 06:50
Forum: Offtopic
Topic: How Can Rockets Travel To The Moon, If MoonTravels at 6mKPM
Replies: 36
Views: 15377

Re: How Can Rockets Travel To The Moon, If MoonTravels at 6m

It's supposed to be a smooth curve. It was a quick drawing done with paint and isn't meant to be a perfect representation of what's going on.
by LinearSpoon
07 Mar 2014, 21:56
Forum: Ask For Help
Topic: [SOLVED] Translate C to AHK
Replies: 4
Views: 1988

Re: Translate C to AHK

That C code doesn't actually compile (no include files, compiler may complain about lack of types), but I believe I understand the point of it - to be a ROT13 translator. Gui, Add, Edit, w300 h100 vInput gUpdate, Type your input here Gui, Add, Edit, w300 h100 vOutput +ReadOnly Gui, Show GuiControl, ...
by LinearSpoon
07 Mar 2014, 02:30
Forum: Ask For Help
Topic: Using Windows key + number as hot key
Replies: 2
Views: 1354

Re: Using Windows key + number as hot key

Something in the included file is ending the auto-execute section, but that should have no effect on hotkey definitions...unless the included file has a #If condition which would carry through to the hotkey definitions in the main script, or unless the hotkeys were set using the hotkey command inste...
by LinearSpoon
06 Mar 2014, 23:44
Forum: Ask For Help
Topic: Random distribution of images without overlaps
Replies: 5
Views: 1550

Re: Random distribution of images without overlaps

Numbers are skipped here:

Code: Select all

      if (xpos > A_screenwidth /2 and ypos < A_screenheight /2)
      continue 2
Try continue (with no number) instead. Also, the sleep was only there to slow the algorithm down enough to be seen, it's not necessary.
by LinearSpoon
06 Mar 2014, 01:24
Forum: Ask For Help
Topic: Random distribution of images without overlaps
Replies: 5
Views: 1550

Re: Random distribution of images without overlaps

Here is a working example that places 150 circles in a 600x600 window with no overlaps. Note that if you try to place too many circles in too small of an area, this algorithm will go into an infinite loop looking for a place for more circles...but that's easily avoided. xmin := 0 xmax := 600 ymin :=...
by LinearSpoon
04 Mar 2014, 12:36
Forum: Offtopic
Topic: « What's on your mind? »
Replies: 4493
Views: 1070183

Re: « What's on your mind? »

The metric system has some oddities as well, I mean: Why is the meter defined as the distance light travels in 1/299792458th of a second? So much for round numbers... Why is the base unit of mass kilograms instead of grams? As a side note, the imperial system is a bit more widespread than the map wo...
by LinearSpoon
22 Feb 2014, 18:05
Forum: Ask For Help
Topic: Best way avoiding error. Function definition after label.
Replies: 3
Views: 2042

Re: Best way avoiding error. Function definition after label

Functions are resolved to pointers at startup... The proximity of the function definition to the point where it is called has no effect on performance. Just define your functions at the end of the script or in a #include file. The best performance would be actually be achieved by removing the goto e...

Go to advanced search