Search found 814 matches

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

rommmcek wrote:
13 Apr 2024, 16:15
Replacing MyGui.DefineProp('Click', {Call: (this) => Button_Click()}) in your script with ObjBindMethod(myGui, 'Click') will do it.
That didn't work for me. The closest thing was to replace MyGui.DefineProp('Click', {Call: (this) => Button_Click()}) with MyGui.Click := Button_Click.
by iPhilip
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)...
by iPhilip
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...
by iPhilip
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...
by iPhilip
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(...
by iPhilip
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...
by iPhilip
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...
by iPhilip
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 ...
by iPhilip
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...
by iPhilip
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...
by iPhilip
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?
by iPhilip
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

Code: Select all

if (Path := GetLargestUWPLogoPath(hwnd)) ; if UWP
   IconImg := LoadPicture(Path, 'Icon1', &IMAGE_ICON) ; Get UWP Icon
to

Code: Select all

if (LogoPath := GetLargestUWPLogoPath(hwnd)) ; if UWP
   IconImg := LoadPicture(LogoPath, 'Icon1', &IMAGE_ICON) ; Get UWP Icon
should fix it.
by iPhilip
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.', ...
by iPhilip
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.
by iPhilip
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

a_bolog wrote:
28 Mar 2024, 01:49
@iPhilip What would be a good way to identify if the app is UWP?
This conditional statement should work.

Code: Select all

if WinGetClass(hWnd) = 'ApplicationFrameWindow'
   IconImg := LoadPicture(GetLargestUWPLogoPath(hWnd), 'Icon1', &IMAGE_ICON)
by iPhilip
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. :)

Go to advanced search