Search found 814 matches
- 14 Apr 2024, 10:53
- Forum: Ask for Help (v2)
- Topic: How to change where a window will apear
- Replies: 14
- Views: 236
Re: How to change where a window will apear
The approach below doesn't solve the problem in the original post but it's often sufficient for my purposes: #Requires AutoHotkey v2.0 Persistent WinClass := 'Notepad' WinX := 0 WinY := 0 DllCall('RegisterShellHookWindow', 'Ptr', A_ScriptHwnd) MsgNum := DllCall('RegisterWindowMessage', 'WStr', 'SHEL...
- 13 Apr 2024, 18:41
- Forum: Ask for Help (v2)
- Topic: How to call nested function? Topic is solved
- Replies: 15
- Views: 274
Re: How to call nested function? Topic is solved
That didn't work for me. The closest thing was to replace MyGui.DefineProp('Click', {Call: (this) => Button_Click()}) with MyGui.Click := Button_Click.
- 13 Apr 2024, 01:36
- Forum: Ask for Help (v2)
- Topic: How to call nested function? Topic is solved
- Replies: 15
- Views: 274
Re: How to call nested function? Topic is solved
Used BoundFunc to attach it to the Gui object as a method. I am not sure how you did that. Here's my implementation using the DefineProp method: MyGui := BuildGui() MyGui.Show() F3::MyGui.Click() BuildGui() { MyGui := Gui() Button := MyGui.Add('Button', , 'OK') Button.OnEvent('Click', Button_Click)...
- 12 Apr 2024, 10:07
- Forum: Scripts and Functions (v2)
- Topic: svgToHBITMAP.ah2 (AddPicture an SVG to Gui)
- Replies: 13
- Views: 998
Re: svgToHBITMAP.ah2 (AddPicture an SVG to Gui)
You are welcome. The key is not to rely on the return value from functions with a void return type. From ComCall 's documentation page: If the method is of a type that does not return a value (the void return type in C), specify "Int" or any other numeric type without any suffix (except HRESULT), an...
- 11 Apr 2024, 19:53
- Forum: Scripts and Functions (v2)
- Topic: svgToHBITMAP.ah2 (AddPicture an SVG to Gui)
- Replies: 13
- Views: 998
Re: svgToHBITMAP.ah2 (AddPicture an SVG to Gui)
iseahound The reason for the error lies in the return type. ComCall(48,ID2D1RenderTarget) assumes that the return type is HRESULT . The documentation page for that method states otherwise: void BeginDraw(); Thus, one way to write that line is to use Int as the return type, i.e. ComCall(48,ID2D1Rend...
- 09 Apr 2024, 00:30
- Forum: Scripts and Functions (v1)
- Topic: [LIB] MDMF - Multiple Display Monitor Functions
- Replies: 26
- Views: 12504
Re: [LIB] MDMF - Multiple Display Monitor Functions
You are welcome.
- 09 Apr 2024, 00:01
- Forum: Ask for Help (v1)
- Topic: how to keep a window at the bottom always?
- Replies: 10
- Views: 2794
- 08 Apr 2024, 19:52
- Forum: Ask for Help (v1)
- Topic: how to keep a window at the bottom always?
- Replies: 10
- Views: 2794
Re: how to keep a window at the bottom always?
Here's a simpler version that doesn't use the GetAltTabWindows function (which is buggy): #NoEnv DllCall("RegisterShellHookWindow", "Ptr", A_ScriptHwnd) MsgNum := DllCall("RegisterWindowMessage", "Str", "SHELLHOOK") return F2:: BottomID := WinExist("A") WinSet, Bottom, , ahk_id %BottomID% OnMessage(...
- 08 Apr 2024, 19:39
- Forum: Ask for Help (v1)
- Topic: how to keep a window at the bottom always?
- Replies: 10
- Views: 2794
Re: how to keep a window at the bottom always?
How do you use this script? I mean, do you click on the window and then press a certain key combo, like with the more well-known "alwaysontop" function? I don't see that in the code, so I am wondering how it determines which window to act on? :think: I am currently running Ubuntu with desktop in WS...
- 08 Apr 2024, 19:25
- Forum: Scripts and Functions (v1)
- Topic: [LIB] MDMF - Multiple Display Monitor Functions
- Replies: 26
- Views: 12504
Re: [LIB] MDMF - Multiple Display Monitor Functions
Hallo, the v2-a108 example does not run with v2.0.12 Is there already an update? Rohwedder Here's a version that works: ; ====================================================================================================================== ; Multiple Display Monitors Functions -> msdn.microsoft.co...
- 08 Apr 2024, 10:37
- Forum: Ask for Help (v1)
- Topic: Select a random file inside the current open folder?
- Replies: 15
- Views: 3812
Re: Select a random file inside the current open folder?
You are welcome.
- 31 Mar 2024, 20:20
- Forum: Ask for Help (v1)
- Topic: Select a random file inside the current open folder?
- Replies: 15
- Views: 3812
Re: Select a random file inside the current open folder?
I know this is a really old topic but does exactly what I need. However, on folders with a large number of files (ex. 30k files), it crashes. Is there a solution for this? My tests reveal that the ShellFolderView.Folder.Items.Item(Index) method crashes Explorer when Index > ~3100 . If you know the ...
- 28 Mar 2024, 22:18
- Forum: Ask for Help (v2)
- Topic: Get Windows UWP icons Topic is solved
- Replies: 19
- Views: 300
Re: Get Windows UWP icons Topic is solved
Thank you for your sticking with me on this. I don't have a way to test Facebook Messenger and the other apps you mentioned because of security restrictions on my laptop. The AppHasPackage function was my best educated guess of how to check if an app is UWP or not. This guess was informed by this st...
- 28 Mar 2024, 13:46
- Forum: Ask for Help (v2)
- Topic: Get Windows UWP icons Topic is solved
- Replies: 19
- Views: 300
Re: Get Windows UWP icons Topic is solved
Thank you. There are a couple of issues you might want to look into: 1. The "Get Icon" logic doesn't seem right to me. In my opinion, this code ; Get Icon if (LogoPath := GetLargestUWPLogoPath(hwnd)) ; if UWP IconImg := LoadPicture(LogoPath, 'Icon1', &IMAGE_ICON) ; Get UWP Icon else ; Get System Ico...
- 28 Mar 2024, 13:10
- Forum: Ask for Help (v2)
- Topic: Get Windows UWP icons Topic is solved
- Replies: 19
- Views: 300
Re: Get Windows UWP icons Topic is solved
Can you post your latest code?
- 28 Mar 2024, 12:11
- Forum: Ask for Help (v2)
- Topic: Get Windows UWP icons Topic is solved
- Replies: 19
- Views: 300
Re: Get Windows UWP icons Topic is solved
See my P.S. above.
Changing
to
should fix it.
Changing
Code: Select all
if (Path := GetLargestUWPLogoPath(hwnd)) ; if UWP
IconImg := LoadPicture(Path, 'Icon1', &IMAGE_ICON) ; Get UWP Icon
Code: Select all
if (LogoPath := GetLargestUWPLogoPath(hwnd)) ; if UWP
IconImg := LoadPicture(LogoPath, 'Icon1', &IMAGE_ICON) ; Get UWP Icon
- 28 Mar 2024, 11:32
- Forum: Ask for Help (v2)
- Topic: Get Windows UWP icons Topic is solved
- Replies: 19
- Views: 300
Re: Get Windows UWP icons Topic is solved
Hmm it doesn't work it says it cant read the file. Error: (2) The system cannot find the file specified. 056: { 057: SplitPath(Path, , &Dir) ▶ 058: If !RegExMatch(FileRead(Dir '\AppxManifest.xml', 'UTF-8'), '<Logo>(.*)</Logo>', &Match) 059: Throw Error('Unable to read logo information from file.', ...
- 28 Mar 2024, 10:46
- Forum: Ask for Help (v2)
- Topic: Get Windows UWP icons Topic is solved
- Replies: 19
- Views: 300
Re: Get Windows UWP icons Topic is solved
Thank you for reporting the additional testing. I updated the above post to include a AppHasPackage function to check if the window is UWP.
Let me know if this works for you.
Let me know if this works for you.
- 28 Mar 2024, 01:55
- Forum: Ask for Help (v2)
- Topic: Get Windows UWP icons Topic is solved
- Replies: 19
- Views: 300
Re: Get Windows UWP icons Topic is solved
This conditional statement should work.
Code: Select all
if WinGetClass(hWnd) = 'ApplicationFrameWindow'
IconImg := LoadPicture(GetLargestUWPLogoPath(hWnd), 'Icon1', &IMAGE_ICON)
- 27 Mar 2024, 09:04
- Forum: Ask for Help (v2)
- Topic: Get Windows UWP icons Topic is solved
- Replies: 19
- Views: 300
Re: Get Windows UWP icons Topic is solved
You are welcome.