Search found 406 matches

by iseahound
09 Apr 2019, 23:06
Forum: Scripts and Functions
Topic: Direct2D
Replies: 2
Views: 433

Direct2D

Someone literally wrote a wrapper for Direct2D, and I can't figure out how to use it. d2d1.ahk class ID2D1Factory extends IUnknown { __new(p=""){ if (p=""){ DllCall("LoadLibrary","str","d2d1.dll") ,DllCall("d2d1\D2D1CreateFactory","uint",0,"ptr",GUID(CLSID,"{06152247-6f50-465a-9245-118bfd3b6007}"),"...
by iseahound
09 Apr 2019, 15:10
Forum: Ask For Help
Topic: Tool to diagnose why/where a long script is stuck?
Replies: 13
Views: 658

Re: Tool to diagnose why/where a long script is stuck?

Post code? We can't help you otherwise. I suggest using ListLines to see the last line of executed code, and Tooltip % A_ThisFunc on every function. You could also make a debug log, use FileAppend, % A_ThisFunc at the beginning of every function. Try double clicking the AHK icon and looking though t...
by iseahound
09 Apr 2019, 11:15
Forum: Ask For Help
Topic: EnvGet PATH output missing new variables? Topic is solved
Replies: 5
Views: 255

Re: EnvGet PATH output missing new variables? Topic is solved

Yes you need to refresh AutoHotkey's environment, specifically: RefreshEnvironment() { Path := "" PathExt := "" RegKeys := "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment,HKCU\Environment" Loop, Parse, RegKeys, CSV { Loop, Reg, %A_LoopField%, V { RegRead, Value If (A_LoopRegType =...
by iseahound
09 Apr 2019, 11:12
Forum: Ask For Help
Topic: Tool to diagnose why/where a long script is stuck?
Replies: 13
Views: 658

Re: Tool to diagnose why/where a long script is stuck?

You need to rewrite your code. Refactor and refactor. The fact that you have issues has nothing to do with any lack of diagnostic tools. But rather you need to step back, create a new file, and copy and paste the bits that work, look for patterns and abstract them into functions, then turn your func...
by iseahound
09 Apr 2019, 11:08
Forum: Announcements
Topic: Upcoming Ahk2Exe changes
Replies: 135
Views: 69360

Re: Upcoming Ahk2Exe changes

Have you ever messed with the commit tree, accidentally deleted too many commits, then ran a whole bunch of git commands to locate your lost code, given up, then re-cloned your whole commit tree from the origin, and now you're working across two versions to locate your lost code when you could have ...
by iseahound
09 Apr 2019, 10:57
Forum: AutoHotkey v2 Development
Topic: changing operators // and //= to only do integer or floor division
Replies: 12
Views: 1442

Re: changing operators // and //= to only do integer or floor division

I'm sorry but no integer division. It's not even useful, and seems to be a relic from back when we had to cast types. If anyone needs Float -> Int try one of these operators Ceil() , Round() , Floor() . I think Guido explained it well when he said that Floor division is linked to the modulo operator...
by iseahound
09 Apr 2019, 10:46
Forum: Ask For Help
Topic: How to use Capslock as a hotkey trigger?
Replies: 5
Views: 272

Re: How to use Capslock as a hotkey trigger?

Just google it... I wrote this a long time ago. CapsLock:: KeyWait, CapsLock ; wait for Capslock to be released KeyWait, CapsLock, D T0.2 ; and pressed again within 0.2 seconds if ErrorLevel return else if (A_PriorKey = "CapsLock") SetCapsLockState, % GetKeyState("CapsLock","T") ? "Off" : "On" retur...
by iseahound
08 Apr 2019, 12:27
Forum: Tips and Tricks
Topic: list of handy dll functions
Replies: 2
Views: 2618

Re: list of handy dll functions

very useful, thank you
by iseahound
05 Apr 2019, 11:16
Forum: Ask For Help
Topic: How to delete a SetTimer Object?
Replies: 3
Views: 198

Re: How to delete a SetTimer Object?

That is some hacker level code swagfag and Helgef. I wouldn't be surprised if you managed to weasel your way out of a time paradox with that type of thinking.
by iseahound
04 Apr 2019, 20:38
Forum: Ask For Help
Topic: "Clipboard :=" does not always empty the clipboard immediately Topic is solved
Replies: 33
Views: 1410

Re: "Clipboard :=" does not always empty the clipboard immediately Topic is solved

A sleep of 50 after sending ^v is standard. Seems to be a windows limitation.
by iseahound
04 Apr 2019, 20:35
Forum: Ask For Help
Topic: How to delete a SetTimer Object?
Replies: 3
Views: 198

How to delete a SetTimer Object?

