This test code works same way in both compilers.
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <commctrl.h>
#ifndef ListView_SetOutlineColor
#define ListView_SetOutlineColor(hwnd, color) (COLORREF)SNDMSG((hwnd), LVM_SETOUTLINECOLOR, (WPARAM)0, (LPARAM)(COLORREF)(color))
#endif
#pragma comment(linker, \
"\"/MANIFESTDEPENDENCY:type='Win32' "\
"name='Microsoft.Windows.Common-Controls' "\
"version='6.0.0.0' "\
"processorArchitecture='*' "\
"publicKeyToken='6595b64144ccf1df' "\
"language='*'\"")
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
HWND MakeListView(HWND hWnd);
void Test1(HWND hWndLV);
TCHAR *szAppName = TEXT("WLV_List");
TCHAR *szFrameClass = TEXT("cWLV_List");
HWND hFrame, hWndLV;
HANDLE hInst;
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
WNDCLASSEX wcx;
MSG msg;
wcx.cbSize = sizeof(WNDCLASSEX);
wcx.style = CS_HREDRAW | CS_VREDRAW;
wcx.lpfnWndProc = (WNDPROC) WndProc;
wcx.cbClsExtra = 0;
wcx.cbWndExtra = 0;
wcx.hInstance = hInstance;
wcx.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wcx.hCursor = LoadCursor(NULL, IDC_ARROW);
wcx.hbrBackground= (HBRUSH)COLOR_3DSHADOW;
wcx.lpszMenuName = NULL;
wcx.lpszClassName= szFrameClass;
wcx.hIconSm = 0;
if (!RegisterClassEx(&wcx))
return 0;
hInst = hInstance;
hFrame = CreateWindowEx(0, szFrameClass, szAppName,
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT,
200, 400,
NULL, NULL, hInst, NULL);
if(!hFrame) return 0;
ShowWindow(hFrame, nCmdShow);
//UpdateWindow(hFrame);
while(GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch(uMsg) {
case WM_SIZE:
//MoveWindow(hWndLV, 0, 0, LOWORD(lParam), HIWORD(lParam), 0);
MoveWindow(hWndLV, 0, 0, 150, HIWORD(lParam), 0);
return 0;
case WM_CREATE:
hWndLV = MakeListView(hWnd);
Test1(hWndLV);
return 0;
case WM_DESTROY:
PostQuitMessage(0);
return 0;
}
return DefWindowProc(hWnd, uMsg, wParam, lParam);
}
HWND MakeListView(HWND hWnd) {
HWND hWndLV;
hWndLV = CreateWindowEx(WS_EX_CLIENTEDGE, WC_LISTVIEW, NULL,
WS_CHILD | WS_VISIBLE | WS_TABSTOP // | LVS_REPORT
,0, 0, 1, 1,
hWnd, 0, hInst, NULL);
ListView_SetExtendedListViewStyle(hWndLV, LVS_EX_BORDERSELECT);
//SendMessage(hWndLV,LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_GRIDLINES, LVS_EX_GRIDLINES);
return hWndLV;
}
void Test1(HWND hWndLV)
{
TCHAR szTmp[] = TEXT("rowx");
LVITEM lvi;
HIMAGELIST hImgLst = ImageList_Create(100, 100, ILC_MASK, 4, 4);
ListView_SetImageList(hWndLV, hImgLst, LVSIL_NORMAL);
ListView_SetIconSpacing(hWndLV, 100, 4);
COLORREF color = 0;
ListView_SetOutlineColor(hWndLV, color);
lvi.mask = LVIF_TEXT;
for (int i = 0; i < 9; i++) {
lvi.pszText = szTmp;
lvi.iItem = i;
lvi.iSubItem = 0;
szTmp[3] = i + '1';
ListView_InsertItem(hWndLV, &lvi);
}
SetFocus(hWndLV);
}
In PImagesViewer.exe listview borders are blue indeed.
List in Zoom window is better in PellesC version than MS, as MS version have unnecessary dividing area between pics.
Window resizing don't work in both programs.