Search found 4335 matches
- Today, 10:07
- Forum: Ask for Help (v1)
- Topic: How to save image in clipboard.
- Replies: 71
- Views: 9907
Re: How to save image in clipboard.
I am sure that there is a "line" in the code that can modify the code to always save JPG as 100% qaulity. Just for educational purposes, i will appreciate if you can point me what is the part of the code that changes the 75 to 100%. Understood. In fact, saving a JPEG at 75% quality doesn't require ...
- Yesterday, 12:54
- Forum: Ask for Help (v1)
- Topic: How to save image in clipboard.
- Replies: 71
- Views: 9907
Re: How to save image in clipboard.
I wouldn't really want to get into the details of someone else's code on v1, I only use v2 now. Why not just use my code, is it any worse?
- 26 Apr 2024, 13:53
- Forum: Ask for Help (v1)
- Topic: How to save image in clipboard.
- Replies: 71
- Views: 9907
Re: How to save image in clipboard.
Sure. SaveBitmapFromClipboard(A_ScriptDir . "\ClipboardImage.jpg", 100) SaveBitmapFromClipboard(destImageFilePath, jpegQuality := 75) { hBitmap := GetBitmapFromClipboard() HBitmapToImageFile(hBitmap, destImageFilePath, 100) DllCall("DeleteObject", "Ptr", hBitmap) } GetBitmapFromClipboard() { static ...
- 25 Apr 2024, 16:10
- Forum: Ask for Help (v1)
- Topic: How to save image in clipboard.
- Replies: 71
- Views: 9907
Re: How to save image in clipboard.
Perhaps this will work on Windows XP: destPngFilePath := A_ScriptDir . "\ClipboardImage.png" hBitmap := GetBitmapFromClipboard() HBitmapToPng(hBitmap, destPngFilePath) DllCall("DeleteObject", "Ptr", hBitmap) Return GetBitmapFromClipboard() { static CF_BITMAP := 2, CF_DIB := 8, SRCCOPY := 0x00CC0020 ...
- 23 Apr 2024, 12:50
- Forum: Ask for Help (v2)
- Topic: DllCall WriteFile Output to Console in CP850
- Replies: 3
- Views: 146
Re: DllCall WriteFile Output to Console in CP850
Code: Select all
FileAppend('Da nicht für.', '*', 'CP850')
Code: Select all
FileAppend('Da nicht für.', '*', 'UTF-16')
- 22 Apr 2024, 09:36
- Forum: Ask for Help (v2)
- Topic: Gui Edit control accept file paste? Topic is solved
- Replies: 4
- Views: 144
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.
- 22 Apr 2024, 06:17
- Forum: Ask for Help (v2)
- Topic: Gui Edit control accept file paste? Topic is solved
- Replies: 4
- Views: 144
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...
- 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: 120
- 20 Apr 2024, 09:38
- Forum: Ask for Help (v2)
- Topic: Gui Progress Bar in Taskbar Topic is solved
- Replies: 4
- Views: 141
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...
- 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:
or
Code: Select all
MsgBox rundown(2)
rundown(a) => --a ? rundown(a) : a
Code: Select all
MsgBox rundown(2)
rundown(a) => (MsgBox(a), --a ? rundown(a) : a)
- 14 Apr 2024, 20:24
- Forum: Ask for Help (v2)
- Topic: Get sc key code always for English keyboard
- Replies: 3
- Views: 70
Re: Get sc key code always for English keyboard
@ntepa
Wouldn't it be easier to list all the keys you need?
Wouldn't it be easier to list all the keys you need?
- 14 Apr 2024, 16:53
- 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: 3691
- 14 Apr 2024, 16:29
- Forum: Ask for Help (v2)
- Topic: Get sc key code always for English keyboard
- Replies: 3
- Views: 70
Re: Get sc key code always for English keyboard
Code: Select all
key := "/"
if key = "/" {
scKey := "sc35"
}
MsgBox scKey
- 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: 3691
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...
- 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: 3691
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...
- 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: 282
Re: Issue with Building an Array Using a Loop Topic is solved
@Rohwedder
I think the closest translation would be this:
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
}
- 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: 3691
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 ...
- 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: 282
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 . ...
- 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: 282
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.
- 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: 282
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]