Предмет:
Тип роботи:
Курсова робота
К-сть сторінок:
44
Мова:
Українська
};
break;
case 40001:
SendMessage(hDlg, WM_DEVICECHANGE, 0, 0);
break;
case IDC_EXIT:
FreeAllocDeviceNode();
FreeAllDeviceOrderNode();
DeleteCriticalSection(&criticalSection);
EndDialog(hDlg, 0);
break;
};
break;
};
break;
case WM_DEVICECHANGE:
{
EnterCriticalSection(&criticalSection);
WaitCursor(1);
FreeAllocDeviceNode();
FreeAllDeviceOrderNode();
if (!InitialDeviceList() || !InitialDeviceOrder())
EndDialog(hDlg, 0);
ListViewRemoveAllItems(GetDlgItem(hDlg, IDC_LIST1));
ListViewRemoveAllItems(GetDlgItem(hDlg, IDC_LIST2));
SetCharSet(IDC_LIST1, IDC_LIST2);
TreeViewRemoveAllNodes(hDlg, IDC_TREE1);
InitialImageData();
EnumWDMDriver(IDC_TREE1, IDB_MYCOMP);
WaitCursor(0);
LeaveCriticalSection(&criticalSection);
};
break;
case WM_NOTIFY:
{
NMHDR *pnmh = (NMHDR*)lParam;
switch(pnmh->idFrom)
{
case IDC_LIST1:
{
if (pnmh->code == NM_CLICK)
{
char szBuf[MAX_PATH] = {0};
HWND hList = GetDlgItem(hDlg, IDC_LIST1);
if (ListViewGetItemSelect(hList) == 10 ||
ListViewGetItemSelect(hList) == 11)
{
ListViewGetSpecItem(hList, 10, 1, szBuf);
if (*szBuf)
EnableWindow(GetDlgItem(hDlg, IDC_DELBTN), 1);
ListViewGetSpecItem(hList, 11, 1, szBuf);
if (*szBuf)
EnableWindow(GetDlgItem(hDlg, IDC_COPYPATHBTN), 1);
}
else
{
EnableWindow(GetDlgItem(hDlg, IDC_DELBTN), 0);
EnableWindow(GetDlgItem(hDlg, IDC_COPYPATHBTN), 0);
};
};
};
break;
case IDC_TREE1:
{
if (pnmh->code == TVN_SELCHANGED)
{
TVITEM tvItem = {0};
NMTREEVIEW *pnmhTree = (NMTREEVIEW*)lParam;
TreeViewGetSelectText(GetDlgItem(hDlg, IDC_TREE1),