Search found 4331 matches

by teadrinker
Yesterday, 12:50
Forum: Ask for Help (v2)
Topic: DllCall WriteFile Output to Console in CP850
Replies: 2
Views: 69

Re: DllCall WriteFile Output to Console in CP850

Code: Select all

FileAppend('Da nicht für.', '*', 'CP850')
or

Code: Select all

FileAppend('Da nicht für.', '*', 'UTF-16')
by teadrinker
22 Apr 2024, 09:36
Forum: Ask for Help (v2)
Topic: Gui Edit control accept file paste? Topic is solved
Replies: 4
Views: 133

Re: Gui Edit control accept file paste? Topic is solved

If there is a file on the clipboard, the Paste menu item is disabled, at least for me.
by teadrinker
22 Apr 2024, 06:17
Forum: Ask for Help (v2)
Topic: Gui Edit control accept file paste? Topic is solved
Replies: 4
Views: 133

Re: Gui Edit control accept file paste? Topic is solved

#Requires AutoHotkey v2 wnd := Gui() fileAcceptor := wnd.AddEdit('w400 h200') OnMessage(WM_CHAR := 0x102, OnPaste) wnd.Show() OnPaste(wp, *) { if !(wp = 22 && fileAcceptor.Focused) { return } DllCall('OpenClipboard', 'Ptr', A_ScriptHwnd) if hData := DllCall('GetClipboardData', 'UInt', CF_HDROP := 1...
by teadrinker
21 Apr 2024, 14:24
Forum: Ask for Help (v2)
Topic: How can I detect when a suspended process comes to the foreground?
Replies: 6
Views: 113

Re: How can I detect when a suspended process comes to the foreground?

williams wrote: resumes the process when the window comes back to the foreground
Is it really possible for a suspended process window to come to the foreground? How does it happen?
by teadrinker
20 Apr 2024, 09:38
Forum: Ask for Help (v2)
Topic: Gui Progress Bar in Taskbar Topic is solved
Replies: 4
Views: 134

Re: Gui Progress Bar in Taskbar Topic is solved

This is more correct: #Requires AutoHotkey v2.0 wnd := Gui() wnd.Show('w300 h100') Sleep 1000 wnd.Title := 'TBPF_PAUSED' Loop 3 { SetProgressOnTaskbarButton(wnd, TBPF_PAUSED := 8, 100) Sleep 500 SetProgressOnTaskbarButton(wnd, TBPF_NOPROGRESS := 0) Sleep 500 } wnd.Title := 'TBPF_INDETERMINATE' SetPr...
by teadrinker
16 Apr 2024, 18:12
Forum: Ask for Help (v2)
Topic: function calling itself to countdown
Replies: 3
Views: 64

Re: function calling itself to countdown

In addition to @boiler's answer, AHK v2 syntax allows you to simplify this function:

Code: Select all

MsgBox rundown(2)

rundown(a) => --a ? rundown(a) : a
or

Code: Select all

MsgBox rundown(2)

rundown(a) => (MsgBox(a), --a ? rundown(a) : a)
by teadrinker
14 Apr 2024, 20:24
Forum: Ask for Help (v2)
Topic: Get sc key code always for English keyboard
Replies: 3
Views: 69

Re: Get sc key code always for English keyboard

@ntepa
Wouldn't it be easier to list all the keys you need? ;)
by teadrinker
14 Apr 2024, 16:29
Forum: Ask for Help (v2)
Topic: Get sc key code always for English keyboard
Replies: 3
Views: 69

Re: Get sc key code always for English keyboard

Code: Select all

key := "/"
if key = "/" {
    scKey := "sc35"
}
MsgBox scKey
by teadrinker
14 Apr 2024, 16:27
Forum: Ask for Help (v1)
Topic: Lock mouse movement to only allow horizontal movement (vertical too if you want) Topic is solved
Replies: 25
Views: 3662

Re: Lock mouse movement to only allow horizontal movement (vertical too if you want) Topic is solved

Try this: #Requires AutoHotkey v1 ~LShift:: ~LCtrl:: BlockInput, MouseMove ToolTip mouse movement restricted. ClipCursor(A_ThisHotkey) BlockInput, MouseMoveOff KeyWait, % SubStr(A_ThisHotkey, 2) ClipCursor() ToolTip Return ClipCursor(hk := "") { if !hk DllCall("ClipCursor", "Ptr", 0) else { CoordMod...
by teadrinker
13 Apr 2024, 16:32
Forum: Ask for Help (v1)
Topic: Lock mouse movement to only allow horizontal movement (vertical too if you want) Topic is solved
Replies: 25
Views: 3662

