aNewLyfe Posted May 1, 2008 Posted May 1, 2008 hi, i wasted a few hours but cant get it work i want to use a dll to send message and get pixel from a window.here is the dll functions,Send Message Function :PMX (PostMessageA):Code:function PMX(hWnd:HWND;MSG:UINT;WPARAM:wParam;LPARAM:lParam):BOOL;stdcall;external 'GPPMX.dll' name 'PMX';Example of usage in Delphi(i think) :procedure TForm1.Timer1Timer(Sender: TObject);varh:hWnd;A:DWORD;Begin h:=FindWindowA('MapleStoryClass',nil); A:=MapVirtualKey($11,0); A:=A shl 16; if h<>0 then begin PMX(h,WM_KEYDOWN,$11,A); PMX(h,WM_KEYUP,$11,A); Application.ProcessMessages; end;end;-----------------------------------------------------------------------Get Pixel Color Function :function GPX(hdc: HDC; nXPos: integer; nYPos: Integer):COLORREF;stdcall;external 'GPPMX.dll' name 'GPX';Example of useage in delphi(i think):varGPF: HDC;colorval: integer;beginGPF:=GetDC(0);colorval:=GPX(GPF, 500, 600);label1.caption:= IntToHex(colorval);end;how can i use them in DllCall Function, sorry for noob question tnx for helps. ~ Every Living Thing is a Code Snippet of World Application ~
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now