This is a small demo file creating and displaying an unicode-enabled DDT dialog.
It also displays some japanese characters (but you need MS Mincho installed for seeing them,
I think this one comes with Win2000 or XP). I haven't used a language file or stringtable
for the strings in that test file, just a small BinBas of a japanese unicode file.
(On a side note, I have copied the japanese text from some google result, I don't understand
japanese

Code:
#COMPILE EXE #DIM ALL #INCLUDE "WIN32API.INC" MACRO DbgEnter(x) = ! nop MACRO DbgLeave(x) = ! nop MACRO Dbg(x) = ! nop %TEST_UNICODE_ANSI = 0 #INCLUDE "UCWRAP.BI" #INCLUDE "UCWRAP.INC" FUNCTION BinBas() AS STRING FUNCTION = PEEK$( CODEPTR( BinBas_Data ), 68 ) EXIT FUNCTION BinBas_Data: !db 255,254,218,048,252,048,184,048,110,048,186,078,023,108,166,094,146,048 !db 205,083,032,102,087,048,095,048,233,048,243,048,173,048,243,048,176,048 !db 146,048,076,136,106,048,070,048,181,048,252,048,193,048,168,048,243,048 !db 184,048,243,048,110,048,229,101,044,103,158,138,072,114 END FUNCTION CALLBACK FUNCTION TestProc LOCAL txt AS STRING SELECT CASE CBMSG CASE %WM_COMMAND SELECT CASE CBCTL CASE %IDOK CONTROL GET TEXT CBHNDL, 1002 TO txt MSGBOX txt, , UCODE$("Test output") CASE %IDCANCEL DIALOG END CBHNDL END SELECT END SELECT END FUNCTION FUNCTION PBMAIN () AS LONG LOCAL hDlg AS LONG UCWrapper_PatchToUnicode 'msgbox ucode$("patched."), , UCODE$("title") DIALOG FONT "MS Mincho", 9 DIALOG NEW %HWND_DESKTOP, UCODE$("dialog testa"), , , 200, 100, %WS_POPUP OR %WS_CAPTION OR %WS_SYSMENU, %WS_EX_RTLREADING TO hDlg SetWindowLong hDlg, %GWL_EXSTYLE, GetWindowLong(hDlg, %GWL_EXSTYLE) OR %WS_EX_RTLREADING CONTROL ADD LABEL, hDlg, 1001, BinBas(), 1, 1, 190, 25 CONTROL ADD TEXTBOX, hDlg, 1002, UCODE$("textbox"), 1, 30, 100, 12 CONTROL ADD BUTTON, hDlg, %IDOK, UCODE$("Display"), 100, 80, 45, 15 CONTROL ADD BUTTON, hDlg, %IDCANCEL, UCODE$("Cancel"), 150, 80, 45, 15 DIALOG SHOW MODAL hDlg CALL TestProc END FUNCTION
------------------
[This message has been edited by Lothar Pink (edited January 08, 2007).]
Leave a comment: