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 


[Help (C#) ] PMX.dll - how to Call the function in C#
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
jongwee
Moderator
Reputation: 0

Joined: 28 Jun 2006
Posts: 1388
Location: Singapore

PostPosted: Thu Dec 06, 2007 4:28 am    Post subject: Reply with quote

sponge wrote:
If you look in my DEF file... you will see that the exported name for my "API" is hhPostMessageA.
I do not program in C# so I cannot tell you how to import it.

Yeap, I tried to use your .dll and it gave me an error, and i looked at your folder and found hhpostmessageA ^^
Code for delphi would be:
Code:
function hhPostMessageA(
hWnd:HWND;
MSG:UINT;
WPARAM:wParam;
LPARAM:lParam):BOOL;stdcall;
external 'HookHop.dll' name 'hhPostMessageA';

_________________
Back to top
View user's profile Send private message MSN Messenger
MyFeel
Expert Cheater
Reputation: 0

Joined: 04 Jun 2007
Posts: 143

PostPosted: Thu Dec 06, 2007 1:29 pm    Post subject: Reply with quote

hmm ok i got this Import now, but i use it?

here the code i use:

Code:


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {

        [DllImport("HookHop.dll")]
        private static extern bool hhPostMessageA(IntPtr hWnd, uint MSG, IntPtr WPARAM, IntPtr LPARAM);



        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
           


            hhPostMessageA(hWnd, 0x09, 0, 0);
        }
    }
}




but it say's error :
Error 1 The name 'hWnd' does not exist in the current context
Back to top
View user's profile Send private message
sponge
I'm a spammer
Reputation: 1

Joined: 07 Nov 2006
Posts: 6009

PostPosted: Thu Dec 06, 2007 6:20 pm    Post subject: Reply with quote

You have to get a handle of a window first...
_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page Previous  1, 2, 3
Page 3 of 3

 
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