How to get the DC of a specific listbox item?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
c7aesa7r
Posts: 209
Joined: 02 Jun 2016, 21:09

How to get the DC of a specific listbox item?

Post by c7aesa7r » 20 Nov 2021, 12:43

Im using this lib: viewtopic.php?f=10&t=338

Inside of the function DrawItem(lParam, Msg, Hwnd) it colorize each row according to the user option

Code: Select all

      HWND := NumGet(lParam + offHWND, 0, "UPtr")
      If OD_Colors.Controls.HasKey(HWND) && ODT.HasKey(NumGet(lParam + 0, 0, "UInt")) {
         
         ODCtrl := OD_Colors.Controls[HWND]
         Item   := NumGet(lParam + offItem, 0, "Int") + 1
         Action := NumGet(lParam + offAction, 0, "UInt")
         State  := NumGet(lParam + offState, 0, "UInt")
         HDC    := NumGet(lParam + offDC, 0, "UPtr")
         RECT   := lParam + offRECT
Im trying to edit the function to when i click on a specific item, it colorize until find a blank line.

For example , i click on A it also colorize B and stop as next line is a blank line.
2021-11-20_14-39-22.gif
2021-11-20_14-39-22.gif (20.55 KiB) Viewed 489 times
Item store the index of the current selected item in the listbox, im having difficult only in how to get the HDC from the next item.
Getting it i think i know how to do all the rest.

The function get the hdc using the lparam received by the onmessage, what other way I could get the hdc of a specific row ?

Return to “Ask for Help (v1)”