Click here to Skip to main content
15,895,667 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: StatusBar Properties Pin
Iain Clarke, Warrior Programmer7-Feb-07 0:28
Iain Clarke, Warrior Programmer7-Feb-07 0:28 
AnswerRe: StatusBar Properties Pin
David Crow7-Feb-07 2:50
David Crow7-Feb-07 2:50 
QuestionMFC Drag and drop Pin
sikora6-Feb-07 22:49
sikora6-Feb-07 22:49 
AnswerRe: MFC Drag and drop Pin
Don Box6-Feb-07 23:13
Don Box6-Feb-07 23:13 
GeneralRe: MFC Drag and drop Pin
sikora6-Feb-07 23:28
sikora6-Feb-07 23:28 
AnswerRe: MFC Drag and drop Pin
Hamid_RT7-Feb-07 0:36
Hamid_RT7-Feb-07 0:36 
QuestionRe: MFC Drag and drop Pin
David Crow7-Feb-07 2:56
David Crow7-Feb-07 2:56 
Questionmove 2 or more element for time in list Pin
Ing.Raiz826-Feb-07 22:47
Ing.Raiz826-Feb-07 22:47 
Hi,

Problem: i have a list (CToolTipListCtrl)
question: i want to move two or more element from a list... have you got a idea??



CODE:


void CSmartAdvertiseDlg::OnBnClickedDown()
{
if(m_cPlaylist.GetSelectedCount() == 1)
OnBnClicked(DOWN);
}



void CSmartAdvertiseDlg::OnBnClicked(int iOp)
{
POSITION Pos;
LVITEM lvi1,lvi2;
int iPos,iPeriod,iPos2,count,ret;
CString sPeriod,str1,str2;
listDataStruct *data;

lvi1.mask = LVIF_IMAGE | LVIF_TEXT;
lvi2.mask = LVIF_IMAGE | LVIF_TEXT;

if((Pos = m_cPlaylist.GetFirstSelectedItemPosition()) != NULL)
{
while(Pos)
{
iPos = m_cPlaylist.GetNextSelectedItem(Pos);
ret = sscanf(m_cPlaylist.GetItemText(iPos,2),"%d",&iPeriod);
switch (iOp)
{
case PLUS:
case MINUS:
if(ret == 1)
{

if(iOp == PLUS)
{
if(iPeriod<999)
iPeriod++;
}
else if (iPeriod)
iPeriod--;
sPeriod.Format("%d",iPeriod);
lvi1.iItem = iPos;
lvi1.iSubItem = 2;
lvi1.pszText = sPeriod.GetBuffer();
m_cPlaylist.SetItem(&lvi1);
UpdateData(FALSE);
}
else
{
//AfxMessageBox(IDS_NOT_IMAGE);
}
break;
case DOWN:
case UP:
if(iOp == UP)
iPos2=iPos-1;
else
iPos2=iPos+1;

count = m_cPlaylist.GetItemCount();
if(iPos2<0)
break;
//iPos2 = count-1;
if(iPos2==count)
break;
//iPos2=0;
for (int i = 0; i < m_wndHeader.GetItemCount(); i++)
{
lvi1.iItem = iPos;
lvi1.iSubItem = i;
lvi1.pszText = str1.GetBuffer(255);
lvi1.cchTextMax = 255;
lvi2.iItem = iPos2;
lvi2.iSubItem = i;
lvi2.pszText = str2.GetBuffer(255);
lvi2.cchTextMax = 255;
m_cPlaylist.GetItem(&lvi1);
m_cPlaylist.GetItem(&lvi2);
lvi2.iItem = iPos;
lvi1.iItem = iPos2;
m_cPlaylist.SetItem(&lvi1);
m_cPlaylist.SetItem(&lvi2);
}
data = (listDataStruct *)m_cPlaylist.GetItemData(iPos);
m_cPlaylist.SetItemData(iPos,m_cPlaylist.GetItemData(iPos2));
m_cPlaylist.SetItemData(iPos2,(DWORD_PTR)data);
m_cPlaylist.SetItemState(iPos, 0, LVIS_SELECTED);
m_cPlaylist.SetItemState(iPos2, LVIS_SELECTED, LVIS_SELECTED);
break;
}
}

m_cUpdate.EnableWindow(FALSE);
}

}


thanks, regards...

Giulio

ps. i hope that my english is comprehensible....sorry...ehheheSmile | :)
AnswerRe: move 2 or more element for time in list Pin
David Crow7-Feb-07 2:58
David Crow7-Feb-07 2:58 
NewsRe: move 2 or more element for time in list Pin
Ing.Raiz827-Feb-07 3:32
Ing.Raiz827-Feb-07 3:32 
GeneralRe: move 2 or more element for time in list Pin
David Crow7-Feb-07 4:59
David Crow7-Feb-07 4:59 
QuestionWhat is the difference between __cdecl and __stdcall Pin
Kotesh.N6-Feb-07 22:34
Kotesh.N6-Feb-07 22:34 
AnswerRe: What is the difference between __cdecl and __stdcall Pin
Michael Dunn6-Feb-07 22:38
sitebuilderMichael Dunn6-Feb-07 22:38 
AnswerRe: What is the difference between __cdecl and __stdcall Pin
Eytukan6-Feb-07 23:37
Eytukan6-Feb-07 23:37 
QuestionTo change IIS Timeout in MS C++ Pin
Mushtaque Nizamani6-Feb-07 22:20
Mushtaque Nizamani6-Feb-07 22:20 
Question#region [VS2005 IDE] [modified] Pin
Eytukan6-Feb-07 22:12
Eytukan6-Feb-07 22:12 
AnswerRe: #region [VS2005 IDE] Pin
Waldermort6-Feb-07 22:43
Waldermort6-Feb-07 22:43 
GeneralRe: #region [VS2005 IDE] Pin
Eytukan6-Feb-07 22:46
Eytukan6-Feb-07 22:46 
GeneralRe: #region [VS2005 IDE] Pin
Waldermort6-Feb-07 23:23
Waldermort6-Feb-07 23:23 
GeneralRe: #region [VS2005 IDE] Pin
Eytukan6-Feb-07 23:39
Eytukan6-Feb-07 23:39 
AnswerRe: #region [VS2005 IDE] Pin
krmed7-Feb-07 2:19
krmed7-Feb-07 2:19 
GeneralRe: #region [VS2005 IDE] Pin
Eytukan7-Feb-07 3:24
Eytukan7-Feb-07 3:24 
Questionconvert WCHAR to int Pin
amitmistry_petlad 6-Feb-07 22:08
amitmistry_petlad 6-Feb-07 22:08 
AnswerRe: convert WCHAR to int Pin
Waldermort6-Feb-07 22:39
Waldermort6-Feb-07 22:39 
AnswerRe: convert WCHAR to int Pin
Michael Dunn6-Feb-07 22:43
sitebuilderMichael Dunn6-Feb-07 22:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.