Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


vc <-> delphi WM_COPYDATA Help

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
onlyus
Newbie cheater
Reputation: 0

Joined: 27 Aug 2011
Posts: 19
Location: 214214

PostPosted: Sun Nov 27, 2011 2:27 am    Post subject: vc <-> delphi WM_COPYDATA Help Reply with quote

// send VC 2008 UNICODE
int main(void)
{
TCHAR MESSAGE[20] = L"Hello World";
COPYDATASTRUCT cds;
cds.dwData = 0;
cds.cbData = 5 * sizeof(WCHAR);
cds.lpData = MESSAGE;
HWND hWnd = FindWindow(L"TForm1", L"Form1");
::SendMessage(hWnd, WM_COPYDATA, (WPARAM)0, (LPARAM)&cds);
return 0;
}

// receive delphi7

.. procedure WmcopyData(var MSG:TMessage); message WM_COPYDATA;
~~
procedure TForm1.WmCopyData(var Msg: TMessage);
var
Data: PCopyDataStruct;
begin
Data:=Pointer(Msg.LParam);
ListBox1.Items.Add(PCHAR(Data^.lpData));
end;
end.

hello everyone i'm send "Hello World"
but receive only "H"
i wan't "Hello World"
my english very suck sorry help me



1.JPG
 Description:
 Filesize:  6.66 KB
 Viewed:  5376 Time(s)

1.JPG



_________________
i'm noob
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8585
Location: 127.0.0.1

PostPosted: Sun Nov 27, 2011 11:49 am    Post subject: Reply with quote

WCHAR is Unicode in C++ so you need to read it as unicode in Delphi.

Try using PWideChar in Delphi instead of PChar.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
onlyus
Newbie cheater
Reputation: 0

Joined: 27 Aug 2011
Posts: 19
Location: 214214

PostPosted: Sun Nov 27, 2011 9:26 pm    Post subject: thanks Reply with quote

thanks i love you have a nice day
_________________
i'm noob
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites