[Class] LV_Colors - 1.1.04.01 (2016-05-03)

Post your working scripts, libraries and tools
User avatar
evilC
Posts: 4183
Joined: 27 Feb 2014, 12:30

Re: [Class] LV_Colors - 1.1.04.01 (2016-05-03)

16 Nov 2017, 17:03

OK, so I was forgetting of course that the pure AHK solution is processing the messages for it's own window.
Ideally I want to build this as a C# DLL (Which normally lacks a message pump, so cannot process messages), so I will need a message pump and to somehow intercept the messages for the AHK window.

I think I have some code that will do that, I wrote a POC for RawInput in a C# dll, which also required a message pump, so I think I am half way there.
Clocking off for today, will try and do some more work on it over the weekend.
User avatar
evilC
Posts: 4183
Joined: 27 Feb 2014, 12:30

Re: [Class] LV_Colors - 1.1.04.01 (2016-05-03)

18 Nov 2017, 18:12

Ah, I was going about things the wrong way - if the C# code is being loaded as a library from AHK, then of course I can just hook the messages meant for the AHK GUI (Local hook, not global hook).
ManagedWinapi has stuff built-in for this it seems, so now I can hook into the messages sent to the ListView.
I still do not understand what to do at what point and in response to what messages though. It seems that LV_Colors uses NM_CUSTOMDRAW whereas the example code I have been messing around with uses WM_PAINT / WM_ERASEBKGND
So... more progress, and I think I have proved that you *can* completely offload this code to C#, but still not that close to actually getting it working.
AlexD9111

Re: [Class] LV_Colors - 1.1.04.01 (2016-05-03)

16 Feb 2018, 04:50

Hi thanks for your Class, this is very usefull.
I have a little problem, when my listview appears first there is no color.
I have to scroll down or resize my list view to refresh and display alternate rows colors.
Could you please help me ?
just me
Posts: 5397
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: [Class] LV_Colors - 1.1.04.01 (2016-05-03)

17 Feb 2018, 06:14

LV_Colors_sample.ahk:

Code: [Select all] [Download] GeSHi © Codebox Plus

...
Gui, Show, , ListView & Colors
; Redraw the ListView after the first Gui, Show command to show the colors, if any.
WinSet, Redraw, , ahk_id %HLV%
...
AlexD9111

Re: [Class] LV_Colors - 1.1.04.01 (2016-05-03)

20 Feb 2018, 00:54

thanks Just me
it works fine when I use only this line :
WinSet, Redraw, , ahk_id %HLV%

Return to “Scripts and Functions”

Who is online

Users browsing this forum: No registered users and 9 guests