Set EXE Data...


I need 2 apps here, One with a label, other to set the label caption to the exe of first app

Hope you know what im talking about =)
Who is Participating?

Right-click this link and choose 'save target as' because geocities won't allow remote links to files.

This has full source code and 2 compiled demos...

LabelChanger.exe  changes the label of ChangeMyLabel.exe

DON'T point LabelChanger.exe at any file other than a delphi app that has been compiled
with the unit ExeMod.pas in its uses clause!  or you will corrupt the file.... it is easy to make it so
it cannot alter any file other than the one you want but this is a quick demo and I had no time
for that :-)

Please read the comments in ExeMod.pas in the initialization section... you will probably
want to disable its cd handling code for an app like this one :-)

p.s. It is just as easy to have an exe change its own label... no real need for a 2nd app.
An application sends a WM_SETTEXT message to set the text of a window.

To send this message, call the SendMessage function with the following parameters.

  (HWND) hWnd,              // handle to destination window
  WM_SETTEXT,               // message to send
  (WPARAM) wParam,          // not used; must be zero
  (LPARAM) lParam           // window-text string (LPCTSTR)
This parameter is not used.
Pointer to a null-terminated string that is the window text.
Return Values
The return value is TRUE if the text is set. It is FALSE (for an edit control), LB_ERRSPACE (for a list box), or CB_ERRSPACE (for a combo box) if insufficient space is available to set the text in the edit control. It is CB_ERR if this message is sent to a combo box without an edit control.

The DefWindowProc function sets and displays the window text. For an edit control, the text is the contents of the edit control. For a combo box, the text is the contents of the edit-control portion of the combo box. For a button, the text is the button name. For other windows, the text is the window title.

This message does not change the current selection in the list box of a combo box. An application should use the CB_SELECTSTRING message to select the item in a list box that matches the text in the edit control.

-Karamja-Author Commented:
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

I think you mean you want to be able to alter a label caption of a delphi exe
without re-compiling it....and without using the registry or ini files... but by actually
altering the exe itself.

If that is what you want I have demos that show how to do this... just ask and
I will send the demos.

A delphi exe can change the caption itself or you can use a 2nd app to do it...
it's easy eaither way.

-Karamja-Author Commented:

If you could upload them or somethink if they work you got the points
-Karamja-Author Commented:
Thanks, works fine! =)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.