Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Help calling and using a functions in visual c++ 6

Help calling and using a functions in visual c++ 6

Scheduled Pinned Locked Moved C / C++ / MFC
c++csharpvisual-studiohelptutorial
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    method007
    wrote on last edited by
    #1

    Hi all i am very new to visual c++ . I am using [B]visual studio 6[/B] . So i might ask some simple questions but since i am new i consider you guys bare with me. I have the following 2 block of codes and i want to be able to call the first one like this : int pos=-1; pos=GetPosByNick("name"); I am making a form with a textbox and a button. On the click of the button i want to take the input and place it instead of name in above function call and get the pos value and then use that in my second block of code instead of zero : (WPARAM)0 so i be happy if an expert tell me step by step what do i need to do to be able to use these blocks of codes. Where to place them , what do i need to declare. Since it is my first attempt to do a program in visual c++ i be happy if an expert give me step by step instrcutions. Thanks 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

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups