It turned out that this variant has even better performance. But the one I gave also gives you a better idea of how negative numbers are organized in memory.
Search found 4311 matches
- Today, 11:54
- Forum: Ask for Help (v2)
- Topic: How to obtain the memory address of a variable in AutoHotkey v2?
- Replies: 23
- Views: 691
- Today, 11:42
- Forum: Ask for Help (v2)
- Topic: GDI+ Gui Pic Issue Topic is solved
- Replies: 6
- Views: 157
Re: GDI+ Gui Pic Issue Topic is solved
I too assumed that in a real BITMAP example, it would be more complicated.
No, it's not necessary in this case:
Code: Select all
wnd := Gui()
wnd.MarginX := wnd.MarginY := 0
wnd.AddText('w300 h200 BackgroundFF8100')
wnd.AddPicture('yp wp hp Background057D9F')
wnd.Show()
- 27 Mar 2024, 17:27
- Forum: Ask for Help (v2)
- Topic: GDI+ Gui Pic Issue Topic is solved
- Replies: 6
- Views: 157
Re: GDI+ Gui Pic Issue Topic is solved
It could be like this: #Requires AutoHotkey v2 wnd := Gui('Resize') wnd.MarginX := wnd.MarginY := 0 wnd.AddPicture(, 'HBITMAP: ' . CreateBitmap(300, 300, 0xFFFFAA00)) wnd.Show() CreateBitmap(w, h, colorARGB) { #DllLoad Gdiplus static PixelFormat32bppARGB := 0x26200A NumPut('Int', 1, GdiplusStartupIn...
- 26 Mar 2024, 13:18
- Forum: Ask for Help (v2)
- Topic: How to obtain the memory address of a variable in AutoHotkey v2?
- Replies: 23
- Views: 691
Re: How to obtain the memory address of a variable in AutoHotkey v2?
Guys, maybe I don't understand something obvious, but there is a classical way to convert an unsigned number into a signed one: check the high bit, if it is equal to one, then invert all bits, add one and change the sign. ushortNum := 64759 shortNum := ushortNum >> 15 ? -((ushortNum ^ 0xFFFF) + 1) :...
- 24 Mar 2024, 19:00
- Forum: Ask for Help (v2)
- Topic: Help with ComObject("Msxml2.XMLHTTP") Topic is solved
- Replies: 5
- Views: 126
Re: Help with ComObject("Msxml2.XMLHTTP") Topic is solved
https://pokeapi.co/api/v2/1
Perhaps this URL is invalid. Maybe https://pokeapi.co/api/v2/pokemon/1 ?
Perhaps this URL is invalid. Maybe https://pokeapi.co/api/v2/pokemon/1 ?
- 24 Mar 2024, 17:51
- Forum: Ask for Help (v2)
- Topic: Help with ComObject("Msxml2.XMLHTTP") Topic is solved
- Replies: 5
- Views: 126
Re: Help with ComObject("Msxml2.XMLHTTP") Topic is solved
It should be like this: Persistent class requests { __New() { this.req := ComObject("Msxml2.XMLHTTP.6.0") this.req.onreadystatechange := ObjBindMethod(this, "ready") } get(url) { this.req.open("GET", url, true) this.req.send() } ready() { if (this.req.readyState != 4) return if (this.req.status == 2...
- 24 Mar 2024, 17:22
- Forum: Ask for Help (v2)
- Topic: Help with ComObject("Msxml2.XMLHTTP") Topic is solved
- Replies: 5
- Views: 126
Re: Help with ComObject("Msxml2.XMLHTTP") Topic is solved
#Requires AutoHotkey v2.0 Persistent requests().get("https://pokeapi.co/api/v2/pokemon/1") class requests { __New() { this.req := ComObject("Msxml2.XMLHTTP") } get(url) { this.req.onreadystatechange := ObjBindMethod(this, 'ready') this.req.open("GET", url, true) this.req.send() } ready() { if this....
- 22 Mar 2024, 11:14
- Forum: Ask for Help (v1)
- Topic: script help: minimize to icon in system tray
- Replies: 16
- Views: 3250
Re: script help: minimize to icon in system tray
Ctrl + R to restore: #Requires AutoHotkey v1 #NoTrayIcon DetectHiddenWindows, On global EVENT_SYSTEM_MINIMIZEEND := 0x0017 , EVENT_OBJECT_DESTROY := 0x8001 , Windows := [], orderList := [] MinimizeHook := new WinEventHook(EVENT_SYSTEM_MINIMIZEEND, EVENT_SYSTEM_MINIMIZEEND, "HookProc") DestroyHook :=...
- 21 Mar 2024, 19:14
- Forum: Ask for Help (v2)
- Topic: MSXML DOM find value in other xml
- Replies: 6
- Views: 148
Re: MSXML DOM find value in other xml
First make sure both files are loadable: xmlrequest := ComObject("MSXML2.DOMDocument.3.0") xmlrequest.async := false xmlrequest.load(A_Desktop . '\FindRequests.xml') xmlcapacity := ComObject("MSXML2.DOMDocument.3.0") xmlcapacity.async := false xmlcapacity.load(A_Desktop . '\FindCapacity.xml') MsgBox...
- 21 Mar 2024, 18:29
- Forum: Ask for Help (v2)
- Topic: MSXML DOM find value in other xml
- Replies: 6
- Views: 148
Re: MSXML DOM find value in other xml
There are several ways to get rid of nested loops, for example: dict := Map() Loop requestCodeCollection.length { dict[requestCodeCollection.%A_Index - 1%.innerHTML] := '' } found := unset Loop requestDtoCodeCollection.length { value := requestDtoCodeCollection.%A_Index - 1%.innerHTML } until dict.H...
- 21 Mar 2024, 14:53
- Forum: Ask for Help (v1)
- Topic: script help: minimize to icon in system tray
- Replies: 16
- Views: 3250
Re: script help: minimize to icon in system tray
Imagine you already have 10 hidden windows. Which of them should appear after pressing a hotkey? Any of them?
- 21 Mar 2024, 14:19
- Forum: Ask for Help (v2)
- Topic: MSXML DOM find value in other xml
- Replies: 6
- Views: 148
Re: MSXML DOM find value in other xml
In my experience it is easier to use HTMLFILE object for xml parsing, it has less limitations. I would solve your task like this: findCapacityDocument := DocumentFromHtml(FileRead(A_Desktop . '\FindCapacity.xml')) findRequestsDocument := DocumentFromHtml(FileRead(A_Desktop . '\FindRequests.xml')) Fi...
- 21 Mar 2024, 11:50
- Forum: Ask for Help (v1)
- Topic: script help: minimize to icon in system tray
- Replies: 16
- Views: 3250
- 21 Mar 2024, 03:14
- Forum: Ask for Help (v2)
- Topic: [Q] RegisterActiveObject - How to convert ComObject to Class directly?
- Replies: 4
- Views: 258
Re: [Q] RegisterActiveObject - How to convert ComObject to Class directly?
I don't think there is a way to accomplish what you want.AstraVista wrote: ↑I want to save the active ComObject to class object before the server ends
- 20 Mar 2024, 15:59
- Forum: Ask for Help (v2)
- Topic: [Q] RegisterActiveObject - How to convert ComObject to Class directly?
- Replies: 4
- Views: 258
Re: [Q] RegisterActiveObject - How to convert ComObject to Class directly?
Why do you need to convert it to something?AstraVista wrote: ↑I don't know how to convert the ComObject to class instance directly.
- 19 Mar 2024, 11:33
- Forum: Ask for Help (v2)
- Topic: Hooking window events?
- Replies: 2
- Views: 102
Re: Hooking window events?
Using OnMessage() you can only receive messages sent to your process window.chinagreenelvis wrote: ↑Not sure why WM_CREATE and WM_DESTROY aren't working, but WM_DISPLAYCHANGE is?
- 18 Mar 2024, 20:48
- Forum: Ask for Help (v2)
- Topic: syntax for map Topic is solved
- Replies: 10
- Views: 301
Re: syntax for map Topic is solved
#Requires AutoHotkey v2.0 url := "https://ahkstorage.blob.core.windows.net/ran/ran.txt" http := ComObject("WinHttp.WinHttpRequest.5.1") http.Open("GET", url, true) http.Send() http.WaitForResponse() mapObj := Map(StrSplit(http.ResponseText, ",", " '")*) m := Menu() submenu := Menu() for item in map...
- 18 Mar 2024, 13:10
- Forum: Ask for Help (v2)
- Topic: syntax for map Topic is solved
- Replies: 10
- Views: 301
Re: syntax for map Topic is solved
If you define the toString() method for Map , it can be displayed in MsgBox : #Requires AutoHotkey v2.0 Map.Prototype.DefineProp('toString', { Call: (m, indent := ' ') => ( res := ['{'], e := m.__Enum(2), [( (*) => e(&k, &v) && ( res[1] .= (res[1] = '{' ? '' : ',') . '`n' . indent (IsObject(k) ? Typ...
- 18 Mar 2024, 12:03
- Forum: Ask for Help (v2)
- Topic: syntax for map Topic is solved
- Replies: 10
- Views: 301
Re: syntax for map Topic is solved
@flyingDman
Code: Select all
str := 'value1,(answer1),value2,(answer2),value3,(answer3),value4,(answer4),value5,(answer5)'
mapvar := Map(StrSplit(str, ',')*)
; testing:
for x,y in mapvar
msgbox x "--->" y
- 18 Mar 2024, 11:31
- Forum: Ask for Help (v2)
- Topic: syntax for map Topic is solved
- Replies: 10
- Views: 301
Re: syntax for map Topic is solved
Unclear what should be displayed in the message box.