Results 1 to 8 of 8

Thread: [2008] Sending string with Sendmessage help

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2007
    Posts
    62

    [2008] Sending string with Sendmessage help

    Hi all,

    I am trying to send a string to a window that could be either active or inactive.

    hwnd does match up with the same value in spy++, so I know it's getting the correct window handle.

    The window is a game and does not have any child windows so I'm not sure what to do with that..I did manage to get the title to change but that's not what I want and I can't even get it to do that again. I want to send a string to that window.

    Code below..

    Code:
                    Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
    
                    Dim hwnd As Int32 = FindWindow(vbNullString, "The 4th Coming")
    
                    Dim txttosend As String = "test"
    
                    SendMessage(hwnd, WM_SETTEXT, 0, txttosend)

  2. #2

    Thread Starter
    Member
    Join Date
    Nov 2007
    Posts
    62

    Re: [2008] Sending string with Sendmessage help

    Bump..does anyone have a solution to this seemingly easy problem?

  3. #3
    Frenzied Member bmahler's Avatar
    Join Date
    Oct 2005
    Location
    Somewhere just west of the Atlantic
    Posts
    1,568

    Re: [2008] Sending string with Sendmessage help

    Is the game a DirectX game? because if it is then this will not work. You may be able to get the text in using PostMessage but you will find that it does nto work exactly as desired. I personally have written many trainers and with DirectX games if you are not hooking DirectInput then you are going to have a really hard time with this.
    Boooya
    • Visual Studio 2008 Professional
    • Don't forget to use [CODE]your code here[/CODE] when posting code
    • Don't forget to rate helpful posts!
    • If you're question was answered please mark your thread [Resolved]


    Code Contributions:
    PHP
    PHP Image Gallery v1.0PHP Image Gallery v2.0
    VB 2005
    Find Computers on a networkSimple License EncryptionSQL Server Database Access dllUse Reflection to Return Crystal ReportDocumentSilently Print PDFGeneric Xml Serailizer


    Useful Links: (more to come)
    MSDN (The first and foremost)MSDN Design Guidelines API Reference • Inno Setup CompilerInno Setup PreprocessorISTool - Fairly easy to use GUI for creating inno setup projects • Connection StringsNAnt -Automated BuildsCruise Control .NET - Frontend for automated builds

  4. #4

    Thread Starter
    Member
    Join Date
    Nov 2007
    Posts
    62

    Re: [2008] Sending string with Sendmessage help

    Yes, I'm pretty sure it uses an older version of DirectX as it's an older mmorpg (7+ years)

    How would I hook directinput to send a string to the game?

  5. #5
    Frenzied Member bmahler's Avatar
    Join Date
    Oct 2005
    Location
    Somewhere just west of the Atlantic
    Posts
    1,568

    Re: [2008] Sending string with Sendmessage help

    what game exactly? I have written quite a few applications for FFXI perhaps I can help.
    Boooya
    • Visual Studio 2008 Professional
    • Don't forget to use [CODE]your code here[/CODE] when posting code
    • Don't forget to rate helpful posts!
    • If you're question was answered please mark your thread [Resolved]


    Code Contributions:
    PHP
    PHP Image Gallery v1.0PHP Image Gallery v2.0
    VB 2005
    Find Computers on a networkSimple License EncryptionSQL Server Database Access dllUse Reflection to Return Crystal ReportDocumentSilently Print PDFGeneric Xml Serailizer


    Useful Links: (more to come)
    MSDN (The first and foremost)MSDN Design Guidelines API Reference • Inno Setup CompilerInno Setup PreprocessorISTool - Fairly easy to use GUI for creating inno setup projects • Connection StringsNAnt -Automated BuildsCruise Control .NET - Frontend for automated builds

  6. #6
    Frenzied Member
    Join Date
    Mar 2005
    Location
    Sector 001
    Posts
    1,577

    Re: [2008] Sending string with Sendmessage help

    VB 2005, Win Xp Pro sp2

  7. #7
    Frenzied Member bmahler's Avatar
    Join Date
    Oct 2005
    Location
    Somewhere just west of the Atlantic
    Posts
    1,568

    Re: [2008] Sending string with Sendmessage help

    oh, ha ha ha I didn't read the code in the first post
    Boooya
    • Visual Studio 2008 Professional
    • Don't forget to use [CODE]your code here[/CODE] when posting code
    • Don't forget to rate helpful posts!
    • If you're question was answered please mark your thread [Resolved]


    Code Contributions:
    PHP
    PHP Image Gallery v1.0PHP Image Gallery v2.0
    VB 2005
    Find Computers on a networkSimple License EncryptionSQL Server Database Access dllUse Reflection to Return Crystal ReportDocumentSilently Print PDFGeneric Xml Serailizer


    Useful Links: (more to come)
    MSDN (The first and foremost)MSDN Design Guidelines API Reference • Inno Setup CompilerInno Setup PreprocessorISTool - Fairly easy to use GUI for creating inno setup projects • Connection StringsNAnt -Automated BuildsCruise Control .NET - Frontend for automated builds

  8. #8
    Frenzied Member bmahler's Avatar
    Join Date
    Oct 2005
    Location
    Somewhere just west of the Atlantic
    Posts
    1,568

    Re: [2008] Sending string with Sendmessage help

    ok well I know nothing about that game but I can tell you this. If you do not know C++ and have an understanding of how to create a DX wrapper and API Hijacking then you are not going to be able to do this. Another issue you will run into even if you get text into the chat input is that sending the enter key fails. Check out this site http://www.extalia.com/forums/ there is a whole bunch of stuff on there about creating DX wrappers and making trainers.
    Boooya
    • Visual Studio 2008 Professional
    • Don't forget to use [CODE]your code here[/CODE] when posting code
    • Don't forget to rate helpful posts!
    • If you're question was answered please mark your thread [Resolved]


    Code Contributions:
    PHP
    PHP Image Gallery v1.0PHP Image Gallery v2.0
    VB 2005
    Find Computers on a networkSimple License EncryptionSQL Server Database Access dllUse Reflection to Return Crystal ReportDocumentSilently Print PDFGeneric Xml Serailizer


    Useful Links: (more to come)
    MSDN (The first and foremost)MSDN Design Guidelines API Reference • Inno Setup CompilerInno Setup PreprocessorISTool - Fairly easy to use GUI for creating inno setup projects • Connection StringsNAnt -Automated BuildsCruise Control .NET - Frontend for automated builds

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width