• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ ListView_SetItemState函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中ListView_SetItemState函数的典型用法代码示例。如果您正苦于以下问题:C++ ListView_SetItemState函数的具体用法?C++ ListView_SetItemState怎么用?C++ ListView_SetItemState使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ListView_SetItemState函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: UpdateFilterGrid

void COutputDialog::OnBnClickedBtnFilterAdd()
{
	TCHAR szPluginName[MAX_PATH];
	szPluginName[0]=_T('\0');

	if ( DialogBoxParam(GetModuleHandle(_T("ATCTNR.dll")), MAKEINTRESOURCE(IDD_ADDFILTERDIALOG), 
		m_hWnd, AddPluginDialogProc, (LPARAM)szPluginName) == IDOK )
	{
		ATPLUGIN_ARGUMENT arg;
		arg.strPluginName=szPluginName;
		(MAINAPP)->m_cMultiPlugin.Add(arg);
		UpdateFilterGrid();

		CWnd* pList = GetDlgItem(IDC_LIST_FILTER);
		int nSelected = (MAINAPP)->m_cMultiPlugin.GetFilterCount() - 1;
		
		if(nSelected >= 0)
		{
			ListView_SetItemState(pList->m_hWnd, nSelected, LVIS_FOCUSED | LVIS_SELECTED, LVIS_FOCUSED | LVIS_SELECTED);
			::SetFocus(pList->m_hWnd);
			OnNMClickListFilter(NULL, NULL);
		}
	}
}
开发者ID:CodeGenerater,项目名称:araltrans02,代码行数:24,代码来源:OutputDialog.cpp


示例2: GetDlgItem

void COutputDialog::OnBnClickedBtnFilterDown()
{
	CWnd* pList = GetDlgItem(IDC_LIST_FILTER);
	int nSelected = ListView_GetSelectionMark(pList->m_hWnd);

	if (nSelected < 0) 
	{
		MessageBox(_T("플러그인을 먼저 선택해 주세요"), _T("Aral Trans"), MB_OK | MB_ICONINFORMATION );
	}
	else
	{
		if(nSelected < (MAINAPP)->m_cMultiPlugin.GetFilterCount()-1 )
		{
			(MAINAPP)->m_cMultiPlugin.MoveDown(nSelected);
			UpdateFilterGrid();
			nSelected++;
		}

		//ListView_SetSelectionMark(pList->m_hWnd, nSelected);
		ListView_SetItemState(pList->m_hWnd, nSelected, LVIS_FOCUSED | LVIS_SELECTED, LVIS_FOCUSED | LVIS_SELECTED);
		::SetFocus(pList->m_hWnd);
		OnNMClickListFilter(NULL, NULL);
	}
}
开发者ID:CodeGenerater,项目名称:araltrans02,代码行数:24,代码来源:OutputDialog.cpp


示例3: UpdateMultiple

static void UpdateMultiple(openfile* p)
{
	int Count,i;

	if (p->Flags & OPENFLAG_SINGLE) 
		return;

	if (p->Win.Smartphone || p->Win.PPCSoftMenu)
	{
		WinMenuCheck(&p->Win,1,OPENFILE_MORE,p->Multiple);
	}
	else
	{
		TBBUTTONINFO Button;
		Button.cbSize = sizeof(Button);
		Button.dwMask = TBIF_STATE;
		Button.fsState = TBSTATE_ENABLED;
		if (p->Multiple)
			Button.fsState |= TBSTATE_CHECKED;

		SendMessage(p->Win.WndTB,TB_SETBUTTONINFO,OPENFILE_MORE,(LPARAM)&Button);
	}

	p->OwnSelect = 1;

	Count = ListView_GetItemCount(p->WndList);
	for (i=0;i<Count;++i)
	{
		int State = 0;
		if (!p->Multiple && ListView_GetItemState(p->WndList,i,LVIS_FOCUSED)==LVIS_FOCUSED)
			State = LVIS_SELECTED;
		ListView_SetItemState(p->WndList,i,State,LVIS_SELECTED);
	}

	p->OwnSelect = 0;
}
开发者ID:BigHNF,项目名称:tcpmp-revive,代码行数:36,代码来源:openfile_win32.c


示例4: GetDlgItem

void CPlayListDlg::OnUp(BOOL fVisible)
{
	HWND hwndLV = GetDlgItem(m_hWnd, IDC_PLAY_LIST);
	SetFocus(hwndLV);

	int nCount = ListView_GetItemCount(hwndLV);
	if (ListView_GetItemState(hwndLV, 0, LVIS_SELECTED))
		return;

	for (int i = 1; i < nCount; i++) {
		if (ListView_GetItemState(hwndLV, i, LVIS_SELECTED)) {
			// ListViewの更新
			TCHAR szTitle[MAX_PATH] = {0};

			LVITEM li;
			memset(&li, 0, sizeof(LVITEM));
			li.mask = LVIF_TEXT | LVIF_IMAGE;
			li.iItem = i;
			li.pszText = szTitle;
			li.cchTextMax = MAX_PATH;
			ListView_GetItem(hwndLV, &li);
			ListView_DeleteItem(hwndLV, i);
			li.iItem = i - 1;
			ListView_InsertItem(hwndLV, &li);

			// プレイリストの更新
			m_pParent->UpFile(i);

			ListView_SetItemState(hwndLV, i - 1, 
				LVIS_FOCUSED | LVIS_SELECTED, LVIS_FOCUSED | LVIS_SELECTED);

			if (fVisible)
				ListView_EnsureVisible(hwndLV, i - 1, FALSE);
		}
	}
}
开发者ID:afriza,项目名称:GSPlayer,代码行数:36,代码来源:PlayListDlgPPC.cpp


示例5: ListView_GetNextItem

