Jump to content
Tuts 4 You

Delphi Applications MenuITem ID


Departure

Recommended Posts

K I have small problem I want to send WM_COMMAND to a delphi application to programatically trigger a menu item. Now this is normally no problems for me to do this with a application that has been programmed in a diffrent language. Fisrt ill explain the method i use on normal apps

say i want to click a menu item, I would open the application up in a resource hacker program and look for the menu item, here is normally a ID for that menu item for the sake of this explaintion will will sya the menu item has an ID of 33245, so i would do the following in my code "sendmessage(Hwnd,WM_COMMAND, 33245, 0);" which is no problems IN NON DELPHI APPS. but I want to find the ID of the menu item in a delphi application, becuase of it being a delphi app a resource hacker program does'nt help me at all, So I reverted to using DeDe, I found what i was looking for in "procedures" --> "Controls"

example.... had something like in DeDe's ListView

   Control			ID	  
MenuItemClick 0000039C

So off I went and tryed that as "sendmessage(Hwnd,WM_COMMAND, $0000039C, 0);" nothing ... so I decided it might of needed to be in decimal so I converted it to decimal "sendmessage(Hwnd,WM_COMMAND, 924, 0);" still nothing happening here. So im i decided to use DeDe and follow the RVA to the event in ollydebug and set a break point... because this program uses mad exception is just froze up on me :( So after thinking how this menu item would normally look a did a search in olly for command "PUSH 39C" .. being a delphi application once again did'nt help me at all.

So my question is ...... Is there something im missing here or could someone shed some light onto menuItem ID's in Delphi applications....

many thanks if someone has some expirence and could help me this topic

P.s and I also tryed with PostMessage instead of sendmessage with no luck..

Edited by Departure
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...