In the reference for SetTimer there is an example called Second Counter. The default code for running the SecondCounter class is below. ; Example #4: Using a method as the timer subroutine. counter := new SecondCounter counter.Start() Sleep 5000 counter.Stop() Sleep 2000 ; An example class for count...
by iseahound
03 Apr 2019, 22:53
Forum: Scripts and Functions
Topic: Gdip_CreateBitmapFromHBITMAP() with transparency.
Replies: 0
Views: 194

Gdip_CreateBitmapFromHBITMAP() with transparency.

This is a snippet from a larger Graphics library I'm working on. Most people have been annoyed that the hBitmap -> Bitmap conversion doesn't support transparency, but this function does! Assume that image is the variable that is a handle to the bitmap (hBitmap). ; struct BITMAP - https://docs.micros...
by iseahound
03 Apr 2019, 18:07
Forum: Wish List
Topic: Given two numbers generate a number that is not one of the two numbers
Replies: 1
Views: 339

Given two numbers generate a number that is not one of the two numbers

A bit of an interesting puzzle. The most obvious solution would be to average the two numbers and add 1. But what's the best way to generate a unique looking number? For some background: Windows stores bitmaps top down or bottom up. So I'll be writing a short snippet that sets the top left pixel, an...
by iseahound
01 Apr 2019, 16:38
Forum: Wish List
Topic: Allow AutoHotkey to Handle Binary Data
Replies: 47
Views: 3280

Re: Allow AutoHotkey to Handle Binary Data

I made the fixes on the original post I made https://www.autohotkey.com/boards/viewtopic.php?f=13&t=61502&p=270761#p270761 Weird bug, looks like RtlCompareMemory is on ntdll.dll on pre-win10 systems, and is also part of user32.dll on windows 10. Regardless the original IsBitmapEqual() has been battl...
by iseahound
01 Apr 2019, 16:28
Forum: Wish List
Topic: Allow AutoHotkey to Handle Binary Data
Replies: 47
Views: 3280

Re: Allow AutoHotkey to Handle Binary Data

Are you on Windows 10? Does changing

Code: Select all

byte := DllCall("RtlCompareMemory", "ptr", bin1, "ptr", bin2, "uint", size)
to

Code: Select all

byte := DllCall("ntdll\RtlCompareMemory", "ptr", bin1, "ptr", bin2, "uint", size)
work?
by iseahound
01 Apr 2019, 16:23
Forum: Wish List
Topic: Allow AutoHotkey to Handle Binary Data
Replies: 47
Views: 3280

Re: Allow AutoHotkey to Handle Binary Data

Try this I didn't remove the dereference thing should have been "ptr" not "ptr*" VarSetCapacity(a, 16, 0) ; Fill 16 bytes with the number 0. VarSetCapacity(b, 16, 0) ; Fill 16 bytes with the number 0. NumPut(13, b, 3, "UChar") ; Set the 2nd bit of b to 13 MsgBox % isBinaryEqual(&a, &b, 16) ; false (...
by iseahound
01 Apr 2019, 16:10
Forum: Wish List
Topic: Allow AutoHotkey to Handle Binary Data
Replies: 47
Views: 3280

Re: Allow AutoHotkey to Handle Binary Data

My bad I forgot that AutoHotkey makes copies of the variables when they are delivered to a function and that meant that the null termination was in effect and truncated the string from VarSetCapacity() . The solution was to pass the pointers/addresses directly as I did below, or to use a ByRef varia...
by iseahound
01 Apr 2019, 15:42
Forum: Wish List
Topic: Allow AutoHotkey to Handle Binary Data
Replies: 47
Views: 3280

Re: Allow AutoHotkey to Handle Binary Data

VarSetCapacity(a, 16, 1) ; Fill 16 bytes with the number 1. VarSetCapacity(b, 16, 1) ; Fill 16 bytes with the number 1. MsgBox % isBinaryEqual(a, b, 16) ; true (1) VarSetCapacity(a, 16, 1) ; Fill 16 bytes with the number 1. VarSetCapacity(b, 16, 2) ; Fill 16 bytes with the number 2. MsgBox % isBina...
by iseahound
01 Apr 2019, 15:23
Forum: General Discussion
Topic: your personal AutoHotkey style guide
Replies: 79
Views: 8729

Re: your personal AutoHotkey style guide

1. De Morgan's Rule - which one? if (!w || !h) ; Do stuff or if !(w && h) ; Do stuff 2. Negation - inside the parenthesis or outside the parenthesis? This has bothered me for the longest time. if (!str) ; Do stuff or if !(str) ; Do stuff I'm not interested in a argument based on "it looks better". I...
by iseahound
01 Apr 2019, 15:04
Forum: Wish List
Topic: Allow AutoHotkey to Handle Binary Data
Replies: 47
Views: 3280

Re: Allow AutoHotkey to Handle Binary Data

Is it too hard to handle the binary data manually? Binary data comes in two forms managed and un-managed. If you are using un-managed code there is no reason to complain about lack of binary support, use the low-level functions. If you are using managed code then stick with the managed framework. Wh...

Go to advanced search