/* リスト中で選択されているキーワードを削除する */
void CPropKeyword::Delete_List_KeyWord( HWND hwndDlg, HWND hwndLIST_KEYWORD )
{
	int			nIndex1;
	LV_ITEM		lvi;

	nIndex1 = ListView_GetNextItem( hwndLIST_KEYWORD, -1, LVNI_ALL | LVNI_SELECTED );
	if( -1 == nIndex1 ){
		return;
	}
	lvi.mask = LVIF_PARAM;
	lvi.iItem = nIndex1;
	lvi.iSubItem = 0;
	ListView_GetItem( hwndLIST_KEYWORD, &lvi );
	/* n番目のセットのm番目のキーワードを削除 */
	m_Common.m_sSpecialKeyword.m_CKeyWordSetMgr.DelKeyWord( m_Common.m_sSpecialKeyword.m_CKeyWordSetMgr.m_nCurrentKeyWordSetIdx, lvi.lParam );
	/* ダイアログデータの設定 Keyword 指定キーワードセットの設定 */
	SetKeyWordSet( hwndDlg, m_Common.m_sSpecialKeyword.m_CKeyWordSetMgr.m_nCurrentKeyWordSetIdx );
	ListView_SetItemState( hwndLIST_KEYWORD, nIndex1, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED );

	//キーワード数を表示する。
	DispKeywordCount( hwndDlg );

	return;
}
开发者ID:lunaplus,项目名称:sakura-editor-fork,代码行数:25,代码来源:CPropComKeyword.cpp


示例6: SelectAll

static void SelectAll(openfile* p)
{
	LVITEM Item;
	int n;
	int State;

	p->OwnSelect = 1;

	for (n=0;n<ListView_GetItemCount(p->WndList);++n)
	{
		Item.iItem=n;
		Item.iSubItem=0;
		Item.mask=LVIF_PARAM;
		ListView_GetItem(p->WndList,&Item);

		State = 0;
		if (Item.lParam && (((openitem*)Item.lParam)->Image != IMG_DIR || p->SelectDir))
			State = LVIS_SELECTED;

		ListView_SetItemState(p->WndList,n,State,LVIS_SELECTED);
	}	

	p->OwnSelect = 0;
}
开发者ID:BigHNF,项目名称:tcpmp-revive,代码行数:24,代码来源:openfile_win32.c


示例7: CheatsListBox_Proc

