Search found 4412 matches

by teadrinker
09 May 2024, 18:26
Forum: Ask for Help (v1)
Topic: How to save image in clipboard.
Replies: 90
Views: 14668

Re: How to save image in clipboard.

F3:: ; press F3 to load screenshot to clipboard Clipboard := ; Clear the clipboard GDI_CaptureScreenToClipboard(0, 0, A_ScreenWidth, A_ScreenHeight) DllCall("DeleteObject", "Ptr", hBM) ; Clean-up Return These lines Clipboard := ; Clear the clipboard DllCall("DeleteObject", "Ptr", hBM) ; Clean-up ar...
by teadrinker
09 May 2024, 15:20
Forum: Ask for Help (v2)
Topic: Any way to determine which control of a webform has focus? Topic is solved
Replies: 8
Views: 601

Re: Any way to determine which control of a webform has focus? Topic is solved

The solution will depend on how the required elements are described in html. For example, on this page there are two search fields with id keywords and search_keywords . If you run this script on this page ((...elemIds) => { const prevTitle = document.title; const updateTitle = id => document.title ...
by teadrinker
09 May 2024, 10:54
Forum: Ask for Help (v2)
Topic: Any way to determine which control of a webform has focus? Topic is solved
Replies: 8
Views: 601

Re: Any way to determine which control of a webform has focus? Topic is solved

A variant of the solution is Tampermonkey extension for Firefox + custom javascript that will track a focus change event on a page, and add to the page title information about which element is in focus. Accordingly, you will be able to use #HotIf in AutoHotkey script.
by teadrinker
08 May 2024, 22:15
Forum: Ask for Help (v2)
Topic: Progressive removal of text in Text Control?
Replies: 5
Views: 461

Re: Progressive removal of text in Text Control?

#Requires AutoHotkey v2+ ; disappearing text experiment guiTitle := 'Color Change' str := 'the quick brown fox jumps over' mg := Gui(, guiTitle) mg.SetFont('s16 cBlue','Consolas') sBlue := mg.Add('text', 'w400', str) mg.Show() #hotif WinActive(guiTitle) Right:: Left:: ((txtCtrl, side) => ( p := sid...
by teadrinker
08 May 2024, 21:19
Forum: Ask for Help (v1)
Topic: How to save image in clipboard.
Replies: 90
Views: 14668

Re: How to save image in clipboard.

The location of DllCall("DeleteObject", "Ptr", hBM) ; Clean-up is it correct? Yes, it's ok. Do i also need to add ---> DllCall("DeleteObject", "Ptr", pBM) ; Clean-up ? No, the DeleteObject() function is not intended for this data type. Resource freeing has already been done in the gdip.DisposeImage...
by teadrinker
05 May 2024, 13:05
Forum: Ask for Help (v2)
Topic: Get command associated with context menu items?
Replies: 8
Views: 591

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...
by teadrinker
05 May 2024, 12:15
Forum: Ask for Help (v2)
Topic: Get command associated with context menu items?
Replies: 8
Views: 591

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...
by teadrinker
05 May 2024, 08:05
Forum: Ask for Help (v2)
Topic: Get command associated with context menu items?
Replies: 8
Views: 591

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...
by teadrinker
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: 356

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.
by teadrinker
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: 598

Re: autohotkey V2 does not have a byte type, Is there any way to convert string to byte in AHK?

Replace this line

Code: Select all

StrPut(str, buf := Buffer(StrPut(str, 'CP0')), 'CP0')
with

Code: Select all

StrPut(str, buf := Buffer(StrPut(str, 'CP0') - 1), 'CP0')
by teadrinker
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: 647

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: ...
by teadrinker
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: 647

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...
by teadrinker
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: 598

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...
by teadrinker
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: 598

Re: autohotkey V2 does not have a byte type, Is there any way to convert string to byte in AHK?

kevinpak wrote: convert string to byte
It's not clear what you mean by that. A string is a sequence of bytes. What exactly should be the result of conversion?
by teadrinker
30 Apr 2024, 19:47
Forum: Ask for Help (v2)
Topic: Updating the JsonToAHK function to AHK v2 Topic is solved
Replies: 2
Views: 473

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...
by teadrinker
30 Apr 2024, 12:15
Forum: Ask for Help (v2)
Topic: Gui Edit (TextBox) auto show/hide scrollbar on mouse hover? Topic is solved
Replies: 7
Views: 801

Re: Gui Edit (TextBox) auto show/hide scrollbar on mouse hover? Topic is solved

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...
by teadrinker
29 Apr 2024, 14:16
Forum: Ask for Help (v1)
Topic: MsgBox and WinMove
Replies: 29
Views: 6251

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...
by teadrinker
28 Apr 2024, 10:07
Forum: Ask for Help (v1)
Topic: How to save image in clipboard.
Replies: 90
Views: 14668

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 ...
by teadrinker
27 Apr 2024, 12:54
Forum: Ask for Help (v1)
Topic: How to save image in clipboard.
Replies: 90
Views: 14668

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?
by teadrinker
26 Apr 2024, 13:53
Forum: Ask for Help (v1)
Topic: How to save image in clipboard.
Replies: 90
Views: 14668

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 ...

Go to advanced search