Link to home
Start Free TrialLog in
Avatar of tobjectpascal
tobjectpascal

asked on

String to WM_Message

Function Translate(Wm_Call: Longint): Boolean;
Begin
 Form1.Edit2.text:=IntToStr(Wm_Call);
 Form1.Edit3.Text:=IntTOHex(Wm_Call,2);
End;


Results

Translate(WM_PAINT);
[15     ]
[0F     ]


Translate(WM_CLOSE);
[16     ]
[10     ]


Easy, now let's suppose i wanted to do the same thing from external user input..

Translate(EditBox1.Text);  //wm_close


Errrrrrooooorrrrrrrrrrrrrrr.....


IS there anyway of doing a reverse lookup on an API call? without building a complete library of their values yourself?

Avatar of Hamidreza Vakilian
Hamidreza Vakilian

Hi!

I think it's not available under delphi, because wm_messages are constant values and for example whenever the compiler see wm_close, puts hexadecimal 10 in place of that... It doesn't know wm_close !!!

HRV
Avatar of tobjectpascal

ASKER

any mods reading this thread...

http://wiki.winehq.org/List_Of_Windows_Messages


I ended up writing a program to extract them for a look up system...

problem solved thanks anyway guys, i thought it was not possible to do this, but it would be great if it could....
ASKER CERTIFIED SOLUTION
Avatar of Computer101
Computer101
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial