Open\Save Dialog control labels....?

S

SpotNet

Hi Newsgroup,

I have constructed highly customisable common dialog classes\objects.
Decided to extend the Open\Save dialog options with the ability to change
the text on all the controls. Mainly cause my boss wanted the Open File
Dialog's OK button to read 'Import', for all intensive purposes. Open\Save
dialogs where constructed purely from the Win32 API as you cannot inherit
these classes from the framework. Problem I am recounting is that the text
comes out like windings font or something completely ineligible, e.g,
okbuttontext = "Import" comes out looking like ||[]| | on the control. Can
anyone please tell me what I need to consider to get a what you see (want)
is what you get result?

The API I'm using
SendMessage(hparent, CDM_SETCONTROLTEXT, CommonDialog.IDOK, okbuttontext);



Many thanks and regards,

SpotNet.
 
S

SpotNet

In case anyone was wondering how SetWindowText(IntPtr hWnd, string
controlText) works well indeed...

Regards,
SpotNet
 
J

Jack Hanebach

SpotNet said:
Problem
I am recounting is that the text comes out like windings font or
something completely ineligible, e.g, okbuttontext = "Import" comes
out looking like ||[]| | on the control. Can anyone please tell me
what I need to consider to get a what you see (want) is what you get
result?

The API I'm using
SendMessage(hparent, CDM_SETCONTROLTEXT, CommonDialog.IDOK,
okbuttontext);

My guess would be that C# app sends unicode string while the O/S dialog
expects ascii...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top