I cannot find any documentation on this message. I can get it to call the message without fouling up the calling thread. We need CA (in the absence of the original winwidgets developers) to give us some documentation on the parameters and expected results of this windows message. (Parameters are *Object with the grid control name, then FirstSortColumn, FirstSortSeq, SecondSortColumn, SecondSortSeq, ThirdSortColumn, and ThirdSortSeq). Columns appear to be 0 based..
{
SORTINFO * sInfo;
LRESULT lr;
HWND hwndGrid = ObPanelAPI::GetControlHandleByName(&(1:));
if (hwndGrid)
{
lr = SendMessage(hwndGrid, HGM_GETCURRENTSORTSTATE, 0, (WPARAM) &sInfo); // changing the 0 to something else seems to have no impact
// lr seems to be the number of sort columns. User clicking only ever seems to set 1. Programmatically we can set at least three.
if (lr > 0) // at least one sort column
{
&(2:) = sInfo[0].iColumnNumber;
&(3:) = sInfo[0].bAscending;
}
else
{
&(2:) = -1;
&(3:) = TRUE;
}
if (lr >1) // at least two sort columns
{
&(4:) = sInfo[1].iColumnNumber;
&(5:) = sInfo[1].bAscending;
}
else
{
&(4:) = -1;
&(5:) = TRUE;
}
if (lr > 2) // at least three sort columns, probably specified programmatically
{
&(6:) = sInfo[2].iColumnNumber;
&(7:) = sInfo[2].bAscending;
}
else
{
&(6:) = -1;
&(7:) = TRUE;
}
}
else
{
// Grid not found.
}
}