Re: Lock mouse movement to only allow horizontal movement (vertical too if you want) Topic is solved

Fixed: #Requires AutoHotkey v1 ~LShift:: ~LCtrl:: ToolTip mouse movement restricted. ClipCursor(A_ThisHotkey) KeyWait, % SubStr(A_ThisHotkey, 2) ClipCursor() ToolTip Return ClipCursor(hk := "") { if !hk DllCall("ClipCursor", "Ptr", 0) else { CoordMode, Mouse MouseGetPos, X, Y VarSetCapacity(RECT, 16...
by teadrinker
12 Apr 2024, 15:16
Forum: Ask for Help (v2)
Topic: Issue with Building an Array Using a Loop Topic is solved
Replies: 10
Views: 280

Re: Issue with Building an Array Using a Loop Topic is solved

@Rohwedder
I think the closest translation would be this:

Code: Select all

#Requires AutoHotkey v2

obj := {}
obj.a := 'a'
obj.%-1% := 'b'
obj.5 := 'c'
for k, v in obj.OwnProps() {
    MsgBox 'key: ' . k . '`nvalue: ' . v
}
by teadrinker
12 Apr 2024, 15:08
Forum: Ask for Help (v1)
Topic: Lock mouse movement to only allow horizontal movement (vertical too if you want) Topic is solved
Replies: 25
Views: 3662

Re: Lock mouse movement to only allow horizontal movement (vertical too if you want) Topic is solved

I tested the script with hotkeys XButton1, XButton2, indeed with these keys the script does not work correctly, I don't know why. Try this one: ~LShift:: ~LCtrl:: ToolTip mouse movement restricted. ClipCursor(A_ThisHotkey) KeyWait, % SubStr(A_ThisHotkey, 2) ClipCursor() ToolTip Return ClipCursor(hk ...
by teadrinker
10 Apr 2024, 17:30
Forum: Ask for Help (v2)
Topic: Issue with Building an Array Using a Loop Topic is solved
Replies: 10
Views: 280

Re: Issue with Building an Array Using a Loop Topic is solved

Yes, in the first version arrays didn't have a "Length" property at all, they had a Length() method that returned the maximum positive numeric key: #Requires AutoHotkey v1 arr := [] arr.a := "a" arr[-1] := "b" arr[5] := "c" MsgBox % "length: " . arr.Length() for k, v in arr { MsgBox % "key: " . k . ...
by teadrinker
10 Apr 2024, 14:27
Forum: Ask for Help (v2)
Topic: Issue with Building an Array Using a Loop Topic is solved
Replies: 10
Views: 280

Re: Issue with Building an Array Using a Loop Topic is solved

I'm not sure exactly what you mean, but yes, arrays are arranged differently in the second version. In the first version there was no difference between obj := [] and obj := {}. See this post.
by teadrinker
09 Apr 2024, 19:21
Forum: Ask for Help (v2)
Topic: Issue with Building an Array Using a Loop Topic is solved
Replies: 10
Views: 280

Re: Issue with Building an Array Using a Loop Topic is solved

Without a loop:

Code: Select all

Aer := ["a", "b", "c", "d", "e", "f","g","h"]
Ier := [((e, _, &v) => e(&v) && v := [v]).Bind(Aer.__Enum(1), &v)*]
MsgBox Ier[2][1]
:)
by teadrinker
06 Apr 2024, 13:39
Forum: Ask for Help (v2)
Topic: Weird problem with getElementsByClassName
Replies: 6
Views: 292

Re: Weird problem with getElementsByClassName

A_Index starts with 1, but HTMLCollection with 0. When you reach the last iteration, the collection index becomes invalid.
by teadrinker
30 Mar 2024, 08:07
Forum: Ask for Help (v2)
Topic: Using ComObject and WinHttp.WinHttpRequest.5.1 Topic is solved
Replies: 4
Views: 191

Re: Using ComObject and WinHttp.WinHttpRequest.5.1 Topic is solved

API wrote:FollowUser
GET
nax wrote: WebRequest.Open("POST", URL)
Must be "GET" here instead of "POST".

Go to advanced search