English
Forum

Unicode-characters in CreateText

 
- Page 1 -



Julian
Schmidt
Hi,
i'd gladly one Unicode-characters (u+2192) in a Static spend.
gives it there any Opportunities?

LG

Julian57
 
XProfan X2
Win7 Home Premium, SP1, AMD Athlon(tm) II Neo K125 Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
04/02/12  
 



« this Posting watts as Solution marked. »


Julian
Schmidt
OK, so working everything.
thanks IF. you were me large Help.
 $H Messages.ph
CLS
Struct CREATESTRUCT = lpCreateParams&, hInstance&, hMenu&, hwndParent&, cy%, cx%, y%, x%, style&, lpszName&, lpszClass&, dwExStyle&
var id% = 1
Var static&=CreateW("Static","Das is a Static. \nHier should Unicode-characters mere.",$50000000,10,10,width(%hwnd)-20,35,%hwnd,0,%hinstance)
Waitinput
SetText static&,chr $($2192)
External("USER32","SetWindowTextW",static&,utf("Test ")+chr $($92)+chr $($21)+utf(" Test"))
Waitinput
End

Proc UTF

    parameters Text$
    declare b#
    Dim b#,2*len(text $)+2
    StringW b#,0 = Text$
    Text$ = Char$(b #,0,SizeOf(b#)-2)
    return Text$

ENDPROC

Proc CreateW

    If %pCount > 10

        Parameters Class$,name$,style&,x%,y%,dx%,dy%,pWnd&,pid%,hInst&,exstyle&

    Else

        Parameters Class$,name$,style&,x%,y%,dx%,dy%,pWnd&,pid%,hInst&
        Var exstyle& = 0

    EndIf

    Class$ = UTF(Class$)
    name$ = UTF(name$)
    Var cs# = New(CREATESTRUCT)

    With cs#

        .lpCreateParams& = SizeOf(cs#)
        .hInstance& = hInst&
        .hMenu& = If(External("USER32","IsMenu",id%),id%,0)
        .hwndParent& = pWnd&
        .cy% = dy%
        .cx% = dx%
        .y% = y%
        .x% = x%
        .style& = style&
        .lpszName& = Addr(name$)
        .lpszClass& = Addr(Class$)
        .dwExStyle& = exstyle&

    EndWith

    Var handle& = External("USER32","CreateWindowExW",exstyle&,Addr(Class$),Addr(name$),style&,x%,y%,dx%,dy%,pWnd&,id%,hInst&,cs#)
    inc id%

    Ifnot handle&

        Class$ = WinError$(%WinError)
        MessageBox("Es trod following Error on:\n\n" + Class$,"F E H L E R !!!",4096)

    EndIf

    Dispose cs#
    Return handle&

ENDPROC

 
XProfan X2
Win7 Home Premium, SP1, AMD Athlon(tm) II Neo K125 Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
04/02/12  
 



simply one Unicode-Static z.B. with createWindowW lay out.

If only around the spending goes then helps you vlt. too DrawTextW or one HTMLWin.

look time here Gibts a CreateW-Proc of Nico:  [...] 
 
04/02/12  
 




Julian
Schmidt
It's all right not only around the spending, separate i want already one Static use.
the create the Statics is so far Yes simply. only How do I then Unicode-characters insert?
CLS
Var class$="Static"
Var title$="Das is a Static. \nHier should Unicode-characters mere."
Var static&=External("USER32","CreateWindowExA",0,addr(class$),addr(title$),$50000000,10,10,width(%hwnd)-20,35,%hwnd,0,%hinstance,10000)
'Var static&=External("USER32","CreateWindowExW",0,addr(class$),addr(title$),$50000000,10,10,width(%hwnd)-20,35,%hwnd,0,%hinstance,10000)
Waitinput
 
XProfan X2
Win7 Home Premium, SP1, AMD Athlon(tm) II Neo K125 Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
04/02/12  
 



but not one Ansi-byte hold one Word per characters and there XProfan-Strings binärsicher are you can easily by chr$($08)+chr$($90) join.

Übrigens: UTF-8-Symbols-Kompilation:  [...] 
 
04/02/12  
 




Julian
Schmidt
How Dou you mean the?
example?
 
XProfan X2
Win7 Home Premium, SP1, AMD Athlon(tm) II Neo K125 Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
04/02/12  
 



You write u+2192 -

means Try time setText notAuniqueButCoolhandleOfAUnicodeStaticControlHandle&,chr$(2192) -

I know now not whether XProfan the then already of self correctly abarbeitet and 2 byte einfügt.
 
04/02/12  
 




Julian
Schmidt
apparently not...
CLS
Var class$="Static"
Var title$="Das is a Static. \nHier should nachfolgend one Unicode-characters mere."
Var static&=External("USER32","CreateWindowExA",0,addr(class$),addr(title$),$50000000,10,10,width(%hwnd)-20,35,%hwnd,0,%hinstance,10000)
'Var static&=External("USER32","CreateWindowExW",0,addr(class$),addr(title$),$50000000,10,10,width(%hwnd)-20,35,%hwnd,0,%hinstance,10000)
Waitinput
SetText static&,chr $(2192)
Waitinput
 
XProfan X2
Win7 Home Premium, SP1, AMD Athlon(tm) II Neo K125 Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
04/02/12  
 



Jo, gives unfortunately 1 instead of 2 from:
 {$cleq}
print len(chr $(256))
Waitinput

then can Yes z.B. by:
SetText static&,chr $(hibyte($2192))+chr $(lobyte($2192))+"\z\z"
your characters set but somehow missing me in Your example a unicode-WndProc How tappt im dunkeln Nico vormacht.
 
04/02/12  
 




Julian
Schmidt
Hi IF,
I habs now attempts with Nico's CreateW umzusetzen.
it shining me now too objectively Unicode-characters auszugeben, though unfortunately not the characters that I really having wished.
I have me my characters in the windows own Zeichentabelle exquisite. I thought left under be the Unicode-worth to find.
If I this worth in my Prog. einsetzte comes but one other characters out.
have I the not whom korrekten Unicode-worth of my Zeichens, or operates my code not correctly?


 $H Messages.ph
CLS
Struct CREATESTRUCT = lpCreateParams&, hInstance&, hMenu&, hwndParent&, cy%, cx%, y%, x%, style&, lpszName&, lpszClass&, dwExStyle&
var id% = 1
Var static&=CreateW("Static","Das is a Static. \nHier should Unicode-characters mere.",$50000000,10,10,width(%hwnd)-20,35,%hwnd,0,%hinstance)
Waitinput
SetText static&,chr $($2192)
Waitinput
End

Proc HiByte

    Parameters word%
    Return word% >> 8

ENDPROC

Proc LoByte

    Parameters word%
    Return word% & $FF

ENDPROC

Proc UTF

    parameters Text$
    declare b#
    Dim b#,2*len(text $)+2
    StringW b#,0 = Text$
    Text$ = Char$(b #,0,SizeOf(b#)-2)
    return Text$

ENDPROC

Proc CreateW

    If %pCount > 10

        Parameters Class$,name$,style&,x%,y%,dx%,dy%,pWnd&,pid%,hInst&,exstyle&

    Else

        Parameters Class$,name$,style&,x%,y%,dx%,dy%,pWnd&,pid%,hInst&
        Var exstyle& = 0

    EndIf

    Class$ = UTF(Class$)
    name$ = UTF(name$)
    Var cs# = New(CREATESTRUCT)

    With cs#

        .lpCreateParams& = SizeOf(cs#)
        .hInstance& = hInst&
        .hMenu& = If(External("USER32","IsMenu",id%),id%,0)
        .hwndParent& = pWnd&
        .cy% = dy%
        .cx% = dx%
        .y% = y%
        .x% = x%
        .style& = style&
        .lpszName& = Addr(name$)
        .lpszClass& = Addr(Class$)
        .dwExStyle& = exstyle&

    EndWith

    Var handle& = External("USER32","CreateWindowExW",exstyle&,Addr(Class$),Addr(name$),style&,x%,y%,dx%,dy%,pWnd&,id%,hInst&,cs#)
    inc id%

    Ifnot handle&

        Class$ = WinError$(%WinError)
        MessageBox("Es trod following Error on:\n\n" + Class$,"F E H L E R !!!",4096)

    EndIf

    Dispose cs#
    Return handle&

ENDPROC


39 kB
Hochgeladen:04/02/12
Downloadcounter179
Download
 
XProfan X2
Win7 Home Premium, SP1, AMD Athlon(tm) II Neo K125 Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
04/02/12  
 



here look so GEHTS:
 $H Messages.ph
CLS
Struct CREATESTRUCT = lpCreateParams&, hInstance&, hMenu&, hwndParent&, cy%, cx%, y%, x%, style&, lpszName&, lpszClass&, dwExStyle&
Var hUser& = ImportDLL("USER32","u_")
var id% = 1
Var static&=CreateW("Static","Das is a Static. \nHier should Unicode-characters mere.",$50000000,10,10,width(%hwnd)-20,35,%hwnd,0,%hinstance)
Waitinput
declare s$
s$=chr $($92)+chr $($21)+"\z\z"
u_SetWindowTextW(static&,addr(s$))
Waitinput
FreeDLL hUser&
End

Proc UTF

    parameters Text$
    declare b#
    Dim b#,2*len(text $)+2
    StringW b#,0 = Text$
    Text$ = Char$(b #,0,SizeOf(b#)-2)
    return Text$

ENDPROC

Proc CreateW

    If %pCount > 10

        Parameters Class$,name$,style&,x%,y%,dx%,dy%,pWnd&,pid%,hInst&,exstyle&

    Else

        Parameters Class$,name$,style&,x%,y%,dx%,dy%,pWnd&,pid%,hInst&
        Var exstyle& = 0

    EndIf

    Class$ = UTF(Class$)
    name$ = UTF(name$)
    Var cs# = New(CREATESTRUCT)

    With cs#

        .lpCreateParams& = SizeOf(cs#)
        .hInstance& = hInst&
        .hMenu& = if(u_IsMenu(id%),id%,0)
        .hwndParent& = pWnd&
        .cy% = dy%
        .cx% = dx%
        .y% = y%
        .x% = x%
        .style& = style&
        .lpszName& = Addr(name$)
        .lpszClass& = Addr(Class$)
        .dwExStyle& = exstyle&

    EndWith

    Var handle& = u_CreateWindowExW(exstyle&,Addr(Class$),Addr(name$),style&,x%,y%,dx%,dy%,pWnd&,id%,hInst&,cs#)
    inc id%

    Ifnot handle&

        Class$ = WinError$(%WinError)
        MessageBox("Es trod following Error on:\n\n" + Class$,"F E H L E R !!!",4096)

    EndIf

    Dispose cs#
    Return handle&

ENDPROC

 
04/02/12  
 




Julian
Schmidt
and How is it, if I the characters with others Strings join would like?
 $H Messages.ph
CLS
Struct CREATESTRUCT = lpCreateParams&, hInstance&, hMenu&, hwndParent&, cy%, cx%, y%, x%, style&, lpszName&, lpszClass&, dwExStyle&
var id% = 1
Var static&=CreateW("Static","Das is a Static. \nHier should Unicode-characters mere.",$50000000,10,10,width(%hwnd)-20,35,%hwnd,0,%hinstance)
Waitinput
SetText static&,chr $($2192)
External("USER32","SetWindowTextW",static&,"Test/z/z"+chr $($92)+chr $($21))+" \z\zTest"
Waitinput
End

Proc UTF

    parameters Text$
    declare b#
    Dim b#,2*len(text $)+2
    StringW b#,0 = Text$
    Text$ = Char$(b #,0,SizeOf(b#)-2)
    return Text$

ENDPROC

Proc CreateW

    If %pCount > 10

        Parameters Class$,name$,style&,x%,y%,dx%,dy%,pWnd&,pid%,hInst&,exstyle&

    Else

        Parameters Class$,name$,style&,x%,y%,dx%,dy%,pWnd&,pid%,hInst&
        Var exstyle& = 0

    EndIf

    Class$ = UTF(Class$)
    name$ = UTF(name$)
    Var cs# = New(CREATESTRUCT)

    With cs#

        .lpCreateParams& = SizeOf(cs#)
        .hInstance& = hInst&
        .hMenu& = If(External("USER32","IsMenu",id%),id%,0)
        .hwndParent& = pWnd&
        .cy% = dy%
        .cx% = dx%
        .y% = y%
        .x% = x%
        .style& = style&
        .lpszName& = Addr(name$)
        .lpszClass& = Addr(Class$)
        .dwExStyle& = exstyle&

    EndWith

    Var handle& = External("USER32","CreateWindowExW",exstyle&,Addr(Class$),Addr(name$),style&,x%,y%,dx%,dy%,pWnd&,id%,hInst&,cs#)
    inc id%

    Ifnot handle&

        Class$ = WinError$(%WinError)
        MessageBox("Es trod following Error on:\n\n" + Class$,"F E H L E R !!!",4096)

    EndIf

    Dispose cs#
    Return handle&

ENDPROC

 
XProfan X2
Win7 Home Premium, SP1, AMD Athlon(tm) II Neo K125 Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
04/02/12  
 



Like that?
External("USER32","SetWindowTextW",static&,"T\ze\zs\zt\z\z\z")

or.
s$=utf("Test")
External("USER32","SetWindowTextW",static&,addr(s$))

characters has hold 2 instead of 1 byte and String would like instead of only with \z (chr(0)) with \z\z DoppelNull "nullterminiert" go.
 
04/02/12  
 




Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

17.546 Views

Untitledvor 0 min.
E.T.01/14/24
Sven Bader02/25/21
Langer12/30/20
Manfred Barei02/23/20
More...

Themeninformationen



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