本文整理汇总了C++中ListView_GetSelectionMark函数的典型用法代码示例。如果您正苦于以下问题:C++ ListView_GetSelectionMark函数的具体用法?C++ ListView_GetSelectionMark怎么用?C++ ListView_GetSelectionMark使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ListView_GetSelectionMark函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: BreakpointListProc
static LRESULT CALLBACK BreakpointListProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message)
{
case WM_KEYDOWN:
if(wParam == VK_RETURN)
{
int index = ListView_GetSelectionMark(hDlg);
SendMessage(GetParent(hDlg),WM_DEB_GOTOBREAKPOINT,index,0);
return 0;
} else if (wParam == VK_DELETE)
{
int index = ListView_GetSelectionMark(hDlg);
SendMessage(GetParent(hDlg),WM_DEB_REMOVEBREAKPOINT,index,0);
return 0;
} else if (wParam == VK_TAB)
{
SendMessage(GetParent(hDlg),WM_DEB_TABPRESSED,0,0);
return 0;
}
break;
case WM_GETDLGCODE:
if (lParam && ((MSG*)lParam)->message == WM_KEYDOWN)
{
if (wParam == VK_TAB) return DLGC_WANTMESSAGE;
}
break;
};
return (LRESULT)CallWindowProc((WNDPROC)DefBreakpointListProc,hDlg,message,wParam,lParam);;
}
开发者ID:173210,项目名称:ppsspp,代码行数:31,代码来源:Debugger_Disasm.cpp
示例2: GetWindowLongPtr
LRESULT CALLBACK CtrlBreakpointList::wndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
CtrlBreakpointList* bp = (CtrlBreakpointList*) GetWindowLongPtr(hwnd,GWLP_USERDATA);
switch(message)
{
case WM_SIZE:
{
int width = LOWORD(lParam);
RECT rect;
GetWindowRect(hwnd,&rect);
int totalListSize = (rect.right-rect.left-20);
for (int i = 0; i < BPL_COLUMNCOUNT; i++)
{
ListView_SetColumnWidth(hwnd,i,breakpointColumns[i].size * totalListSize);
}
}
break;
case WM_KEYDOWN:
if(wParam == VK_RETURN)
{
int index = ListView_GetSelectionMark(hwnd);
bp->editBreakpoint(index);
return 0;
} else if (wParam == VK_DELETE)
{
int index = ListView_GetSelectionMark(hwnd);
bp->removeBreakpoint(index);
return 0;
} else if (wParam == VK_TAB)
{
SendMessage(GetParent(hwnd),WM_DEB_TABPRESSED,0,0);
return 0;
} else if (wParam == VK_SPACE)
{
int index = ListView_GetSelectionMark(hwnd);
bp->toggleEnabled(index);
}
break;
case WM_GETDLGCODE:
if (lParam && ((MSG*)lParam)->message == WM_KEYDOWN)
{
if (wParam == VK_TAB || wParam == VK_RETURN) return DLGC_WANTMESSAGE;
}
break;
};
return (LRESULT)CallWindowProc((WNDPROC)bp->oldProc,hwnd,message,wParam,lParam);
}
开发者ID:Bulkman,项目名称:ppsspp,代码行数:50,代码来源:Debugger_Lists.cpp
示例3: GetDlgItem
void COutputDialog::OnNMClickListFilter(NMHDR *pNMHDR, LRESULT *pResult)
{
//LPNMITEMACTIVATE pNMItemActivate = reinterpret_cast<NMITEMACTIVATE>(pNMHDR);
CWnd* pList = GetDlgItem(IDC_LIST_FILTER);
int nSelected = ListView_GetSelectionMark(pList->m_hWnd);
BOOL bFilterSelected = FALSE;
if (nSelected >= 0)
{
bFilterSelected = TRUE;
}
CWnd* pBtnFilterSetting = GetDlgItem(IDC_BTN_FILTER_SETTING);
CWnd* pBtnFilterDelete = GetDlgItem(IDC_BTN_FILTER_DELETE);
CWnd* pBtnFilterUp = GetDlgItem(IDC_BTN_FILTER_UP);
CWnd* pBtnFilterDown = GetDlgItem(IDC_BTN_FILTER_DOWN);
if(pBtnFilterSetting && ::IsWindow(pBtnFilterSetting->m_hWnd))
pBtnFilterSetting->EnableWindow(bFilterSelected);
if(pBtnFilterDelete && ::IsWindow(pBtnFilterDelete->m_hWnd))
pBtnFilterDelete->EnableWindow(bFilterSelected);
if(pBtnFilterUp && ::IsWindow(pBtnFilterUp->m_hWnd))
pBtnFilterUp->EnableWindow(bFilterSelected);
if(pBtnFilterDown && ::IsWindow(pBtnFilterDown->m_hWnd))
pBtnFilterDown->EnableWindow(bFilterSelected);
if(pResult) *pResult = 0;
}
开发者ID:CodeGenerater,项目名称:araltrans02,代码行数:29,代码来源:OutputDialog.cpp
示例4: DlgMsgProc
LRESULT CALLBACK DlgMsgProc(
HWND hWnd,
UINT Msg,
WPARAM wParam,
LPARAM lParam )
{
HWND parentHWnd = (HWND)GetWindowLong(hWnd,GWL_HWNDPARENT);
wchar_t buff[2048]; wmemset(buff,'\0',2048);
wchar_t* pos=NULL;
switch (Msg)
{
case WM_DESTROY:
EndDialog(hWnd,0);
break;
case WM_INITDIALOG:
wcscpy_s (buff,2048,mLogWnd[parentHWnd].vList[ListView_GetSelectionMark(mLogWnd[parentHWnd].hListView)].c_str());
while ((pos=wcsstr(buff,L":|:"))!=NULL)
{wcscpy_s(buff,2048,pos+3);}
SetDlgItemText(hWnd,IDC_EDIT1,buff);
break;
case WM_COMMAND:
if (wParam == IDOK)
{EndDialog(hWnd,0);}
break;
case WM_SYSCOMMAND:
if (wParam ==SC_CLOSE)
{
EndDialog(hWnd,0);
}
default:
return (0);
}
return (0);
}
开发者ID:Joelone,项目名称:MLEA,代码行数:34,代码来源:_main.cpp
示例5: ListView_GetSelectionMark
bool GUI_manager::remove_IMG() {
char buffer[MAX_PATH+1];
char internal_name[20];
int item = ListView_GetSelectionMark(IMG_list);
int count = ListView_GetItemCount(IMG_list);
bool removed = false;
if( item > -1 ) {
ListView_GetItemText(IMG_list,item,2,buffer,MAX_PATH);
ListView_GetItemText(IMG_list,item,3,internal_name,sizeof internal_name);
if( strlen(buffer) && strlen(internal_name) ) {
if( uploader->remove_img_file(buffer,internal_name) && !removed )
removed = true;
}
if( ListView_DeleteItem(IMG_list,item) ) {
removed = true;
if( (item+1) >= count )
item--;
}
SetSelection(IMG_list,item);
show_size();
}
uploader->remove_all();
return removed;
}
开发者ID:casaretto,项目名称:cgpsmapper,代码行数:25,代码来源:gui_sendmap.cpp
示例6: RankProfView_OnDoubleClick
static LRESULT RankProfView_OnDoubleClick(HWND hwndParent, HWND hwnd)
{
int index = ListView_GetSelectionMark(hwnd);
if (index >= 0) {
TCHAR trfltP2Name[MAX_PATH + 1];
LVITEM item;
item.mask = LVIF_TEXT;
item.iItem = index;
item.iSubItem = 0;
item.cchTextMax = _countof(trfltP2Name);
item.pszText = trfltP2Name;
ListView_GetItem(hwnd, &item);
TCHAR countStr[32];
item.mask = LVIF_TEXT;
item.iItem = index;
item.iSubItem = 1;
item.cchTextMax = _countof(countStr);
item.pszText = countStr;
ListView_GetItem(hwnd, &item);
SCORELINE_FILTER_DESC *pFilterDesc =
reinterpret_cast<SCORELINE_FILTER_DESC *>(::GetWindowLongPtr(hwndParent, GWL_USERDATA));
SCORELINE_FILTER_DESC filterDesc = *pFilterDesc;
filterDesc.mask |= SCORELINE_FILTER__P2NAME | SCORELINE_FILTER__LIMIT;
::lstrcpynA(filterDesc.p2name, MinimalT2A(trfltP2Name), _countof(filterDesc.p2name) - 1);
filterDesc.p1name[_countof(filterDesc.p1name) - 1] = 0;
filterDesc.limit = ::StrToInt(countStr);
TrackRecordDialog_ShowModeless(::GetParent(hwndParent), &filterDesc);
}
return FALSE;
}
开发者ID:hxdnshx,项目名称:SolfiskMod,代码行数:34,代码来源:RankProfDlg.cpp
示例7: RemoveDataBp
void RemoveDataBp(HWND hwnd)
{
HWND hwndLV = GetDlgItem(hwnd, IDC_BPLIST);
int k = ListView_GetSelectionMark(hwndLV);
int n = ListView_GetItemCount(hwndLV);
int i,j;
for (i=n-1; i >=0; i--)
{
DATABREAK **search = &dataBpList, *found;
LVITEM item;
memset(&item, 0, sizeof(item));
item.iItem = i;
item.iSubItem = 0;
item.mask = LVIF_STATE;
item.stateMask = LVIS_SELECTED;
ListView_GetItem(hwndLV, &item);
if (item.state & LVIS_SELECTED)
{
for (j=0; j <i; j++)
search = &(*search)->next;
found = *search;
*search = found->next;
free(found);
ListView_DeleteItem(hwndLV, i);
}
ListView_SetSelectionMark(hwndLV, i);
ListView_SetItemState(hwndLV, i, LVIS_SELECTED, LVIS_SELECTED);
}
}
开发者ID:bencz,项目名称:OrangeC,代码行数:29,代码来源:brkdata.c
示例8: lv_get_selection_pos
/* Returns a selected item or -1 if no selection.
Assumes that the list is single-sel */
int lv_get_selection_pos(HWND hwnd)
{
int selection;
int selected_count = ListView_GetSelectedCount(hwnd);
assert(selected_count <= 1);
if (0 == selected_count)
return -1;
selection = ListView_GetSelectionMark(hwnd);
return selection;
}
开发者ID:wzhsunn,项目名称:SumatraPDF_0.6_Source,代码行数:12,代码来源:win_util.c
示例9: ListView_GetSelectionMark
void ListSort::sort()
{
int idx = ListView_GetSelectionMark(_hwnd);
LPARAM param = ListView_GetItemData(_hwnd, idx);
ListView_SortItems(_hwnd, _compare_fct, (LPARAM)this);
if (idx >= 0) {
idx = ListView_FindItemPara(_hwnd, param);
ListView_EnsureVisible(_hwnd, idx, FALSE);
}
}
开发者ID:svn2github,项目名称:ros-explorer,代码行数:12,代码来源:window.cpp
示例10: dbg_print
void CBuddyManager::OnBuddySelected()
{
BUDDY_INFO *pBI = NULL;
BUDDY_INFO BI;
dbg_print("OnBuddySelected");
int i = ListView_GetSelectionMark(g_hwndListBuddy);
g_bRunningQuery = true;
if(i!=-1)
{
SetCursor(LoadCursor(NULL, IDC_APPSTARTING));
LVITEM lvItem;
memset(&lvItem,0,sizeof(LVITEM));
lvItem.mask = LVIF_PARAM ;
lvItem.iItem = i;
lvItem.iSubItem = 0;
if(ListView_GetItem( g_hwndListBuddy, &lvItem))
{
ListView_DeleteAllItems(g_hwndListViewVars);
ListView_DeleteAllItems(g_hwndListViewPlayers);
vecBI::iterator vecBI_it = find(BuddyList.begin(),BuddyList.end(),(DWORD)lvItem.lParam);
if( vecBI_it != BuddyList.end())
{
BI = (BUDDY_INFO)*vecBI_it;
if(BI.sIndex!=-1)
{
try
{
if(BI.sIndex<gm.GamesInfo[BI.cGAMEINDEX].vSI.size())
{
SERVER_INFO *pSI = gm.GamesInfo[BI.cGAMEINDEX].vSI.at((int)BI.sIndex);
gm.GetServerInfo(BI.cGAMEINDEX,pSI);
}
}
catch(const exception& e)
{
m_log.AddLogInfo(0,"Access Violation!!! %s (OnBuddySelected)\n",e.what());
}
UpdateCurrentServerUI();
}
}//if pSrv
}
}
g_bRunningQuery = false;
}
开发者ID:elitak,项目名称:gamescanner,代码行数:53,代码来源:BuddyManager.cpp
示例11: RemoveSoundFromList
BOOL RemoveSoundFromList(HWND hList)
{
int iSel = ListView_GetSelectionMark(hList);
if (iSel != -1)
{
iSel = -1;
while ((iSel = ListView_GetNextItem(hList, iSel, LVNI_SELECTED)) != -1)
ListView_SetItemText(hList, iSel, 1, TranslateT(DEFAULT_SOUND));
return TRUE;
}
return FALSE;
}
开发者ID:TonyAlloa,项目名称:miranda-dev,代码行数:13,代码来源:indsnd.cpp
示例12: do_regjump
int do_regjump(HWND hlistview)
{
int index;
index=ListView_GetSelectionMark(hlistview);
if(index>=0){
char str[512]={0};
int str_size=sizeof(str);
ListView_GetItemText(hlistview,index,1,str,str_size);
if(str[0]!=0){
char cmd[1024]={0};
_snprintf(cmd,sizeof(cmd),"%s%s","HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\",str);
ShellExecute(hlistview,"open","regjump.exe",cmd,NULL,SW_SHOWNORMAL);
}
}
}
开发者ID:pinchyCZN,项目名称:Uninstaller,代码行数:15,代码来源:UNinstaller.c
示例13: SelectMenu
void SelectMenu(int selectedItem = -1)
{
if (selectedItem == -1)
{
selectedItem = ListView_GetSelectionMark(hMenuView.GetHwnd());
if (selectedItem == -1)
return;
}
switch (selectedItem)
{
case 0:
ShowWindow(hWndTabConfig, SW_SHOW);
ShowWindow(hWndTabPlugins, SW_HIDE);
ShowWindow(hWndTabThemes, SW_HIDE);
ShowWindow(hWndTabLanguages, SW_HIDE);
ShowWindow(hWndTabKeyboards, SW_HIDE);
break;
case 1:
ShowWindow(hWndTabConfig, SW_HIDE);
ShowWindow(hWndTabPlugins, SW_SHOW);
ShowWindow(hWndTabThemes, SW_HIDE);
ShowWindow(hWndTabLanguages, SW_HIDE);
ShowWindow(hWndTabKeyboards, SW_HIDE);
break;
case 2:
ShowWindow(hWndTabConfig, SW_HIDE);
ShowWindow(hWndTabPlugins, SW_HIDE);
ShowWindow(hWndTabThemes, SW_SHOW);
ShowWindow(hWndTabLanguages, SW_HIDE);
ShowWindow(hWndTabKeyboards, SW_HIDE);
break;
case 3:
ShowWindow(hWndTabConfig, SW_HIDE);
ShowWindow(hWndTabPlugins, SW_HIDE);
ShowWindow(hWndTabThemes, SW_HIDE);
ShowWindow(hWndTabLanguages, SW_SHOW);
ShowWindow(hWndTabKeyboards, SW_HIDE);
break;
case 4:
ShowWindow(hWndTabConfig, SW_HIDE);
ShowWindow(hWndTabPlugins, SW_HIDE);
ShowWindow(hWndTabThemes, SW_HIDE);
ShowWindow(hWndTabLanguages, SW_HIDE);
ShowWindow(hWndTabKeyboards, SW_SHOW);
break;
}
}
开发者ID:grimtraveller,项目名称:sally-project,代码行数:48,代码来源:main.cpp
示例14: _ext_disk_num
int _ext_disk_num(
HWND hwnd
)
{
wchar_t vol[MAX_PATH];
wchar_t *num_offset;
_get_item_text(
hwnd, ListView_GetSelectionMark(hwnd), 0, vol, sizeof_w(vol)
);
num_offset = wcschr(vol, ' ');
return (
num_offset ? _wtoi(num_offset) : -1
);
}
开发者ID:capturePointer,项目名称:diskcryptor,代码行数:17,代码来源:subs.c
示例15: ListView_GetSelectionMark
//returns anything between 0 - 0xFFFFFFFF-1
//0xFFFFFFFF = unsuccessfull
DWORD CBuddyManager::GetBuddyIDBySelection()
{
int n = ListView_GetSelectionMark(g_hwndListBuddy);
if(n != -1)
{
LVITEM lvItem;
memset(&lvItem,0,sizeof(LVITEM));
lvItem.mask = LVIF_PARAM ;
lvItem.iItem = n;
lvItem.iSubItem = 0;
if(ListView_GetItem( g_hwndListBuddy, &lvItem))
{
return (DWORD)lvItem.lParam;
}
}
return 0xFFFFFFFF;
}
开发者ID:elitak,项目名称:gamescanner,代码行数:20,代码来源:BuddyManager.cpp
示例16: OnAdminModifyClick
LONG OnAdminModifyClick(HWND hDlg,UINT message,WPARAM wParam,LPARAM lParam)
{
ModifyMark = ListView_GetSelectionMark(hWndList)+1;
if (ModifyMark !=0)
{
//读取限速器类型文件
HANDLE hFile = CreateFile(TypeFileName,
GENERIC_READ ,
FILE_SHARE_READ,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
0);
if( hFile == INVALID_HANDLE_VALUE)
return FALSE;
int index = 0;
char detector[120] = {NULL};//读取文件内容到该缓存
char buf[20] = {NULL};
DWORD dwRead = -1;
SetFilePointer(hFile,(ModifyMark-1)*120,NULL,FILE_CURRENT);
ReadFile(hFile,(LPVOID)detector,120,&dwRead,NULL);
_stprintf_s(TestsFileName,50,_T("\\NandFlash\\detector_"));
memcpy(TestsFileName+20,detector+20,5);
int i = 0;
for (i = 0; i <5; i++)
{
if (detector[20+i*2] == NULL)
{
break;;
}
}
_stprintf_s(TestsFileName+20+i,60,_T(".txt"));
CloseHandle(hFile);
DialogBox(NULL,MAKEINTRESOURCE(IDD_DIALOG_Admin_Add),NULL,DlgAdminAddPorc);
//DialogBox(NULL,MAKEINTRESOURCE(IDD_DIALOG_OPERATOR),NULL,DlgOperatorPorc);
CommandBar_Show(NULL, FALSE);
EndDialog(hDlg,0);
}
return TRUE;
}
开发者ID:githubdu,项目名称:Governor-Test,代码行数:44,代码来源:Admin.cpp
示例17: LOWORD
BOOL AP_Win32Dialog_ListRevisions::_onCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
{
WORD wId = LOWORD(wParam);
switch (wId)
{
case IDCANCEL:
m_answer = a_CANCEL;
EndDialog(hWnd,0);
return 1;
case IDOK:
{
HWND h = GetDlgItem(hWnd, AP_RID_DIALOG_LIST_REVISIONS_LIST);
int iSelCount = ListView_GetSelectedCount(h);
m_answer = a_OK;
if(iSelCount)
{
LVITEMW item;
item.iSubItem = 0;
item.iItem = ListView_GetSelectionMark(h);
item.mask = LVIF_PARAM;
item.pszText = 0;
item.cchTextMax = 0;
ListView_GetItem(h,&item);
m_iId = item.lParam;
}
else
m_iId = 0;
EndDialog(hWnd,0);
return 1;
}
default: // we did not handle this notification
UT_DEBUGMSG(("WM_Command for id %ld\n",wId));
return 0; // return zero to let windows take care of it.
}
}
开发者ID:lokeshguddu,项目名称:AbiWord,代码行数:42,代码来源:ap_Win32Dialog_ListRevisions.cpp
示例18: GetDlgItem
BOOL Dlg_GameLibrary::LaunchSelected()
{
HWND hList = GetDlgItem(m_hDialogBox, IDC_RA_LBX_GAMELIST);
const int nSel = ListView_GetSelectionMark(hList);
if (nSel != -1)
{
TCHAR buffer[1024];
ListView_GetItemText(hList, nSel, 1, buffer, 1024);
SetWindowText(GetDlgItem(m_hDialogBox, IDC_RA_GLIB_NAME), buffer);
ListView_GetItemText(hList, nSel, 3, buffer, 1024);
_RA_LoadROM(Narrow(buffer).c_str());
return TRUE;
}
else
{
return FALSE;
}
}
开发者ID:RetroAchievements,项目名称:RASuite,代码行数:20,代码来源:RA_Dlg_GameLibrary.cpp
示例19: ParseNewFileData
static int ParseNewFileData(HWND hwnd)
{
int rv = 1;
GetWindowText(GetDlgItem(hwnd, IDC_FILENEWFILE), newTitle, sizeof(newTitle));
if (newTitle[0] == 0)
{
ExtendedMessageBox("Add New File", 0, "Please specify a new file name");
rv = 0;
}
else
{
LVITEM item;
memset(&item, 0, sizeof(item));
item.mask = LVIF_PARAM;
item.iItem = ListView_GetSelectionMark(GetDlgItem(hwnd, IDC_LVNEWFILE));
ListView_GetItem(GetDlgItem(hwnd, IDC_LVNEWFILE), &item);
newMode = item.lParam;
}
return rv;
}
开发者ID:jossk,项目名称:OrangeC,代码行数:22,代码来源:prjfile.c
示例20: add_row_tablewindow
static int add_row_tablewindow(TABLE_WINDOW *win,HWND hlistview)
{
int i,count,row;
if(win==0 || hlistview==0)
return FALSE;
count=ListView_GetItemCount(win->hlistview);
row=ListView_GetSelectionMark(win->hlistview);
if(row<0)
row=count;
else
row++;
count=ListView_GetItemCount(hlistview);
for(i=0;i<count;i++){
char str[255]={0};
ListView_GetItemText(hlistview,i,DATA_POS,str,sizeof(str));
lv_insert_data(win->hlistview,row,i,str);
}
ListView_EnsureVisible(win->hlistview,row,FALSE);
ListView_SetSelectionMark(win->hlistview,row);
ListView_SetItemState(win->hlistview,row,LVIS_SELECTED|LVIS_FOCUSED,LVIS_SELECTED|LVIS_FOCUSED);
return TRUE;
}
开发者ID:pinchyCZN,项目名称:DB_UTIL,代码行数:22,代码来源:insert_row.c
注:本文中的ListView_GetSelectionMark函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论