Search found 4309 matches

by teadrinker
27 Mar 2024, 17:27
Forum: Ask for Help (v2)
Topic: GDI+ Gui Pic Issue Topic is solved
Replies: 3
Views: 98

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...
by teadrinker
26 Mar 2024, 13:18
Forum: Ask for Help (v2)
Topic: How to obtain the memory address of a variable in AutoHotkey v2?
Replies: 22
Views: 657

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) :...
by teadrinker
24 Mar 2024, 17:51
Forum: Ask for Help (v2)
Topic: Help with ComObject("Msxml2.XMLHTTP") Topic is solved
Replies: 5
Views: 124

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...
by teadrinker
24 Mar 2024, 17:22
Forum: Ask for Help (v2)
Topic: Help with ComObject("Msxml2.XMLHTTP") Topic is solved
Replies: 5
Views: 124

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....
by teadrinker
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 :=...
by teadrinker
21 Mar 2024, 19:14
Forum: Ask for Help (v2)
Topic: MSXML DOM find value in other xml
Replies: 6
Views: 147

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...
by teadrinker
21 Mar 2024, 18:29
Forum: Ask for Help (v2)
Topic: MSXML DOM find value in other xml
Replies: 6
Views: 147

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...
by teadrinker
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?
by teadrinker
21 Mar 2024, 14:19
Forum: Ask for Help (v2)
Topic: MSXML DOM find value in other xml
Replies: 6
Views: 147

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...
by teadrinker
21 Mar 2024, 11:50
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

poopux wrote: how do I restore the window that has been hidden?
The script can hide many windows. Which one are you talking about?
by teadrinker
21 Mar 2024, 03:14
Forum: Ask for Help (v2)
Topic: [Q] RegisterActiveObject - How to convert ComObject to Class directly?
Replies: 4
Views: 257

Re: [Q] RegisterActiveObject - How to convert ComObject to Class directly?

AstraVista wrote: I want to save the active ComObject to class object before the server ends
I don't think there is a way to accomplish what you want.
by teadrinker
20 Mar 2024, 15:59
Forum: Ask for Help (v2)
Topic: [Q] RegisterActiveObject - How to convert ComObject to Class directly?
Replies: 4
Views: 257

Re: [Q] RegisterActiveObject - How to convert ComObject to Class directly?

AstraVista wrote: I don't know how to convert the ComObject to class instance directly.
Why do you need to convert it to something?
by teadrinker
19 Mar 2024, 11:33
Forum: Ask for Help (v2)
Topic: Hooking window events?
Replies: 2
Views: 102

Re: Hooking window events?

chinagreenelvis wrote: Not sure why WM_CREATE and WM_DESTROY aren't working, but WM_DISPLAYCHANGE is?
Using OnMessage() you can only receive messages sent to your process window.
by teadrinker
18 Mar 2024, 20:48
Forum: Ask for Help (v2)
Topic: syntax for map Topic is solved
Replies: 10
Views: 297

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...
by teadrinker
18 Mar 2024, 13:10
Forum: Ask for Help (v2)
Topic: syntax for map Topic is solved
Replies: 10
Views: 297

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...
by teadrinker
18 Mar 2024, 12:03
Forum: Ask for Help (v2)
Topic: syntax for map Topic is solved
Replies: 10
Views: 297

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
by teadrinker
18 Mar 2024, 11:31
Forum: Ask for Help (v2)
Topic: syntax for map Topic is solved
Replies: 10
Views: 297

Re: syntax for map Topic is solved

sanneedshelp wrote:

Code: Select all

msgbox item
Unclear what should be displayed in the message box.
by teadrinker
16 Mar 2024, 10:46
Forum: Ask for Help (v2)
Topic: how to display unicode chars returned from DllCall
Replies: 6
Views: 126

Re: how to display unicode chars returned from DllCall

Try output := StrGet(DllCall("libs\functions.dll\displayHello", "Ptr"), "UTF-8")
by teadrinker
16 Mar 2024, 10:20
Forum: Ask for Help (v2)
Topic: how to display unicode chars returned from DllCall
Replies: 6
Views: 126

Re: how to display unicode chars returned from DllCall

Try replacing Astr with Str:

Code: Select all

output := DllCall("libs\functions.dll\displayHello", "Str")

Go to advanced search