Search found 4347 matches
- 05 May 2024, 13:05
- Forum: Ask for Help (v2)
- Topic: Get command associated with context menu items?
- Replies: 8
- Views: 358
Re: Get command associated with context menu items?
I can identify the command that can be used to 'simulate' the menu click, without actually displaying the menu itself? I wanted to reply that it is, but I decided to test it first. Unfortunately, it turned out that approach doesn't work with Windows Explorer. My thought is to write a script that th...
- 05 May 2024, 12:15
- Forum: Ask for Help (v2)
- Topic: Get command associated with context menu items?
- Replies: 8
- Views: 358
Re: Get command associated with context menu items?
So no persistent app can receive the command that you have suggested. If a context menu can be called, then there is an application that displays it. When the user clicks on a menu item, the application that opened the menu receives a WM_COMMAND message and executes the command associated with that...
- 05 May 2024, 08:05
- Forum: Ask for Help (v2)
- Topic: Get command associated with context menu items?
- Replies: 8
- Views: 358
Re: Get command associated with context menu items?
When the user clicks a menu item, a WM_COMMAND message is sent to the application window with the item ID in wParam. You can simulate a click on this menu item by sending a corresponding message to the window. The easiest way to find out the ID of a menu item is to use applications that intercept me...
- 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: 262
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: 520
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: 471
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: 471
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: 520
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: 520
- 30 Apr 2024, 19:47
- Forum: Ask for Help (v2)
- Topic: Updating the JsonToAHK function to AHK v2 Topic is solved
- Replies: 2
- Views: 350
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: 530
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: 5847
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: 10360
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: 10360
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: 10360
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: 10360
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: 197
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: 185
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: 185
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: 170