- This topic has 93 replies, 3 voices, and was last updated 18 years ago by method.
-
AuthorPosts
-
July 7, 2006 at 4:41 pm #188678methodMember
is this the whole code ? in vb6 it is dam long!! could u just upload the it as project. I will work on it 😆 😆
July 7, 2006 at 5:18 pm #188677BattleStar-GalacticaMemberjust copy and past that code to button click procedure. if you are coding in mfc u see i’am setting “character set” to Use Multi-Byte Character Set not unicode, if your setting character set is unicode it will not compile that code.
July 7, 2006 at 7:33 pm #188676methodMember@nanomachine007 wrote:
just copy and past that code to button click procedure. if you are coding in mfc u see i’am setting “character set” to Use Multi-Byte Character Set not unicode, if your setting character set is unicode it will not compile that code.
I will work on it . when solved i will let u know 🙂
July 7, 2006 at 10:03 pm #188675BattleStar-GalacticaMemberI solved problem man here is the code highligth item for pt
HWND listview=NULL; // List View identifier HWND parent,child; parent=NULL; child=NULL; parent = ::FindWindow("My Window Class",NULL); child =::FindWindowEx(parent,0,"WTL_SplitterWindow",NULL); child =::FindWindowEx(child,0,"WTL_SplitterWindow",NULL); child =::FindWindowEx(child,0,"WTL_SplitterWindow",NULL); child =::FindWindowEx(child,0,"ATL:0053C8D0",NULL); listview=::FindWindowEx(child,0,"SysListView32",NULL); LVITEM lvi, *_lvi; unsigned long pid; HANDLE process; GetWindowThreadProcessId(listview, &pid); process=OpenProcess(PROCESS_VM_OPERATION | PROCESS_VM_READ | PROCESS_VM_WRITE, FALSE, pid); if(process) { _lvi=(LVITEM*)VirtualAllocEx(process, NULL, sizeof(LVITEM), MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE); lvi.mask = LVIF_STATE; lvi.state =15; lvi.stateMask = LVIS_SELECTED | LVIS_FOCUSED; WriteProcessMemory(process, _lvi, &lvi, sizeof(LVITEM), NULL); ::SendMessage(listview, LVM_SETITEMSTATE, (WPARAM)0, (LPARAM)_lvi); VirtualFreeEx(process, _lvi, 0, MEM_RELEASE); } ::CloseHandle(process);
in that example it will highligth the first nick but u can change to whatever position you want the third param of sendmessage 8)
July 7, 2006 at 10:21 pm #188674methodMemberNano . Excelet job. Thanks alot . MAn could u modify the code so we could search by name too just like the other project that u enter a name of user it goes find it and higlight it. THat makes this program usefull for the projects that we work on. Also could add an option to deselect item too.
Furthermore, nano are u good at customDraw ? what i mean being able to change color of nicks in listview in our own pc? i do not mean all nicks , just the ones we highlight and press a button. looking forward for u reply.Thanks
July 7, 2006 at 10:44 pm #188673BattleStar-GalacticaMemberLOL you did not see my other post about color nick ❓ ❓ ❓ a hint to do that just tell that window do not redraw all item than you can change difrent color for different nick.
U have to wait if you want i do a code highligth pal nick by giving their nick in textbox. I have coded in mfc how to get external item. if you want i can pm you for that code. and with this snippet about highligth nick i think you dont need i do it for you 8)
July 7, 2006 at 10:51 pm #188672methodMember@nanomachine007 wrote:
LOL you did not see my other post about color nick ❓ ❓ ❓ a hint to do that just tell that window do not redraw all item than you can change difrent color for different nick.
U have to wait if you want i do a code highligth pal nick by giving their nick in textbox. I have coded in mfc how to get external item. if you want i can pm you for that code. and with this snippet about highligth nick i think you dont need i do it for you 8)
could u tell me what post u talked about color ? i realy want to know this. I already know how to color them all but that is not what i want. I want to be able to color individual names rather then the whole listview. So i be happy if u show me how.
Man that would be nice u send me that code for getting names from externial listview in MFC and also if can modify u code so we can highlight by typing usrer name. I like mfc i want to learn more.Looking forward for u reply.Thanks
July 7, 2006 at 11:35 pm #188671BattleStar-GalacticaMemberok finally i decided it can go public, here is hignligth nick by giving nick in text box mfc version 😆
July 8, 2006 at 1:05 am #188670methodMember@nanomachine007 wrote:
ok finally i decided it can go public, here is hignligth nick by giving nick in text box mfc version 😆
man thank u for uploading this but i can not use it since i am in visual stuido 6. could u upload one for visual studio 6 version too.Thanks
July 8, 2006 at 1:26 am #188669BattleStar-GalacticaMemberI did not have visual studio 2003, i just have visual studio 2005.
July 8, 2006 at 1:28 am #188668methodMember@nanomachine007 wrote:
I did not have visual studio 2003, i just have visual studio 2005.
🙁 so there is no way i can use i then :-(( very sad
if u can not convert it . could u just upload an exe one so i test it.Thanks
July 8, 2006 at 1:34 am #188667BattleStar-GalacticaMemberi can post the snippet of the code the get nick. btw have you try my previous snippet about highlight
int GetPosByNick(CString szNick) { HWND hList=NULL; // List View identifier HWND parent,child; parent=NULL; child=NULL; parent = ::FindWindow("My Window Class",NULL); CString c; child =::FindWindowEx(parent,0,"WTL_SplitterWindow",NULL); child =::FindWindowEx(child,0,"WTL_SplitterWindow",NULL); child =::FindWindowEx(child,0,"WTL_SplitterWindow",NULL); child =::FindWindowEx(child,0,"ATL:0053C8D0",NULL); hList=::FindWindowEx(child,0,"SysListView32",NULL); HWND hwnd=parent; HWND listview=hList; int count=(int)::SendMessage(listview, LVM_GETITEMCOUNT, 0, 0); int i; LVITEM lvi, *_lvi; char item[512]; char *_item; unsigned long pid; HANDLE process; GetWindowThreadProcessId(listview, &pid); process=OpenProcess(PROCESS_VM_OPERATION|PROCESS_VM_READ|PROCESS_VM_WRITE|PROCESS_QUERY_INFORMATION, FALSE, pid); _lvi=(LVITEM*)VirtualAllocEx(process, NULL, sizeof(LVITEM), MEM_COMMIT, PAGE_READWRITE); _item=(char*)VirtualAllocEx(process, NULL, 512, MEM_COMMIT, PAGE_READWRITE); lvi.cchTextMax=512; for(i=0; i<count; i++)="" {="" lvi.isubitem="2;" lvi.psztext="_item;" writeprocessmemory(process,="" _lvi,="" &lvi,="" sizeof(lvitem),="" null);="" ::sendmessage(listview,="" lvm_getitemtext,="" (wparam)i,="" (lparam)_lvi);="" readprocessmemory(process,="" _item,="" item,="" 512,="" _subitem,="" subitem,="" if(item="=szNick)" virtualfreeex(process,="" 0,="" mem_release);="" ::closehandle(process);="" return="" i;="" }="" -1;="" }<="" pre="">
give a nick to parameter and it will return position of that nick and use my other code to do highlight
July 8, 2006 at 1:38 am #188666methodMemberThanks man . i tried your previouse code it highlights name giving it the postion . I do not know how to run your current code ! could u tell me how to run it ? what controle and buttons do i need?
Furthermore , how to combine these 2?
could u tell me how i run it alone and combine it with previouse one.ThanksJuly 8, 2006 at 2:06 am #188665BattleStar-GalacticaMemberexample
int pos=-1;
pos=GetPosByNick(“yournick”);
now you get the position of yournickif it return -1 that mean the nick passed by parameter does not exist in room.
and declare that function like this in global
int GetPosByNick(CString szNick);
after copy my snippet right herevb6 is more simple why you want to go with mfc for pt progg.
July 8, 2006 at 2:12 am #188664methodMember@nanomachine007 wrote:
example
int pos=-1;
pos=GetPosByNick(“yournick”);
now you get the position of yournickif it return -1 that mean the nick passed by parameter does not exist in room.
and declare that function like this in global
int GetPosByNick(CString szNick);
after copy my snippet right herevb6 is more simple why you want to go with mfc for pt progg.
Man could u help me out make this work in visual studio 6. Just tell me what button and controles i need and where to use your code to be able to highlight the user by name.Thanks
-
AuthorPosts
Related
- You must be logged in to reply to this topic.