<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to use ListView_GetCheckState in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-use-ListView-GetCheckState/m-p/803937#M39208</link>
    <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;I have never used a Windows API macro before - so how do I get my program to "see" ListView_GetCheckState? I cannot get the linker to find it.&lt;BR /&gt;&lt;BR /&gt;Many thanks&lt;BR /&gt;Mike</description>
    <pubDate>Tue, 12 Jun 2012 09:01:16 GMT</pubDate>
    <dc:creator>michael_green</dc:creator>
    <dc:date>2012-06-12T09:01:16Z</dc:date>
    <item>
      <title>How to use ListView_GetCheckState</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-use-ListView-GetCheckState/m-p/803937#M39208</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;I have never used a Windows API macro before - so how do I get my program to "see" ListView_GetCheckState? I cannot get the linker to find it.&lt;BR /&gt;&lt;BR /&gt;Many thanks&lt;BR /&gt;Mike</description>
      <pubDate>Tue, 12 Jun 2012 09:01:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-use-ListView-GetCheckState/m-p/803937#M39208</guid>
      <dc:creator>michael_green</dc:creator>
      <dc:date>2012-06-12T09:01:16Z</dc:date>
    </item>
    <item>
      <title>How to use ListView_GetCheckState</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-use-ListView-GetCheckState/m-p/803938#M39209</link>
      <description>have you added your resource-file into your fortran source?&lt;BR /&gt;&lt;BR /&gt;some thing like&lt;BR /&gt;&lt;BR /&gt;INCLUDE "Resource.fd"&lt;BR /&gt;&lt;BR /&gt;Frank</description>
      <pubDate>Tue, 12 Jun 2012 10:21:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-use-ListView-GetCheckState/m-p/803938#M39209</guid>
      <dc:creator>tropfen</dc:creator>
      <dc:date>2012-06-12T10:21:20Z</dc:date>
    </item>
    <item>
      <title>How to use ListView_GetCheckState</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-use-ListView-GetCheckState/m-p/803939#M39210</link>
      <description>It's in COMMCTRL.H in the Windows SDK and I suppose the it resides in COMCTL32.LIB. You will have to ask someone here to translate the following C++ code into the correct SENDMESSAGE command and how to recover the reply using the appropriate masking (which I think the &amp;gt;&amp;gt;12 ) -1) does, although I am not certain!.&lt;BR /&gt;&lt;BR /&gt;#define ListView_GetCheckState(hwndLV, i) \&lt;BR /&gt; ((((UINT)(SNDMSG((hwndLV), LVM_GETITEMSTATE, (WPARAM)(i), LVIS_STATEIMAGEMASK))) &amp;gt;&amp;gt; 12) -1)&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 12 Jun 2012 10:24:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-use-ListView-GetCheckState/m-p/803939#M39210</guid>
      <dc:creator>anthonyrichards</dc:creator>
      <dc:date>2012-06-12T10:24:14Z</dc:date>
    </item>
    <item>
      <title>How to use ListView_GetCheckState</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-use-ListView-GetCheckState/m-p/803940#M39211</link>
      <description>Here are Fortran wrapper functions to set and retrieve the selected state of a listview item:&lt;BR /&gt;&lt;BR /&gt;[bash]! 
! Sets the specified item in a list view control to selected. The
! index argument is 1-based.
!
SUBROUTINE ListViewSetSelectedIndex(hwnd, controlId, index)
    IMPLICIT NONE
    INTEGER(HANDLE), INTENT(IN)    :: hwnd
    INTEGER, INTENT(IN)            :: controlId
    INTEGER, INTENT(IN)            :: index
    INTEGER                        :: rval
    TYPE(T_LV_ITEM)                :: item
    
    item%iItem     = index - 1
    item%iSubitem  = 0
    item%mask      = LVIF_STATE
    item%state     = LVIS_SELECTED
    item%stateMask = LVIS_SELECTED
	 
    rval = SendControlMessage (hwnd, controlId, LVM_SETITEM, 0, LOC(item))
    IF (rval == -1) THEN
        CALL ControlError("ListViewSetSelectedIndex", controlId, &amp;amp;
            "LVM_SETITEM")
    END IF
END SUBROUTINE ListViewSetSelectedIndex


!
! Returns the 1-based index of the currently selected item in a list view,
! or -1 if nothing is selected.
!
INTEGER FUNCTION ListViewGetSelectedIndex (hwnd, controlId, top) RESULT(index)

    IMPLICIT NONE

    INTEGER(HANDLE), INTENT(IN)    :: hwnd
    INTEGER, INTENT(IN)            :: controlId
	INTEGER, INTENT(INOUT),OPTIONAL:: top

    INTEGER                        :: rval
    INTEGER                        :: nItems
    TYPE(T_LV_ITEM)                :: lvitem
	TYPE(T_RECT)				   :: rect
    INTEGER                        :: i

    nItems = ListViewGetNumItems (hwnd, controlId)
    DO i = 0, nItems - 1
        lvitem%mask		 = LVIF_STATE
        lvitem%iItem	 = i
        lvitem%iSubitem	 = 0
        lvitem%stateMask = LVIS_SELECTED
        rval = SendControlMessage (hwnd, controlId, LVM_GETITEM, 0, LOC(lvitem))
        IF(rval /= 0) THEN
            IF (lvitem%state == LVIS_SELECTED) THEN
                IF (PRESENT(top)) THEN
					rval = SendControlMessage (hwnd, controlId, LVM_GETITEMRECT, i, LOC(rect))
					top = rect%top
				END IF
				index = i + 1
                RETURN
            END IF
        ELSE
            CALL ControlError("ListViewGetSelectedItem", controlId, "LVM_GETITEM")
        END IF
    END DO
    index = -1

END FUNCTION ListViewGetSelectedIndex

[/bash]</description>
      <pubDate>Tue, 12 Jun 2012 13:38:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-use-ListView-GetCheckState/m-p/803940#M39211</guid>
      <dc:creator>Paul_Curtis</dc:creator>
      <dc:date>2012-06-12T13:38:12Z</dc:date>
    </item>
  </channel>
</rss>

