English
Forum

Is it Unikode?

 

Nico
Madysa
Hello Gemeinde!

it turn itself circa subesquent code:
CompileMarkSeparation
 {$iq}

{MkStr$

    nproc MkStr$

        parameters s$,n&
        var ns$=""

        whileLoop n&

            ns$=ns$+s$

        wend

        return ns$

    endproc

    {TToUTF

        nproc TToUTF

            parameters text$
            var utf$ = MkStr$(" ",2 * len(text$))
            MultiByteToWideChar(0,1,text$,-1,utf$,len(text$))
            return utf$

        endproc

        {ControlW

            nproc ControlW

                parameters Class$,Name$,style&,x&,y&,dx&,dy&,pWnd&,pid&,hInst&,exstyle&
                var cs& = Dim(40)
                Long cs&, 0 = 40
                Long cs&, 4 = hInst&
                Long cs&, 8 = pid&
                Long cs&,12 = pWnd&
                Long cs&,16 = dx& * 65536 + dy&
                Long cs&,20 = x& * 65536 + y&
                Long cs&,24 = style&
                Long cs&,28 = Addr(Name$)
                Long cs&,32 = Addr(Class$)
                Long cs&,36 = exstyle&
                var handle& = CreateWindowExW(exstyle&,Class$,Name$,style&,x&,y&,dx&,dy&,pWnd&,pid&,hInst&,cs&)
                Dispose(cs&)
                return handle&

            endproc

            cls
            Shell "CHARMAP"
            var Font& = Create("Font","Times New Roman",32,0,0,0,0)
            var a& = Control(        "EDIT" ,"TzTz",1342242944,200, 5,200,35,%hWnd,1,%hInstance,$200)
            var a& = Create("Edit",%hWnd,"ABCDEFGHI",200,5,200,35)
            print WinError$(%WinError)
            SetFont a&,Font&
            var w& = ControlW(TToUTF("EDIT"),"ABCDEFGHI",1342242944,200,40,200,35,%hWnd,1,%hInstance,$200)
            print WinError$(%WinError)
            SetFont w&,Font&

            whilenot IsKey(27)

                waitinput

            wend

            DeleteObject Font&
         
class=s4 href='./../../Function-References/XProfan/end/'>end

(needed XPSE!)

Vereinfacht said power the small mere one Edit once by Create and once with CreateWindowExW to create. Erwartungsgemäß ought to the Edit Ansizeichen therefore only upper print can and the bottom pretty much everything Vorstellbare.

The first Schein gives me right -- "ABCDEFGHI" above normal outputted, under go however, two bytes to a characters abstracted -- Unikode hold.

The Clou is: Both edits can use any kind of characters darstellen; z.B. too the Integralzeichen, The typografischen quotation marks, the lächelnde face, The two Achtelnoten, greichische letters, what the marrow begehrt.

the Roland heimlich on Unikodecontrols umgestiegen is, can I me Nich so right present. lying it therefore on any strange Windows settings? what comes with you out?

the Program ought to same yet The Zeichentabelle open. copies simply a couple exotic characters (russian, Hebräisch, whatever) and guckt, whether both Editfields tappt im dunkeln suppose.

I would for Tests very grateful.

Sincerely,

Nico
 
Nico Madysa
12/21/09  
 



function UTFToT missing. oO
 
12/22/09  
 




Dieter
Zornow
Should not a code only once even on Lauffähigkeit testing, before one it here reinstellt ?
 
Er ist ein Mann wie ein Baum. Sie nennen ihn Bonsai., Win 7 32 bit und Win 7 64 bit, mit XProfan X2
12/22/09  
 




Nico
Madysa
any Lines, The m$ include, can auskommentiert go, there it circa these Variable Yes none goes.

Habs supra korrigiert. I type my Kodes fundamentally first certain lines the Community and change tappt im dunkeln there also öfters yet quick.
 
Nico Madysa
12/23/09  
 



functions!



the the/The Ctrl(s) intern Wide works, wundert me not - lay Yes The Messages the Meiste breits solid or. which Stringtyp To process is.

19 kB
Hochgeladen:12/23/09
Downloadcounter57
Download
 
12/23/09  
 




Nico
Madysa
Hehe, Å is no Unikodezeichen.

but I see already, that not my Error is.
what me problematically is: Rolands Strings are of my Wissens normal Einbyteprozeichen-Stirngs. what would then occur, if I in a with Create() begot Edit, say we, the Integralzeichen write and the thing then with GetText$() choose? i think, i'll plenty Fun on the experiment having, as well as I to that program come.
 
Nico Madysa
12/23/09  
 




Dieter
Zornow
by me functions it ditto and both Edits can also exotic characters present.
 
Er ist ein Mann wie ein Baum. Sie nennen ihn Bonsai., Win 7 32 bit und Win 7 64 bit, mit XProfan X2
12/23/09  
 



Nico Madysa, Beitrag=55555, Zeitpunkt=23.12.2009
Rolands Strings are of my Wissens normal Einbyteprozeichen-Stirngs.


Rolands (Delphi) Strings are the Result of z.B. GlobalAlloc(gPTR,8+charCount+1+x)+8, you have on place -8 a Referenzzähler and on place -4 The Number of byte. +1 for x00 and +x for round up on 4 teilbaren memory in 32-bit-Apps or. 8 in 64 or. according to Registerbreite. very so have I The nativen Strings too program and be as freely the formation.

Nico Madysa, Beitrag=55555, Zeitpunkt=23.12.2009
what would then occur, if I in a with Create() begot Edit, say we, the Integralzeichen write and the thing then with GetText$() choose?


your "String" is only one area fester size, either becomes cut or beget a Bereichsüberschreitung. If one Unicode sure of Ansi discern can, then could one certainly too ne automatic transmission install - for these automatischen functions this String then but not any more binärsicher would. ^^
 
12/23/09  
 




Nico
Madysa

CompileMarkSeparation
 {$iq}

{MkStr$

    nproc MkStr$

        parameters s$,n&
        var ns$=""

        whileLoop n&

            ns$=ns$+s$

        wend

        return ns$

    endproc

    {TToUTF

        nproc TToUTF

            parameters text$
            var utf$ = MkStr$(" ",2 * len(text$))
            MultiByteToWideChar(0,1,text$,-1,utf$,len(text$))
            return utf$

        endproc

        {UTFToT

            nproc UTFToT

                parameters utf$
                var text$ = MkStr$(" ",len(utf$))
                WideCharToMultiByte(0,0,utf$,-1,text$,len(utf$) / 2,0,0)
                return text$

            endproc

            {SetTextW

                nproc SetTextW

                    parameters h&,text$
                    return SendMessageW(h&,WM_SETTEXT,0,text$)

                endproc

                {GetTextW

                    nproc GetTextW

                        parameters h&
                        var text$ = MkStr$(" ",255)
                        SendMessageW(h&,WM_GETTEXT,255,text$)
                        return text$

                    endproc

                    {ControlW

                        nproc ControlW

                            parameters Class$,Name$,style&,x&,y&,dx&,dy&,pWnd&,pid&,hInst&,exstyle&
                            var cs& = Dim(40)
                            Long cs&, 0 = 40
                            Long cs&, 4 = hInst&
                            Long cs&, 8 = pid&
                            Long cs&,12 = pWnd&
                            Long cs&,16 = dx& << 16 + dy&
                            Long cs&,20 = x& << 16 + y&
                            Long cs&,24 = style&
                            Long cs&,28 = Addr(Name$)
                            Long cs&,32 = Addr(Class$)
                            Long cs&,36 = exstyle&
                            var handle& = CreateWindowExW(exstyle&,Class$,Name$,style&,x&,y&,dx&,dy&,pWnd&,pid&,hInst&,cs&)
                            Dispose(cs&)
                            return handle&

                        endproc

                        cls
                        Shell "CHARMAP"
                        var Font& = Create("Font","Times New Roman",32,0,0,0,0)
                        var a& = Create("Edit",%hWnd,"ABCDEFGHI",180,5,220,35)
                        print WinError$(%WinError)
                        SetFont a&,Font&
                        var b& = Create("Edit",%hWnd,"",180,40,220,35)
                        print WinError$(%WinError)
                        SetFont b&,Font&
                        var v& = ControlW(TToUTF("EDIT"),"ABCDEFGHI",1342242944,400,5,200,35,%hWnd,1,%hInstance,$200)
                        print WinError$(%WinError)
                        SetFont v&,Font&
                        var w& = ControlW(TToUTF("EDIT"),"ABCDEFGHI",1342242944,400,40,200,35,%hWnd,1,%hInstance,$200)
                        print WinError$(%WinError)
                        SetFont w&,Font&

                        whilenot IsKey(27)

                            waitinput
                            SetText b&,GetText$(a&)
                            SetText w&,GetText$(v&)
                            SetTextW(b&,GetTextW(a&))
                            SetTextW(w&,GetTextW(v&))

                        wend

                        Dele
ct Font& end

Potztausend, The Edits react really aufs hair same. The only Difference lying therein, How I the Text choose. use I The API SendMessageA (So the conventional xprofane Settext/GetText$), then becomes the Unikode gehäckselt. take I against it SendMessageW, then becomes with both Edits everything correctly. transfer.


20 kB
Hochgeladen:12/23/09
Downloadcounter53
Download
 
Nico Madysa
12/23/09  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

2.296 Views

Untitledvor 0 min.
Georg Teles06/29/15
Christian Hahn12/28/12

Themeninformationen

this Topic has 3 subscriber:

Nico Madysa (4x)
iF (3x)
Dieter Zornow (2x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie