Hi,
This works here (it's right aligned, since arabic is written right to left):
Code: Select all
Procedure a2u(text$)
UniSize = (Len(text$)*2)+2
*UniBuffer = AllocateMemory(UniSize+2)
MultiByteToWideChar_(#CP_ACP, #NULL, text$, Len(text$), *UniBuffer, Len(text$))
ProcedureReturn *UniBuffer
EndProcedure
; Create some 'random' arabic Unicode chars
*ArabicText = AllocateMemory((($06D5-$060C)*2)+2)
*ArabicTextSeek.WORD = *ArabicText
For i=$060C To $06D5
If (*ArabicTextSeek-*ArabicText)%11
*ArabicTextSeek\w = i
Else
*ArabicTextSeek\w = ' ' ; some spaces to allow word wrapping
EndIf
*ArabicTextSeek+2
Next i
*ArabicTextSeek\w = 0
If OpenLibrary(0, "USER32.DLL")
*CreateWindowExW = IsFunction(0, "CreateWindowExW")
If *CreateWindowExW And OpenWindow(0, 0, 0, 400, 160, #PB_Window_SystemMenu , "Show Unicode text")
If CreateGadgetList(WindowID())
hText = CallFunctionFast(*CreateWindowExW, 0, a2u("Static"), *ArabicText, #WS_VISIBLE|#WS_CHILD|#SS_RIGHT, 8, 8, 384, 144, WindowID(), 0, GetModuleHandle_(0), 0)
If hText:SendMessage_(hText, #WM_SETFONT, GetStockObject_(#DEFAULT_GUI_FONT), 1):EndIf
Repeat:Until WaitWindowEvent()=#PB_Event_CloseWindow
EndIf
EndIf
CloseLibrary(0)
EndIf
FreeMemory(*ArabicText)