Link to home
Start Free TrialLog in
Avatar of ranunez
ranunez

asked on

WinAPI Dialog Resource

Using WinAPI, how do I get the Caption of a Dialog Resource in a DLL, without first creating the Dialog (Hidden or not) and then reading the caption.
Avatar of SJohnson
SJohnson
Flag of Australia image

I honestly don't believe you can.  Certainly not with WinAPI.  Maybe a hack or something could do it, but I wouldn't bet on it!!

You maybe able to load the DLL (using LoadLibrary) then try and load the dialog resouce into memory using a resource stream, then see if the caption is there.

You are going to have to load the library whether you want to or not anyway simply to get a handle.

Stu
Avatar of ranunez
ranunez

ASKER

How would I reference the Dialog structure in Delphi once the resource is in memory.  I can load the DLL, load the Resource, and I think I know how to get the Caption, but I don't know how to reference the Dialog Resource Structure.
Ok, I do not have time to write this, but this is how you should do it.
In your delphix\demo folder load in resXplorer

look at TExeImage.CreateImage

resexplorer will show you a hex dump of the Dialog. the easiestway to read this is to look at every alternate character.
I think you are looking for the first 3 or 4 readable characters in a row after the first 22 bytes. The title normally starts between 22 and 40 bytes in. There may be a better offset you can grab, but the readable character thing should work
ASKER CERTIFIED SOLUTION
Avatar of Member_2_248744
Member_2_248744
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
I should have said that the dialog strings (for caption and other) are in Wide Charater (2 byte)