 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
blqxxxxxxx Cheater
Reputation: 0
Joined: 25 Aug 2009 Posts: 37
|
Posted: Thu Jan 05, 2012 1:34 pm Post subject: Handle help? [Delphi] |
|
|
Hello!
I need some help to get a handle. I want to get Skype send message button handle.
I used Spy++ but i didnt have any success.
TChatEntryControlinclude send message button and richviewedit but when I expand the branch I see only TRichViewedit.
| Code: | global vars
hwnd,hwnd2 :thandle;
...
hwnd := findwindow('TskMultiChatForm.UnicodeClass',nil);
hwnd2 := findwindowex(hwnd,0,'TChatBackground',nil);
hwnd2 := findwindowex(hwnd2,0,'TPanel',nil);
hwnd2 := findwindowex(hwnd2,0,'TMeControl',nil);
hwnd2 := findwindowex(hwnd2,0,'TChatEntryControl',nil); |
_________________
|
|
| Back to top |
|
 |
callmenuge Cheater
Reputation: 0
Joined: 12 Feb 2011 Posts: 42
|
Posted: Fri Jan 06, 2012 2:45 am Post subject: |
|
|
There was this nifty FindWindow tool but I can't quite remember the name of it. It had the icon of crosshairs and to use it all you had to do was run the cursor over the button, window, etc.
Edit:
Here's one that is very similar to it: http://www.codeproject.com/KB/dialog/FindWindow.aspx
|
|
| Back to top |
|
 |
blqxxxxxxx Cheater
Reputation: 0
Joined: 25 Aug 2009 Posts: 37
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Wed Jan 11, 2012 1:05 pm Post subject: |
|
|
Is there any reason you need the handle to the control? You can send the current data inside the edit control by sending a WM_KEYDOWN event with RETURN as the key like:
| Code: |
// Find main chat window..
HWND hWndMain = FindWindow( NULL, L"Echo / Sound Test Service" );
if ( hWndMain == NULL ) return 0;
// Find the chat entry control..
HWND hWndChat = FindWindowEx( hWndMain, NULL, L"TChatEntryControl", NULL );
if ( hWndChat == NULL ) return 0;
// Find the chat entry control..
HWND hWndEdit = FindWindowEx( hWndChat, NULL, L"TChatRichEdit", NULL );
if ( hWndEdit == NULL ) return 0;
PostMessage( hWndEdit, WM_KEYDOWN, (WPARAM)VK_RETURN, (LPARAM)0 );
|
I couldn't find the button either possibly it isn't an actual control and it is something manually drawn and handled with a hit-test based on the window sizes. But this is how I could automatically send messages without focus:
| Code: |
#include <Windows.h>
#include <iostream>
void MySendMessage( HWND hWndControl, const wchar_t* lpMessage )
{
int nStringLength = wcslen( lpMessage );
for( int x = 0; x < nStringLength; x++ )
{
wchar_t wszCurrChar = lpMessage[x];
PostMessage( hWndControl, WM_CHAR, (WPARAM)wszCurrChar, (LPARAM)0 );
}
PostMessage( hWndControl, WM_KEYDOWN, (WPARAM)VK_RETURN, (LPARAM)0 );
}
int main( int argc, char* argv[] )
{
// Find main chat window..
HWND hWndMain = FindWindow( NULL, L"Echo / Sound Test Service" );
if ( hWndMain == NULL ) return 0;
// Find the chat entry control..
HWND hWndChat = FindWindowEx( hWndMain, NULL, L"TChatEntryControl", NULL );
if ( hWndChat == NULL ) return 0;
// Find the chat entry control..
HWND hWndEdit = FindWindowEx( hWndChat, NULL, L"TChatRichEdit", NULL );
if ( hWndEdit == NULL ) return 0;
MySendMessage( hWndEdit, L"This is a test message. :)" );
return 0;
}
|
_________________
- Retired. |
|
| Back to top |
|
 |
blqxxxxxxx Cheater
Reputation: 0
Joined: 25 Aug 2009 Posts: 37
|
Posted: Thu Jan 12, 2012 11:25 am Post subject: |
|
|
Thank you for the replay Wiccaan! I am writing a program and I need the handle to simulate clicks. That's why i need the send msg button handle. Do you think is it possible to get it?
_________________
|
|
| Back to top |
|
 |
Unbr0ken Advanced Cheater
Reputation: 2
Joined: 10 Aug 2011 Posts: 67
|
Posted: Fri Jan 13, 2012 1:16 am Post subject: |
|
|
| blqxxxxxxx wrote: | | Thank you for the replay Wiccaan! I am writing a program and I need the handle to simulate clicks. That's why i need the send msg button handle. Do you think is it possible to get it? |
I would recommend that, with the use of GetWindowRect() and FindWindow(), you get the screen location of the text box or some other control and then add a number to approximate the position of the send button.
Once this is done, simulate the click...
I don't know if it's the most orthodox way, but that's what I can think of now.
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|