finding offsets

This is a discussion on finding offsets within the Windows Programming forums, part of the Platform Specific Boards category; how can this writen to send back the offset of where this function is sending the commands? a little help ...

  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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,333
    << !! Posting Code? Read this First !! >>
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  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, 03:17 PM
  4. Finding the Root of a Complete Tree
    By Mr. Acclude in forum C++ Programming
    Replies: 5
    Last Post: 11-29-2005, 05: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21