Hi
im creating a software that downloads youtube closed captions and save captions as SRT file.
im displaying my GUI using DialogBoxParam API. it contains a listview, statusbar, buttons, edit controls etc.
so far everything is good except when i try to display the title of the video on a edit control (readonly) the characters appears as ???????
for example the title from this video: http://www.youtube.com/watch?v=PxwwFdskgo4
youtube sends data in a XML file UTF8 encoded
My Listview has no problem displaying the languages names in their original language.
im using MultiByteToWideChar and LVM_SETITEMW and my program display characters correctly (japanese, arabian, etc) on the ListView but im having problems when i try to display japanese/arabian characters on a edit control, they show as ?????????? and im using the same method MultiByteToWideChar and SendDlgItemMessageW + WM_SETTEXT or SetWindowTextW both show ?????????
im uisng tahoma 10 for my window font.
note: notepad can display the characters/letters correctly.
thank you
(http://img16.imageshack.us/img16/1338/19191031.th.png) (http://imageshack.us/photo/my-images/16/19191031.png/)
(http://img15.imageshack.us/img15/5264/14016554.th.png) (http://imageshack.us/photo/my-images/15/14016554.png/)
welcome to the forum :U
there are so many things that go wrong :P
the edit control must be created for unicode (FunctionNameW)
the same applies for sending messages to it, etc
may be - InitCommonControls - or you may need a manifest
without seeing the code, it is really hard to say
Only two API calls, CreateWindowEx and SetWindowLong, need the W:
Quote if UseUnicode
invoke CreateWindowExW, WS_EX_CLIENTEDGE, wChr$("edit"), NULL,
WS_CHILD or WS_VISIBLE or WS_BORDER\
or ES_LEFT or ES_AUTOHSCROLL or ES_MULTILINE, 0, 0, 0, 0,
hWnd, IdEdit, hInstance, NULL
mov hEdit, eax ; we have created an edit window
invoke SetWindowLongW, hEdit, ; we subclass the edit control
GWL_WNDPROC, SubEdit
[/color]
(from \masm32\RichMasm\Res\SkelWinMB.asc, part of MasmBasic (http://www.masm32.com/board/index.php?topic=12460); exe attached)
thanks. right now i'm using a resource file so i guess i will have to create 2 edit controls using CreateWindowExW.
it is strange that the listview can show the japanese/arabic characters and the edit control cant and all the controls are inside a resource file.
i had an idea and it worked!
DialogBoxParamW instead of DialogBoxParam. edit control can now display japanece characters or other languages characters. ;)
:U