Powerbasic Museum 2020-B

Webmaster: José Roca (PBWIN 10+/PBCC 6+) (SDK Forum) => Windows API Programming => Topic started by: Chris Chancellor on December 12, 2018, 07:04:06 AM

Title: Where to get BIT() function
Post by: Chris Chancellor on December 12, 2018, 07:04:06 AM
Hello Jose

in your PB Winapi includes  of  ListViewCtrl.inc ,
there is a function named as    ListView_GetCheckState()  and it contains a BIT()  function

i dug through internet and MSDN and couldn't  find an equivalent BIT()  function

where can i get this function ?   as  i need this function to translate a PB program to O2

i need help please


' ========================================================================================
' Determines if an item in a list-view control is selected. This should be used only for
' list-view controls that have the LVS_EX_CHECKBOXES style.
' ========================================================================================
FUNCTION ListView_GetCheckState (BYVAL hwndLV AS DWORD, BYVAL i AS LONG) AS DWORD
   LOCAL nCheck AS LONG
   nCheck = SendMessage(hwndLV, %LVM_GETITEMSTATE, i, %LVIS_STATEIMAGEMASK)
   FUNCTION = BIT(nCheck, 12) - 1
END FUNCTION
Title: Re: Where to get BIT() function
Post by: Chris Chancellor on December 12, 2018, 07:18:00 AM
Found that it is actually a PB function and not a  winapi function