SendCmdLine and GetCmdLine

Started by Zlatko Vid, June 09, 2023, 08:41:23 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Pierre Bellisle

Aurel>and get Window Title changed

Yes, you send to the main window of your program, it's like SetWindowText().
We have to send the message to the edit control.

SendDlgItemMessage(hReceiver, EditId, WM_SETTEXT, 0, strptr MessageToSend) send the message
to the control Edit wich is a child of the main window hReceiver.

To use SendMessage(), do SendMessage(GetDlgItem(hReceiver, EditId), WM_SETTEXT, 0, strptr errMessage))
GetDlgItem(hReceiver, EditId) will return the edit handle.

There is also other way...

Zlatko Vid

Thanks Pierre

SendDlgItemMessage(hReceiver, EditId, WM_SETTEXT, 0, strptr MessageToSend)

is just fine and do the job right.
 ;)

Pierre Bellisle

Theo,
Nope, no need of administrator rights for WM_SETTEXT.
Unless Windows 11 ms-coders change it, of course...