Thread: finding offsets

  1. #1
    Registered User
    Join Date
    Aug 2006
    Posts
    1

    finding offsets

    how can this writen to send back the offset of where this function is sending the commands? a little help please?
    Code:
    inline void Console(char *cgCmd) 
    {  
    	HWND MohCons = FindWindow(0, "Console");
    	EnumChildWindows(MohCons, EnumChildSendCommandProc,
                              (LPARAM)cgCmd); 
    }
    
    
    BOOL CALLBACK EnumChildSendCommandProc(HWND hwnd,LPARAM lParam) 
    {  
    	char className[1024]; 
    
    	GetClassName(hwnd,className,sizeof(className)); 
    
    	if (strcmp("Edit",className)) return true;  
    	if (ES_READONLY & GetWindowLong(hwnd,GWL_STYLE)) return true; 
    
    	SendMessage(hwnd,WM_SETTEXT,0,lParam);  
    
    	SendMessage(hwnd,WM_CHAR,13,0);  
    	return 1; 
    }
    Last edited by Salem; 08-04-2006 at 11:02 AM. Reason: tag - you're it

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    http://cboard.cprogramming.com/showthread.php?t=26462
    Figure out how to use code tags.
    I've done it for you (this one time), so edit your post again to see how it's done.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    You may want case insensitive string comparison. Your question is a little confusing. What offset? What function? What commands? Do you mean where the cursor is in the edit control?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. tools for finding memory leaks
    By stanlvw in forum C++ Programming
    Replies: 4
    Last Post: 04-03-2009, 11:41 AM
  2. ReadProcess Memory with Offsets
    By balulu in forum C++ Programming
    Replies: 0
    Last Post: 03-11-2009, 09:06 PM
  3. Finding primes
    By starripper in forum C++ Programming
    Replies: 19
    Last Post: 01-14-2006, 04:17 PM
  4. Finding the Root of a Complete Tree
    By Mr. Acclude in forum C++ Programming
    Replies: 5
    Last Post: 11-29-2005, 06:20 PM
  5. MFC :: Finding Child Window of a CWnd* Object?
    By SyntaxBubble in forum Windows Programming
    Replies: 2
    Last Post: 09-06-2003, 09:06 AM