Search found 4344 matches
- 02 May 2024, 09:33
- Forum: Ask for Help (v2)
- Topic: i need help how to random the loops not to be in order
- Replies: 4
- Views: 227
Re: i need help how to random the loops not to be in order
Perhaps @vmech meant something like this: arr := [] loop 20 { arr.Push(Func%A_Index%) } Loop 20 { arr.RemoveAt(Random(1, arr.Length))() } object-oriented features I wouldn't say that the function array is an object-oriented feature . It is rather the opposite, a feature from the functional approach.
- 02 May 2024, 08:51
- Forum: Ask for Help (v2)
- Topic: autohotkey V2 does not have a byte type, Is there any way to convert string to byte in AHK?
- Replies: 7
- Views: 441
Re: autohotkey V2 does not have a byte type, Is there any way to convert string to byte in AHK?
Replace this line
with
Code: Select all
StrPut(str, buf := Buffer(StrPut(str, 'CP0')), 'CP0')
Code: Select all
StrPut(str, buf := Buffer(StrPut(str, 'CP0') - 1), 'CP0')
- 01 May 2024, 18:52
- Forum: Ask for Help (v2)
- Topic: ActiveX(HTML), how to underline a paragraph, change a sentence's background color and some words' font color Topic is solved
- Replies: 4
- Views: 411
Re: ActiveX(HTML), how to underline a paragraph, change a sentence's background color and some words' font color Topic is solved
Try this fix: #Requires AutoHotkey v2 DecoratedTextGui() DecoratedTextGui() { FixIE() wnd := Gui() document := wnd.AddActiveX('w220 h130', 'HTMLFILE').Value document.Write(' ( <!DOCTYPE html> <html> <head> <style> * { margin: 0; padding: 0; overflow: hidden; } .sometext { position: absolute; width: ...
- 01 May 2024, 17:42
- Forum: Ask for Help (v2)
- Topic: ActiveX(HTML), how to underline a paragraph, change a sentence's background color and some words' font color Topic is solved
- Replies: 4
- Views: 411
Re: ActiveX(HTML), how to underline a paragraph, change a sentence's background color and some words' font color Topic is solved
#Requires AutoHotkey v2 DecoratedTextGui() DecoratedTextGui() { wnd := Gui() document := wnd.AddActiveX('w220 h130', 'HTMLFILE').Value document.Write(' ( <!DOCTYPE html> <html> <head> <style> * { margin: 0; padding: 0; overflow: hidden; } .sometext { position: absolute; width: 100%; height: 100%; f...
- 01 May 2024, 08:39
- Forum: Ask for Help (v2)
- Topic: autohotkey V2 does not have a byte type, Is there any way to convert string to byte in AHK?
- Replies: 7
- Views: 441
Re: autohotkey V2 does not have a byte type, Is there any way to convert string to byte in AHK?
Try this: #Requires AutoHotkey v2 DetectHiddenWindows true Persistent str := '!123456' pidOrProcessName := 'MyProgram.exe' ; specify PID or exe name of the target program if !PID := ProcessExist(pidOrProcessName) { throw Error('Process not found') } StrPut(str, buf := Buffer(StrPut(str, 'CP0')), 'CP...
- 01 May 2024, 03:29
- Forum: Ask for Help (v2)
- Topic: autohotkey V2 does not have a byte type, Is there any way to convert string to byte in AHK?
- Replies: 7
- Views: 441
- 30 Apr 2024, 19:47
- Forum: Ask for Help (v2)
- Topic: Updating the JsonToAHK function to AHK v2 Topic is solved
- Replies: 2
- Views: 292
Re: Updating the JsonToAHK function to AHK v2 Topic is solved
Hello #Requires Autohotkey v2.0 JsonExam := ' ( {"menu": { "id": "file", "value": "File", "popup": { "menuitem": [ {"value": "New", "onclick": "CreateNewDoc()"}, {"value": "Open", "onclick": "OpenDoc()"}, {"value": "Close", "onclick": "CloseDoc()"} ] } }} )' obj := JsonToAhk(JsonExam) MsgBox obj['me...
- 30 Apr 2024, 12:15
- Forum: Ask for Help (v2)
- Topic: Gui Edit (TextBox) auto show/hide scrollbar on mouse hover?
- Replies: 6
- Views: 457
Re: Gui Edit (TextBox) auto show/hide scrollbar on mouse hover?
ActiveX? #Requires AutoHotkey v2 HoverScrollbarGui() HoverScrollbarGui() { wnd := Gui() document := wnd.AddActiveX('w200 h100', 'HTMLFILE').Value document.Write(' ( <!DOCTYPE html> <html> <head> <style> * { margin: 0; padding: 0; overflow: hidden; } textarea { position: absolute; width: 100%; height...
- 29 Apr 2024, 14:16
- Forum: Ask for Help (v1)
- Topic: MsgBox and WinMove
- Replies: 29
- Views: 5739
Re: MsgBox and WinMove
It will not be possible to translate this code to v2 exactly, because there is no mechanism in the second version that would create self-starting functions. The closest translation would be the following: #Requires AutoHotkey v2 inst := MsgBoxWithCoords() MsgBox 'This MsgBox appears in coords x = 50...
- 28 Apr 2024, 10:07
- Forum: Ask for Help (v1)
- Topic: How to save image in clipboard.
- Replies: 71
- Views: 10243
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 ...
- 27 Apr 2024, 12:54
- Forum: Ask for Help (v1)
- Topic: How to save image in clipboard.
- Replies: 71
- Views: 10243
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: 10243
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: 10243
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: 178
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: 161
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: 161
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: 151
- 20 Apr 2024, 09:38
- Forum: Ask for Help (v2)
- Topic: Gui Progress Bar in Taskbar Topic is solved
- Replies: 4
- Views: 159
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: 97
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: 93
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?