//==============================================================================
BOOL CALLBACK CheatsListBox_Proc(HWND dialog, UINT msg,WPARAM wparam,LPARAM lparam)
{
	switch(msg)
	{
		case WM_INITDIALOG: 
		{
			LV_COLUMN lvColumn;
			u32 address = 0;
			u32 val = 0;

			cheatListView = GetDlgItem(dialog, IDC_LIST1);

			ListView_SetExtendedListViewStyle(cheatListView, LVS_EX_FULLROWSELECT | LVS_EX_TWOCLICKACTIVATE);
			
			memset(&lvColumn,0,sizeof(LV_COLUMN));
			lvColumn.mask=LVCF_FMT|LVCF_WIDTH|LVCF_TEXT;

			lvColumn.fmt=LVCFMT_CENTER;
			lvColumn.cx=20;
			lvColumn.pszText="X";
			ListView_InsertColumn(cheatListView, 0, &lvColumn);

			lvColumn.fmt=LVCFMT_LEFT;
			lvColumn.cx=84;
			lvColumn.pszText="Address";
			ListView_InsertColumn(cheatListView, 1, &lvColumn);
			lvColumn.cx=100;
			lvColumn.pszText="Value";
			ListView_InsertColumn(cheatListView, 2, &lvColumn);
			lvColumn.cx=245;
			lvColumn.pszText="Description";
			ListView_InsertColumn(cheatListView, 3, &lvColumn);
			lvColumn.fmt=LVCFMT_CENTER;

			LVITEM lvi;
			memset(&lvi,0,sizeof(LVITEM));
			lvi.mask = LVIF_TEXT|LVIF_STATE;
			lvi.iItem = INT_MAX;

			cheatsGetListReset();
			SendMessage(cheatListView, WM_SETREDRAW, (WPARAM)FALSE,0);
			while (cheatsGetList(&tempCheat))
			{
				char buf[256];
				if (tempCheat.enabled)
					lvi.pszText= "X";
				else
					lvi.pszText= "";
				switch (tempCheat.type)
				{
					case 0:					// Internal
					{
						u32 row = ListView_InsertItem(cheatListView, &lvi);
						wsprintf(buf, "0x02%06X", tempCheat.hi[0]);
						ListView_SetItemText(cheatListView, row, 1, buf);
						ltoa(tempCheat.lo[0], buf, 10);
						ListView_SetItemText(cheatListView, row, 2, buf);
						ListView_SetItemText(cheatListView, row, 3, tempCheat.description);
						break;
					}

					case 1:					// Action Replay
					{
						u32 row = ListView_InsertItem(cheatListView, &lvi);
						ListView_SetItemText(cheatListView, row, 1, "Action");
						ListView_SetItemText(cheatListView, row, 2, "Replay");
						ListView_SetItemText(cheatListView, row, 3, tempCheat.description);
						break;
					}

					case 2:					// Codebreaker
					{
						u32 row = ListView_InsertItem(cheatListView, &lvi);
						ListView_SetItemText(cheatListView, row, 1, "Code");
						ListView_SetItemText(cheatListView, row, 2, "breaker");
						ListView_SetItemText(cheatListView, row, 3, tempCheat.description);
						break;
					}
				}
			}
			SendMessage(cheatListView, WM_SETREDRAW, (WPARAM)TRUE,0);

			ListView_SetItemState(searchListView,0, LVIS_SELECTED|LVIS_FOCUSED, LVIS_SELECTED|LVIS_FOCUSED);
			SetFocus(searchListView);
			return TRUE;
		}

		case WM_NOTIFY:
			if (wparam == IDC_LIST1)
			{
				LPNMHDR tmp_msg = (LPNMHDR)lparam;
				if ( tmp_msg->code == LVN_ITEMACTIVATE )
				{
					cheatEditPos = ListView_GetNextItem(cheatListView, -1, LVNI_SELECTED|LVNI_FOCUSED);
					cheatsGet(&tempCheat, cheatEditPos);
					tempCheat.enabled = !tempCheat.enabled;
					switch (tempCheat.type)
					{
						case 0:		// internal
//.........这里部分代码省略.........
开发者ID:H8sn0w,项目名称:desmumewii,代码行数:101,代码来源:cheatsWin.cpp


示例8: RamWatchProc


//.........这里部分代码省略.........
					return true;
				case IDC_C_WATCH_EDIT:
					watchIndex = ListView_GetSelectionMark(GetDlgItem(hDlg,IDC_WATCHLIST));
					DialogBoxParam(hAppInst, MAKEINTRESOURCE(IDD_EDITWATCH), hDlg, (DLGPROC) EditWatchProc,(LPARAM) watchIndex);
					SetFocus(GetDlgItem(hDlg,IDC_WATCHLIST));
					return true;
				case IDC_C_WATCH:
					rswatches[WatchCount].Address = rswatches[WatchCount].WrongEndian = 0;
					rswatches[WatchCount].Size = 'b';
					rswatches[WatchCount].Type = 's';
					DialogBoxParam(hAppInst, MAKEINTRESOURCE(IDD_EDITWATCH), hDlg, (DLGPROC) EditWatchProc,(LPARAM) WatchCount);
					SetFocus(GetDlgItem(hDlg,IDC_WATCHLIST));
					return true;
				case IDC_C_WATCH_DUPLICATE:
					watchIndex = ListView_GetSelectionMark(GetDlgItem(hDlg,IDC_WATCHLIST));
					rswatches[WatchCount].Address = rswatches[watchIndex].Address;
					rswatches[WatchCount].WrongEndian = rswatches[watchIndex].WrongEndian;
					rswatches[WatchCount].Size = rswatches[watchIndex].Size;
					rswatches[WatchCount].Type = rswatches[watchIndex].Type;
					DialogBoxParam(hAppInst, MAKEINTRESOURCE(IDD_EDITWATCH), hDlg, (DLGPROC) EditWatchProc,(LPARAM) WatchCount);
					SetFocus(GetDlgItem(hDlg,IDC_WATCHLIST));
					return true;
				case IDC_C_WATCH_UP:
				{
					watchIndex = ListView_GetSelectionMark(GetDlgItem(hDlg,IDC_WATCHLIST));
					if (watchIndex == 0 || watchIndex == -1)
						return true;
					void *tmp = malloc(sizeof(AddressWatcher));
					memcpy(tmp,&(rswatches[watchIndex]),sizeof(AddressWatcher));
					memcpy(&(rswatches[watchIndex]),&(rswatches[watchIndex - 1]),sizeof(AddressWatcher));
					memcpy(&(rswatches[watchIndex - 1]),tmp,sizeof(AddressWatcher));
					free(tmp);
					ListView_SetSelectionMark(GetDlgItem(hDlg,IDC_WATCHLIST),watchIndex-1);
					ListView_SetItemState(GetDlgItem(hDlg,IDC_WATCHLIST),watchIndex-1,LVIS_FOCUSED|LVIS_SELECTED,LVIS_FOCUSED|LVIS_SELECTED);
					ListView_SetItemCount(GetDlgItem(hDlg,IDC_WATCHLIST),WatchCount);
					RWfileChanged=true;
					return true;
				}
				case IDC_C_WATCH_DOWN:
				{
					watchIndex = ListView_GetSelectionMark(GetDlgItem(hDlg,IDC_WATCHLIST));
					if (watchIndex >= WatchCount - 1 || watchIndex == -1)
						return true;
					void *tmp = malloc(sizeof(AddressWatcher));
					memcpy(tmp,&(rswatches[watchIndex]),sizeof(AddressWatcher));
					memcpy(&(rswatches[watchIndex]),&(rswatches[watchIndex + 1]),sizeof(AddressWatcher));
					memcpy(&(rswatches[watchIndex + 1]),tmp,sizeof(AddressWatcher));
					free(tmp);
					ListView_SetSelectionMark(GetDlgItem(hDlg,IDC_WATCHLIST),watchIndex+1);
					ListView_SetItemState(GetDlgItem(hDlg,IDC_WATCHLIST),watchIndex+1,LVIS_FOCUSED|LVIS_SELECTED,LVIS_FOCUSED|LVIS_SELECTED);
					ListView_SetItemCount(GetDlgItem(hDlg,IDC_WATCHLIST),WatchCount);
					RWfileChanged=true;
					return true;
				}
				case RAMMENU_FILE_AUTOLOAD:
				{
					AutoRWLoad ^= 1;
					CheckMenuItem(ramwatchmenu, RAMMENU_FILE_AUTOLOAD, AutoRWLoad ? MF_CHECKED : MF_UNCHECKED);
					break;
				}
				case RAMMENU_FILE_SAVEWINDOW:
				{
					RWSaveWindowPos ^=1;
					CheckMenuItem(ramwatchmenu, RAMMENU_FILE_SAVEWINDOW, RWSaveWindowPos ? MF_CHECKED : MF_UNCHECKED);
					break;
				}
开发者ID:snowasnow,项目名称:DeSmuME,代码行数:67,代码来源:ramwatch.cpp


示例9: NLSDlgProc

///////////////////////////////////////////////////////////////////////////////////////////
//    Function:        NLSDlgProc
//
//    Description:    Message-processing function for text tab
//
//    Comments:        
//
///////////////////////////////////////////////////////////////////////////////////////////
INT_PTR CALLBACK NLSDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    BOOL bProcessedMsg = TRUE;
    
    switch(uMsg)
    {
        case WM_INITDIALOG:
        {
            LVCOLUMN    lvcCol = {0};
            UINT        lcid = 0;
            LVFINDINFO  lvInfo = {0};
            int         iItem = 0;

            // load our own icon
            SendMessage(GetParent(hDlg), WM_SETICON, ICON_BIG, (LPARAM) (LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_MAINICON))));

            // Create our list column  for the listview control
            g_hwndList = GetDlgItem(hDlg, IDC_LV_LCID);
            g_hDlg = hDlg;

            lvcCol.mask = LVCF_TEXT;
            LoadString(g_hRes, STR_LANGID, g_tcsTemp, MAX_STR);
            lvcCol.pszText = g_tcsTemp;
            ListView_InsertColumn(g_hwndList, COLUMN_LANGID, (LV_COLUMN *)&lvcCol);

            LoadString(g_hRes, STR_LANG, g_tcsTemp, MAX_STR);
            lvcCol.pszText = g_tcsTemp;
            ListView_InsertColumn(g_hwndList, COLUMN_LANGUAGE, (LV_COLUMN *)&lvcCol);

            LoadString(g_hRes, STR_NLANG, g_tcsTemp, MAX_STR);
            lvcCol.pszText = g_tcsTemp;
            ListView_InsertColumn(g_hwndList, COLUMN_NATIVELANG, (LV_COLUMN *)&lvcCol);

            LoadString(g_hRes, STR_NCOUNTRY, g_tcsTemp, MAX_STR);
            lvcCol.pszText = g_tcsTemp;
            ListView_InsertColumn(g_hwndList, COLUMN_NATIVECOUNTRYREGION, (LV_COLUMN *)&lvcCol);

            LoadString(g_hRes, STR_ACP, g_tcsTemp, MAX_STR);
            lvcCol.pszText = g_tcsTemp;
            ListView_InsertColumn(g_hwndList, COLUMN_ACP, (LV_COLUMN *)&lvcCol);

            LoadString(g_hRes, STR_OEMCP, g_tcsTemp, MAX_STR);
            lvcCol.pszText = g_tcsTemp;
            ListView_InsertColumn(g_hwndList, COLUMN_OEMCP, (LV_COLUMN *)&lvcCol);

            // fill out our listview control with available locales (supported ones).
            EnumSystemLocales(EnumLocalesProc, LCID_SUPPORTED);

            // Initialize formatting fields related to the selected locale in the listview
            InitNLSFields(hDlg, LOCALE_USER_DEFAULT);

            // Set the column width of the listview control.
            ListView_SetColumnWidth(g_hwndList, COLUMN_LANGID, LVSCW_AUTOSIZE_USEHEADER);
            ListView_SetColumnWidth(g_hwndList, COLUMN_LANGUAGE, LVSCW_AUTOSIZE_USEHEADER);
            ListView_SetColumnWidth(g_hwndList, COLUMN_NATIVELANG, LVSCW_AUTOSIZE_USEHEADER);
            ListView_SetColumnWidth(g_hwndList, COLUMN_NATIVECOUNTRYREGION, LVSCW_AUTOSIZE_USEHEADER);
            ListView_SetColumnWidth(g_hwndList, COLUMN_ACP, LVSCW_AUTOSIZE_USEHEADER);
            ListView_SetColumnWidth(g_hwndList, COLUMN_OEMCP, LVSCW_AUTOSIZE_USEHEADER);

            // Find user's current locale and select that item in the listview control.
            lcid = GetUserDefaultLCID();
            
            // Our list has all the LCIDs in 4 digits (0409) whereas GetUserDefaultLCID returs (409).
            if (lcid < 0x1000)
            {
                _sntprintf(g_tcsTemp,MAX_STR,TEXT("0%x"), lcid);
            }
            else
            {
                _sntprintf(g_tcsTemp,MAX_STR,TEXT("%x"), lcid);
            }

            lvInfo.flags = LVFI_STRING;
            lvInfo.psz = g_tcsTemp;

            iItem = ListView_FindItem(g_hwndList, 0, &lvInfo);
            ListView_SetItemState (g_hwndList, iItem, LVIS_FOCUSED | LVIS_SELECTED, 0x000F);
            ListView_EnsureVisible(g_hwndList, iItem, FALSE);

            // Set some of the extended styles of our list view (cool reports ;-)
            ListView_SetExtendedListViewStyle(g_hwndList, LVS_EX_FULLROWSELECT | LVS_EX_HEADERDRAGDROP | LVS_EX_GRIDLINES | LVS_EX_TWOCLICKACTIVATE);
        }
        break;

        case WM_NOTIFY:
            switch (((NMHDR *)lParam)->code)
            {
                case LVN_COLUMNCLICK:
                    {
                        NM_LISTVIEW nmv;
                        static int iLastSort = COLUMN_LANGID;
                        LPARAM lSortParam = -1;
//.........这里部分代码省略.........
开发者ID:SatishSara,项目名称:zxlooong,代码行数:101,代码来源:nlsapi.c


示例10: switch


//.........这里部分代码省略.........
					RGB(255,0,255));
			}
			::SelectObject(hdcMem,hbmOld);
			::DeleteDC(hdcMem);
			::EndPaint(hDlg,&ps);
		}
		return TRUE;

	case WM_LBUTTONDOWN:
		{
			POINT pt;

			pt.x=GET_X_LPARAM(lParam);
			pt.y=GET_Y_LPARAM(lParam);
			if (m_hbmSelButtons!=NULL
					&& ::PtInRect(&m_ImageRect,pt)) {
				const CController *pController=GetCurController();
				if (pController==NULL)
					return TRUE;

				const int NumButtons=pController->NumButtons();
				for (int i=0;i<NumButtons;i++) {
					CController::ButtonInfo Button;
					RECT rc;

					pController->GetButtonInfo(i,&Button);
					rc.left=m_ImageRect.left+Button.ImageButtonRect.Left;
					rc.top=m_ImageRect.top+Button.ImageButtonRect.Top;
					rc.right=rc.left+Button.ImageButtonRect.Width;
					rc.bottom=rc.top+Button.ImageButtonRect.Height;
					if (::PtInRect(&rc,pt)) {
						HWND hwndList=::GetDlgItem(hDlg,IDC_CONTROLLER_ASSIGN);

						ListView_SetItemState(hwndList,i,
											  LVIS_FOCUSED | LVIS_SELECTED,
											  LVIS_FOCUSED | LVIS_SELECTED);
						ListView_EnsureVisible(hwndList,i,FALSE);
						::SetFocus(hwndList);
						break;
					}
				}
			}
		}
		return TRUE;

	case WM_SETCURSOR:
		if (LOWORD(lParam)==HTCLIENT) {
			if (m_hbmSelButtons!=NULL) {
				POINT pt;

				::GetCursorPos(&pt);
				::ScreenToClient(hDlg,&pt);
				if (::PtInRect(&m_ImageRect,pt)) {
					const CController *pController=GetCurController();
					if (pController==NULL)
						break;

					const int NumButtons=pController->NumButtons();
					for (int i=0;i<NumButtons;i++) {
						CController::ButtonInfo Button;
						RECT rc;

						pController->GetButtonInfo(i,&Button);
						rc.left=m_ImageRect.left+Button.ImageButtonRect.Left;
						rc.top=m_ImageRect.top+Button.ImageButtonRect.Top;
						rc.right=rc.left+Button.ImageButtonRect.Width;
开发者ID:DBCTRADO,项目名称:TVTest,代码行数:67,代码来源:Controller.cpp


示例11: win32ui_pokemem_proc

INT_PTR CALLBACK
win32ui_pokemem_proc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
  switch( msg ) {
    case WM_INITDIALOG:
      initialize_dialog( hWnd );
      return TRUE;

    case WM_COMMAND:
      switch( LOWORD( wParam ) ) {
        case IDOK:
          pokemem_update_list();
          EndDialog( hWnd, wParam );
          return 0;
        case IDCLOSE:
        case IDCANCEL:
          EndDialog( hWnd, wParam );
          return 0;
        case IDC_PM_ADD:
          pokemem_add_custom_poke();
          return 0;
      }
      break;

    case WM_CLOSE:
      EndDialog( hWnd, wParam );
      return 0;

    case WM_NOTIFY:
      if( LOWORD( wParam ) == IDC_PM_LIST ) {
        NMHDR *nmhdr = (NMHDR *) lParam;
        LPNMLISTVIEW lpnmitem;

        switch( nmhdr->code ) {

          case LVN_ITEMCHANGING:
          {
            lpnmitem = (LPNMLISTVIEW) lParam;
            if( lpnmitem->uChanged & LVIF_STATE ) {
              unsigned int new_state, old_state;
              new_state = ( lpnmitem->uNewState & LVIS_STATEIMAGEMASK ) >> 12;
              old_state = ( lpnmitem->uOldState & LVIS_STATEIMAGEMASK ) >> 12;
              trainer_t *trainer = (trainer_t *)lpnmitem->lParam;

              /* Prevent the check of disabled trainers */
              if( new_state != old_state && trainer->disabled )
              {
                SetWindowLongPtr( hWnd, DWLP_MSGRESULT, TRUE );
                return TRUE;
              }
            }
            break;
          }

          case LVN_ITEMCHANGED:
          {
            lpnmitem = (LPNMLISTVIEW) lParam;

            if( lpnmitem->uChanged & LVIF_STATE && lpnmitem->iItem >= 0 ) {
              unsigned int new_state, old_state;
              new_state = ( lpnmitem->uNewState & LVIS_STATEIMAGEMASK ) >> 12;
              old_state = ( lpnmitem->uOldState & LVIS_STATEIMAGEMASK ) >> 12;
              trainer_t *trainer = (trainer_t *)lpnmitem->lParam;

              /* Trainer checked, ask for custom value if needed */
              if( new_state != old_state && new_state == 2 && !trainer->active
                  && trainer->ask_value ) {
                ListView_SetItemState( nmhdr->hwndFrom, lpnmitem->iItem,
                                       LVIS_SELECTED, LVIS_SELECTED );
                create_custom_edit( nmhdr->hwndFrom, lpnmitem->iItem, 1 );
              }

              break;
            }
          }
        }
开发者ID:vamposdecampos,项目名称:fuse-emulator-svn,代码行数:76,代码来源:pokemem.c


示例12: NewFileProc

long APIENTRY NewFileProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM
    lParam)
{
    switch (message)
    {
        case WM_INITDIALOG:
           if (!CreateNewFileData(hwnd))
           {
                EndDialog(hwnd, 1);
           }
            else
            {
                CenterWindow(hwnd);
            }
            return 1;
        case WM_NOTIFY:
            if (((LPNMHDR)lParam)->code == NM_CUSTOMDRAW)
            {
                SetWindowLong(hwnd, DWL_MSGRESULT, CustomDrawNewFile(hwnd, (LPNMLVCUSTOMDRAW)lParam));
                return TRUE;
            }
            else if (((LPNMHDR)lParam)->code == LVN_KEYDOWN)
            {
                switch (((LPNMLVKEYDOWN)lParam)->wVKey)
                {
                    case VK_INSERT:
                        if (GetKeyState(VK_CONTROL) & 0x80000000)
                        {
                            HWND hwndLV = GetDlgItem(hwnd, IDC_LVNEWFILE);
                            ListView_SetSelectionMark(hwndLV, -1);
                        }
                        else
                        {
                            HWND hwndLV = GetDlgItem(hwnd, IDC_LVNEWFILE);
                            int i = ListView_GetSelectionMark(hwndLV);
                            ListView_SetSelectionMark(hwndLV, i);
                            ListView_SetItemState(hwndLV, i, LVIS_SELECTED, LVIS_SELECTED);
                        }
                        break;
                }
            }
            return 0;
        case WM_COMMAND:
            switch (wParam &0xffff)
            {
            case IDOK:
                if (ParseNewFileData(hwnd))
                    EndDialog(hwnd, IDOK);
                break;
            case IDCANCEL:
                EndDialog(hwnd, IDCANCEL);
                break;
            case IDHELP:
                ContextHelp(IDH_NEW_FILE_DIALOG);
                break;
            }
            break;
        case WM_CLOSE:
            PostMessage(hwnd, WM_COMMAND, IDCANCEL, 0);
            break;
    }
    return 0;
}
开发者ID:jossk,项目名称:OrangeC,代码行数:63,代码来源:prjfile.c


示例13: ListView_SetItemState

void HISTORY::redrawList()
{
	ListView_SetItemState(hwndHistoryList, historyCursorPos, LVIS_FOCUSED|LVIS_SELECTED, LVIS_FOCUSED|LVIS_SELECTED);
	ListView_EnsureVisible(hwndHistoryList, historyCursorPos, FALSE);
	InvalidateRect(hwndHistoryList, 0, FALSE);
}
开发者ID:sashavolv2,项目名称:tasbot,代码行数:6,代码来源:history.cpp


示例14: DlgProc_TransportLayer


//.........这里部分代码省略.........
                        Dbg(LoadString(g_hInst, DBG_Deleting_DLL, szQuestion, sizeof(szQuestion)));
                        
                        wsprintf(szMsg, szQuestion, szTransName);
                    }
                    
                    char szTitle[MAX_MSG_TXT];
                    Dbg(LoadString(g_hInst, DLG_Deleting_DLL_Title, szTitle, sizeof(szTitle)));
                    strcat(szTitle, "'");
                    strcat(szTitle, szTransName);
                    strcat(szTitle, "'");
                    
                    if (MessageBox(hwndDlg, szMsg, szTitle, MB_OKCANCEL | MB_TASKMODAL) == IDOK) {
                        // Did we erase the selected transport layer
                        if (pszSelectedTL && !strcmp(szTransName, pszSelectedTL)) {
                            
                            // Erased
                            FREE_STR(pszSelectedTL);
                        }
                        
                        // Remove the deleted TL from the reg list.
                        {
                            TListEntry<CIndiv_TL_WKSP *> * pContEntry =
                                g_pCCopyOf_All_TLs_WrkSpc->
                                m_listConts.Find(szTransName, WKSP_Generic_CmpRegName);
                            
                            Assert(pContEntry);
                            delete pContEntry->m_tData;
                            delete pContEntry;
                        }
                        
                        Dbg(ListView_DeleteItem(hwndList, nCurSel));
                        
                        // Select the first item, make sure something is always selected.
                        ListView_SetItemState(hwndList, 0, LVIS_SELECTED | LVIS_FOCUSED, 0x000F);
                        
                        BOOL bEmpty = ListView_GetItemCount(hwndList) <= 0;
                        EnableWindow(hwndEdit, !bEmpty);
                        EnableWindow(hwndSelect, !bEmpty);
                        EnableWindow(hwndDelete, !bEmpty);
                        
                        SetDlgItemText(hwndDlg, IDC_STEXT_SELECT, pszSelectedTL);
                    }
                }
                return FALSE;
                
            case IDC_BUT_EDIT:
                if (BN_CLICKED == wNotifyCode) {
                    int nCurSel = ListView_GetNextItem(hwndList, -1, LVNI_SELECTED);
                    Assert(-1 != nCurSel);
                    
                    char szTransName[MAX_MSG_TXT]; // Transport name
                    ListView_GetItemText(hwndList, nCurSel, 0, szTransName, sizeof(szTransName));
                    
                    TListEntry<CIndiv_TL_WKSP *> * pContEntry =
                        g_pCCopyOf_All_TLs_WrkSpc->
                        m_listConts.Find(szTransName, WKSP_Generic_CmpRegName);
                    
                    if (DialogBoxParam(g_hInst, MAKEINTRESOURCE(IDD_DLG_TRANSPORTLAYER), hwndDlg,
                        (DLGPROC)EditTransportLayersDlgProc, (LPARAM)pContEntry->m_tData)) {
                        
                        // Data has been changed, repopulate the list.
                        AddDataToList(hwndDlg, g_pCCopyOf_All_TLs_WrkSpc);
                    }
                    
                    BOOL bEmpty = ListView_GetItemCount(hwndList) <= 0;
                    EnableWindow(hwndEdit, !bEmpty);
开发者ID:maerson,项目名称:windbg,代码行数:67,代码来源:dbugdll.cpp


示例15: DlgProcConnectionNotifyOpts


//.........这里部分代码省略.........
			//fill exceptions list
			fillExceptionsListView(hwndDlg);
		}
		break;

	case WM_COMMAND://user changed something, so get changes to variables
		PostMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
		switch(LOWORD(wParam)) {
		case IDC_INTERVAL: settingInterval =GetDlgItemInt(hwndDlg, IDC_INTERVAL, NULL, FALSE); break;
		case IDC_INTERVAL1: settingInterval1 =GetDlgItemInt(hwndDlg, IDC_INTERVAL1, NULL, TRUE); break;
		case IDC_RESOLVEIP: settingResolveIp=(BYTE) IsDlgButtonChecked(hwndDlg, IDC_RESOLVEIP); break;
		case ID_CHK_DEFAULTACTION: settingDefaultAction=(BYTE) IsDlgButtonChecked(hwndDlg, ID_CHK_DEFAULTACTION); break;
		case ID_ADD:
			{
				struct CONNECTION *cur=(struct CONNECTION *)mir_alloc(sizeof(struct CONNECTION));
				memset(cur,0,sizeof(struct CONNECTION));
				cur->intExtPort=-1;
				cur->intIntPort=-1;
				cur->Pid=0;
				cur->PName[0]='*';
				cur->strExtIp[0]='*';
				cur->strIntIp[0]='*';

				if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_FILTER_DIALOG), hwndDlg, FilterEditProc, (LPARAM)cur)==IDCANCEL) {
					mir_free(cur);
					cur = NULL;
				}
				else {
					cur->next = connExceptionsTmp;
					connExceptionsTmp = cur;
				}

				fillExceptionsListView(hwndDlg);
				ListView_SetItemState(GetDlgItem(hwndDlg,IDC_LIST_EXCEPTIONS),0,LVNI_FOCUSED|LVIS_SELECTED , LVNI_FOCUSED|LVIS_SELECTED );
				SetFocus(GetDlgItem(hwndDlg,IDC_LIST_EXCEPTIONS));
			}
			break;

		case ID_DELETE: 
			{
				int pos,pos1;
				struct CONNECTION *cur = connExceptionsTmp, *pre = NULL;

				pos=(int)ListView_GetNextItem(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS),-1,LVNI_FOCUSED );
				if (pos==-1)break;
				pos1=pos;
				while(pos--)
				{
					pre=cur;
					cur=cur->next;
				}
				if (pre==NULL)
					connExceptionsTmp=connExceptionsTmp->next;
				else
					(pre)->next=cur->next;
				mir_free(cur);
				fillExceptionsListView(hwndDlg);
				ListView_SetItemState(GetDlgItem(hwndDlg,IDC_LIST_EXCEPTIONS),pos1,LVNI_FOCUSED|LVIS_SELECTED , LVNI_FOCUSED|LVIS_SELECTED );
				SetFocus(GetDlgItem(hwndDlg,IDC_LIST_EXCEPTIONS));
				break;
			}
		case ID_UP: 
			{
				int pos,pos1;
				struct CONNECTION *cur=NULL,*pre=NULL,*prepre=NULL;
开发者ID:MrtsComputers,项目名称:miranda-ng,代码行数:66,代码来源:ConnectionNotify.cpp


示例16: switch

BOOL plMultistageBehComponent::IDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
    switch (msg)
    {
    case WM_COMMAND:
        if (HIWORD(wParam) == BN_CLICKED)
        {
            // Adding a new stage
            if (LOWORD(wParam) == IDC_ADD)
            {
                // Create the new stage and give it a default name.
                plBaseStage* stage = new plStandardStage;
                int count = fStages.size();
                fStages.push_back(stage);
                char buf[64];
                sprintf(buf, "Stage %d", count);
                stage->SetName(buf);

                // Add the new stage to the list and make sure the list is wide enough
                HWND hList = GetDlgItem(fDlg, IDC_STAGE_LIST);
                int idx = ListView_AddString(hList, stage->GetName().c_str());
                ListView_SetColumnWidth(hList, 0, LVSCW_AUTOSIZE);
                ListView_SetItemState(hList, idx, LVIS_SELECTED, LVIS_SELECTED);

                // Put up the new stages dialog
                IDestroyStageDlg();
                fCurStage = idx;
                ICreateStageDlg();

                SetSaveRequiredFlag();
            }
            // Removing the selected stage
            else if (LOWORD(wParam) == IDC_REMOVE)
            {
                HWND hList = GetDlgItem(fDlg, IDC_STAGE_LIST);

                int sel = ListView_GetNextItem(hList, -1, LVNI_SELECTED);
                if (sel != -1)
                {
                    IDestroyStageDlg();

                    plBaseStage* stage = fStages[sel];
                    fStages.erase(fStages.begin()+sel);
                    delete stage;
                    ListView_DeleteItem(hList, sel);

                    SetSaveRequiredFlag();
                }
            }
            else if (LOWORD(wParam) == IDC_FREEZE_PHYS)
            {
                fFreezePhys = (Button_GetCheck((HWND)lParam) == BST_CHECKED);
                SetSaveRequiredFlag();
            }
            else if (LOWORD(wParam) == IDC_SMART_SEEK)
            {
                fSmartSeek = (Button_GetCheck((HWND)lParam) == BST_CHECKED);
                SetSaveRequiredFlag();
            }
            else if (LOWORD(wParam) == IDC_MULTI_REVERSE_CTL)
            {
                fReverseFBOnRelease = (Button_GetCheck((HWND)lParam) == BST_CHECKED);
                SetSaveRequiredFlag();
            }
            return TRUE;
        }
        break;

    case WM_NOTIFY:
        {
            NMHDR *nmhdr = (NMHDR*)lParam;
            if (nmhdr->idFrom == IDC_STAGE_LIST)
            {
                switch (nmhdr->code)
                {
                // Stop Max from reading keypresses while the list has focus
                case NM_SETFOCUS:
                    plMaxAccelerators::Disable();
                    return TRUE;
                case NM_KILLFOCUS:
                    plMaxAccelerators::Enable();
                    return TRUE;

                // The edit box this creates kills the focus on the listbox,
                // so add an extra disable to ignore it
                case LVN_BEGINLABELEDIT:
                    plMaxAccelerators::Disable();
                    return TRUE;

                // Finishing changing the name of a stage
                case LVN_ENDLABELEDIT:
                    {
                        NMLVDISPINFO *di = (NMLVDISPINFO*)lParam;
                        const char *name = di->item.pszText;

                        // If the name was changed...
                        if (name && *name != '\0')
                        {
                            plBaseStage* stage = fStages[fCurStage];
                            stage->SetName(name);
//.........这里部分代码省略.........
开发者ID:Filtik,项目名称:Plasma,代码行数:101,代码来源:plMultistageBehComponent.cpp


示例17: DlgProcPopupActions


//.........这里部分代码省略.........
					groups.insert(mir_strdup(szGroup), groups.getCount());
				}

				if (g_popup.isOsUnicode)
				{
					LVITEMW item = {0};
					item.mask = LVIF_IMAGE|LVIF_PARAM|LVIF_TEXT|LVIF_STATE|LVIF_INDENT;
					item.iItem = i;
					LPWSTR wszName = mir_a2u(szName);
					item.pszText = TranslateW(wszName);
					item.iImage = ImageList_AddIcon(hImgList, gActions[i]->lchIcon);
					item.lParam = i;
					if (IsWinVerXPPlus())
					{
						item.mask |= LVIF_GROUPID;
						item.iGroupId = grpId;
					}
					item.iIndent = 0;
					ListView_InsertItemW(hwndList, &item);
					mir_free(wszName);
				} else
				{
					LVITEMA item = {0};
					item.mask = LVIF_IMAGE|LVIF_PARAM|LVIF_TEXT|LVIF_STATE|LVIF_GROUPID|LVIF_INDENT;
					item.iItem = i;
					item.pszText = Translate(szName);
					item.iImage = ImageList_AddIcon(hImgList, gActions[i]->lchIcon);
					item.lParam = i;
					item.iGroupId = grpId;
					item.iIndent = 0;
					ListView_InsertItem(hwndList, &item);
				}

				ListView_SetItemState(hwndList, i, (gActions[i]->flags & PAF_ENABLED) ? 0x2000 : 0x1000, LVIS_STATEIMAGEMASK);
			}

			groups.destroy();

			BOOL enabled = (PopUpOptions.actions&ACT_ENABLE) ? TRUE : FALSE;
			for (i = 0; i < SIZEOF(controls); ++i)
				EnableWindow(GetDlgItem(hwnd, controls[i]), enabled);

			windowInitialized = true;
			break;
		}

		case WM_COMMAND:
		{
			switch (LOWORD(wParam))
			{
				case IDC_CHK_ENABLEACTIONS:
				{
					PopUpOptions.actions &= ~ACT_ENABLE;
					PopUpOptions.actions |= IsDlgButtonChecked(hwnd, IDC_CHK_ENABLEACTIONS) ? ACT_ENABLE : 0;
					SendMessage(GetParent(hwnd), PSM_CHANGED,0,0);

					BOOL enabled = (PopUpOptions.actions&ACT_ENABLE) ? TRUE : FALSE;
					for (int i = 0; i < SIZEOF(controls); ++i)
						EnableWindow(GetDlgItem(hwnd, controls[i]), enabled);
					break;
				}

				case IDC_CHK_IMCONTACTSONLY:
					PopUpOptions.actions &= ~ACT_DEF_IMONLY;
					PopUpOptions.actions |= IsDlgButtonChecked(hwnd, IDC_CHK_IMCONTACTSONLY) ? ACT_DEF_IMONLY : 0;
					SendMessage(GetParent(hwnd), PSM_CHANGED,0,0);
开发者ID:TonyAlloa,项目名称:miranda-dev,代码行数:67,代码来源:actions.cpp


示例18: ListView_SetItemState

void wxCheckListBox::DoSetSelection(int n, bool select)
{
    ListView_SetItemState(GetHwnd(), n, select ? LVIS_SELECTED : 0, LVIS_SELECTED);
}
开发者ID:0ryuO,项目名称:dolphin-avsync,代码行数:4,代码来源:checklst.cpp


示例19: ThreadProc

LRESULT CALLBACK ThreadProc(HWND hwnd, UINT iMessage, WPARAM
    wParam, LPARAM lParam)
{
    LV_ITEM item;
    LV_COLUMN lvC;
    RECT r;
    int i;
    char module[256];
    THREAD *sl;
    LPNMHDR nmh;
    switch (iMessage)
    {
        case WM_CTLCOLORSTATIC:
        {
            return (LRESULT)(HBRUSH)(COLOR_WINDOW + 1);
        }
        case WM_TIMER:
            KillTimer(hwnd, 100);
            ListView_SetItemState(hwndLV, curSel, 0, LVIS_SELECTED);
            break;
        case WM_NOTIFY:
            nmh = (LPNMHDR)lParam;
            if (nmh->code == NM_SETFOCUS)
            {
                PostMessage(hwndFrame, WM_REDRAWTOOLBAR, 0, 0);
                SendMessage(GetParent(hwnd), WM_ACTIVATEME, 0, 0);
            }
            else if (nmh->code == LVN_GETDISPINFO)
            {
                LV_DISPINFO *p = (LV_DISPINFO *)lParam;
                THREAD *x = (THREAD *)p->item.lParam;
                char name[256], name1[256];
                if (p->item.iSubItem == 2)
                {
                    int eip = x->regs.Eip;
                    int n;
                    n = FindFunctionName(name1, eip, NULL, NULL);
                    if (!n)
                        name1[0] = 0;
                    sprintf(name, "%s + 0x%x", name1, eip - n);
                }
                else
                {
                    sprintf(name, "%d", x->idThread);
                }
                p->item.mask |= LVIF_TEXT | LVIF_DI_SETITEM;
                p->item.mask &= ~LVIF_STATE;
                p->item.pszText = name;
            }
            else if (nmh->code == LVN_ITEMCHANGED)
            {
                LPNMLISTVIEW p = (LPNMLISTVIEW)lParam;
                if (p->uChanged & LVIF_STATE)
                {
                    if (p->uNewState & LVIS_SELECTED)
                    {
                        i = 0;
                        PostMessage(hwnd, WM_USER, p->iItem, 0);
                        SetTimer(hwnd, 100, 400, 0);
                    }
                }
            }
            else if (nmh->code == LVN_KEYDOWN)
            {
                switch (((LPNMLVKEYDOWN)lParam)->wVKey)
                {
                    case 'C':
                        if (GetKeyState(VK_CONTROL) &0x80000000)
                        {
                            CopyText(hwnd);
                        }
                        break;
                    case VK_UP:
                        if (curSel > 0)
                            SendMessage(hwnd, WM_USER, curSel-1, 0);
                        break;
                    case VK_DOWN:
                        if (curSel < ListView_GetItemCount(hwndLV) - 1)
                            SendMessage(hwnd, WM_USER, curSel + 1, 0);
                        break;
                }
            }
            break;
        case WM_COMMAND:
            switch(LOWORD(wParam))
            {
                case ID_TBTHREADS:
                    if (HIWORD(wParam) == CBN_SELENDOK)
                    {
                        int i = SendMessage(hwndTbThreads, CB_GETCURSEL, 0, 0);
                        if (i != CB_ERR)
                        {
                            SendMessage(hwnd, WM_USER, i, 0);
                            curSel = i;
                            
                        }
                    }
                    break;
            }
            break;
//.........这里部分代码省略.........
开发者ID:bencz,项目名称:OrangeC,代码行数:101,代码来源:dbgthread.c


示例20: DlgProc


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ListView_SetItemText函数代码示例发布时间:2022-05-30
下一篇:
C++ ListView_SetImageList函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap