Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: MessageDlg Clipboard output under Windows 7


This question is answered.


Permlink Replies: 2 - Last Post: May 27, 2014 3:13 AM Last Post By: Kristofer Skaug
Kristofer Skaug

Posts: 21
Registered: 10/24/99
MessageDlg Clipboard output under Windows 7  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 19, 2014 8:06 AM
Dear all,

Delphi XE2; if I make the following call:

 MessageDlg('Copy me', mtError, [mbOK], 0); 


and run this in a test application. The messagebox pops up. I hit Ctrl+C and paste to NotePad.
In windows Vista and earlier I get:

---------------------------
Error
---------------------------
Copy me
---------------------------
OK   
---------------------------


But in Windows 7 I get the following output:

[Window Title]
Error
 
[Content]
Copy me
 
[OK]


Why is there a difference?
As far as I can tell, it should always produce the former output, as implemented in TMessageForm.GetFormText (see Vcl.Dialogs.pas).

In other words, under windows 7, are we being delegated to a different MessageDlg implementation somehow?
Peter Below

Posts: 1,227
Registered: 12/16/99
Re: MessageDlg Clipboard output under Windows 7
Correct
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 19, 2014 10:17 AM   in response to: Kristofer Skaug in response to: Kristofer Skaug
Kristofer Skaug wrote:

Dear all,

Delphi XE2; if I make the following call:

 MessageDlg('Copy me', mtError, [mbOK], 0); 


and run this in a test application. The messagebox pops up. I hit
Ctrl+C and paste to NotePad. In windows Vista and earlier I get:

---------------------------
Error
---------------------------
Copy me
---------------------------
OK   
---------------------------


But in Windows 7 I get the following output:

[Window Title]
Error
 
[Content]
Copy me
 
[OK]


Why is there a difference?

Because the dialogs are not the same. There is a variable named
UseLatestCommonDialogs in the Vcl.Dialogs unit, which defaults to true.
With this setting MessageDlg and its associates actually use system
dialogs and not the custom Delphi form older versions use.


--
Peter Below (TeamB)

Kristofer Skaug

Posts: 21
Registered: 10/24/99
Re: MessageDlg Clipboard output under Windows 7  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 27, 2014 3:13 AM   in response to: Peter Below in response to: Peter Below
Peter Below wrote:
Because the dialogs are not the same. There is a variable named
UseLatestCommonDialogs in the Vcl.Dialogs unit, which defaults to true.
With this setting MessageDlg and its associates actually use system
dialogs and not the custom Delphi form older versions use.{quote}

Thanks Peter, I should have read the source more closely.
This of course also explains my other problem with not finding certain expected features of these dialogs.

--
Kristofer
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02