flat assembler
Message board for the users of flat assembler.

Index > Windows > Chinese charset menues

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
bitRAKE



Joined: 21 Jul 2003
Posts: 4073
Location: vpcmpistri
bitRAKE 12 Jan 2008, 16:25
Does this file work?


Description:
Download
Filename: chtest.rar
Filesize: 3.8 KB
Downloaded: 275 Time(s)

Post 12 Jan 2008, 16:25
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 12 Jan 2008, 16:29
Please note that using "include 'win32wx.inc'" would be just enough (".end entry_point" will make up the import table with the APIs you have used and the package is aware of).
Post 12 Jan 2008, 16:29
View user's profile Send private message Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6115
Location: Poland
MHajduk 12 Jan 2008, 16:30
As you can see it works excellent Smile


Description: FASM Coder
Filesize: 5.11 KB
Viewed: 7184 Time(s)

MTF5F.png


Post 12 Jan 2008, 16:30
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4073
Location: vpcmpistri
bitRAKE 12 Jan 2008, 16:35
On my system notepad creates different UTF-8 files - I just removed the characters at the start and winged it.
Post 12 Jan 2008, 16:35
View user's profile Send private message Visit poster's website Reply with quote
snrtrui



Joined: 11 Jan 2008
Posts: 14
Location: China
snrtrui 12 Jan 2008, 17:03
Very good!

but you dosn't use The section '.idata' ???

what's the method for your program to display the chinese meun?
Post 12 Jan 2008, 17:03
View user's profile Send private message Visit poster's website Reply with quote
snrtrui



Joined: 11 Jan 2008
Posts: 14
Location: China
snrtrui 12 Jan 2008, 17:11
when I modify the exemple ,It dosn't dispaly chinese menu?

what wrong?

code:


; Simple text editor - fasm example program

format PE GUI 4.0
entry start
include '\encoding\utf8.inc'
include 'win32a.inc'

IDM_NEW = 101
IDM_EXIT = 102
IDM_ABOUT = 901

section '.data' data readable writeable

_class TCHAR 'MINIPAD32',0
_edit TCHAR 'EDIT',0

_title TCHAR 'MiniPad',0
_about_title TCHAR 'About MiniPad',0
_about_text TCHAR 'This is Win32 example program created with flat assembler.',0
_error TCHAR 'Startup failed.',0

wc WNDCLASS 0,WindowProc,0,0,NULL,NULL,NULL,COLOR_BTNFACE+1,NULL,_class

edithwnd dd ?
editfont dd ?

msg MSG
client RECT

section '.code' code readable executable

start:

invoke GetModuleHandle,0
mov [wc.hInstance],eax
invoke LoadIcon,eax,17
mov [wc.hIcon],eax
invoke LoadCursor,0,IDC_ARROW
mov [wc.hCursor],eax
invoke RegisterClass,wc
test eax,eax
jz error

invoke LoadMenu,[wc.hInstance],37
invoke CreateWindowEx,0,_class,_title,WS_VISIBLE+WS_OVERLAPPEDWINDOW,144,128,256,256,NULL,eax,[wc.hInstance],NULL
test eax,eax
jz error

msg_loop:
invoke GetMessage,msg,NULL,0,0
cmp eax,1
jb end_loop
jne msg_loop
invoke TranslateMessage,msg
invoke DispatchMessage,msg
jmp msg_loop

error:
invoke MessageBox,NULL,_error,NULL,MB_ICONERROR+MB_OK

end_loop:
invoke ExitProcess,[msg.wParam]

proc WindowProc hwnd,wmsg,wparam,lparam
push ebx esi edi
cmp [wmsg],WM_CREATE
je .wmcreate
cmp [wmsg],WM_SIZE
je .wmsize
cmp [wmsg],WM_SETFOCUS
je .wmsetfocus
cmp [wmsg],WM_COMMAND
je .wmcommand
cmp [wmsg],WM_DESTROY
je .wmdestroy
.defwndproc:
invoke DefWindowProc,[hwnd],[wmsg],[wparam],[lparam]
jmp .finish
.wmcreate:
invoke GetClientRect,[hwnd],client
invoke CreateWindowEx,WS_EX_CLIENTEDGE,_edit,0,WS_VISIBLE+WS_CHILD+WS_HSCROLL+WS_VSCROLL+ES_AUTOHSCROLL+ES_AUTOVSCROLL+ES_MULTILINE,[client.left],[client.top],[client.right],[client.bottom],[hwnd],0,[wc.hInstance],NULL
or eax,eax
jz .failed
mov [edithwnd],eax
invoke CreateFont,16,0,0,0,0,FALSE,FALSE,FALSE,ANSI_CHARSET,OUT_RASTER_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,FIXED_PITCH+FF_DONTCARE,NULL
or eax,eax
jz .failed
mov [editfont],eax
invoke SendMessage,[edithwnd],WM_SETFONT,eax,FALSE
xor eax,eax
jmp .finish
.failed:
or eax,-1
jmp .finish
.wmsize:
invoke GetClientRect,[hwnd],client
invoke MoveWindow,[edithwnd],[client.left],[client.top],[client.right],[client.bottom],TRUE
xor eax,eax
jmp .finish
.wmsetfocus:
invoke SetFocus,[edithwnd]
xor eax,eax
jmp .finish
.wmcommand:
mov eax,[wparam]
and eax,0FFFFh
cmp eax,IDM_NEW
je .new
cmp eax,IDM_ABOUT
je .about
cmp eax,IDM_EXIT
je .wmdestroy
jmp .defwndproc
.new:
invoke SendMessage,[edithwnd],WM_SETTEXT,0,0
jmp .finish
.about:
invoke MessageBox,[hwnd],_about_text,_about_title,MB_OK
jmp .finish
.wmdestroy:
invoke DeleteObject,[editfont]
invoke PostQuitMessage,0
xor eax,eax
.finish:
pop edi esi ebx
ret
endp

section '.idata' import data readable writeable

library kernel,'KERNEL32.DLL',\
user,'USER32.DLL',\
gdi,'GDI32.DLL'

import kernel,\
GetModuleHandle,'GetModuleHandleA',\
ExitProcess,'ExitProcess'

import user,\
RegisterClass,'RegisterClassA',\
CreateWindowEx,'CreateWindowExA',\
DefWindowProc,'DefWindowProcA',\
SetWindowLong,'SetWindowLongA',\
RedrawWindow,'RedrawWindow',\
GetMessage,'GetMessageA',\
TranslateMessage,'TranslateMessage',\
DispatchMessage,'DispatchMessageA',\
SendMessage,'SendMessageA',\
LoadCursor,'LoadCursorA',\
LoadIcon,'LoadIconA',\
LoadMenu,'LoadMenuA',\
GetClientRect,'GetClientRect',\
MoveWindow,'MoveWindow',\
SetFocus,'SetFocus',\
MessageBox,'MessageBoxA',\
PostQuitMessage,'PostQuitMessage'

import gdi,\
CreateFont,'CreateFontA',\
DeleteObject,'DeleteObject'

section '.rsrc' resource data readable

; resource directory

directory RT_MENU,menus,\
RT_ICON,icons,\
RT_GROUP_ICON,group_icons,\
RT_VERSION,versions

; resource subdirectories

resource menus,\
37,LANG_ENGLISH+SUBLANG_DEFAULT,main_menu

resource icons,\
1,LANG_NEUTRAL,icon_data

resource group_icons,\
17,LANG_NEUTRAL,main_icon

resource versions,\
1,LANG_NEUTRAL,version

menu main_menu
menuitem '&F中文',0,MFR_POPUP
menuitem '&New',IDM_NEW
menuseparator
menuitem 'E&xit',IDM_EXIT,MFR_END
menuitem '中文',0,MFR_POPUP + MFR_END
menuitem '&About...',IDM_ABOUT,MFR_END

icon main_icon,icon_data,'minipad.ico'

versioninfo version,VOS__WINDOWS32,VFT_APP,VFT2_UNKNOWN,LANG_ENGLISH+SUBLANG_DEFAULT,0,\
'FileDescription','MiniPad - example program',\
'LegalCopyright','No rights reserved.',\
'FileVersion','1.0',\
'ProductVersion','1.0',\
'OriginalFilename','MINIPAD.EXE'
Post 12 Jan 2008, 17:11
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4073
Location: vpcmpistri
bitRAKE 12 Jan 2008, 17:21
include 'win32w.inc'
Post 12 Jan 2008, 17:21
View user's profile Send private message Visit poster's website Reply with quote
snrtrui



Joined: 11 Jan 2008
Posts: 14
Location: China
snrtrui 12 Jan 2008, 17:24
OH,I know it ,the " 'win32wx.inc'" included All import ...
Post 12 Jan 2008, 17:24
View user's profile Send private message Visit poster's website Reply with quote
snrtrui



Joined: 11 Jan 2008
Posts: 14
Location: China
snrtrui 12 Jan 2008, 17:34
when i used " include '\win32w.inc'"

the program passed compile , but program can't run !
Post 12 Jan 2008, 17:34
View user's profile Send private message Visit poster's website Reply with quote
snrtrui



Joined: 11 Jan 2008
Posts: 14
Location: China
snrtrui 12 Jan 2008, 17:45
I know ,the editer must in UTF-8 mode.
when it in other (ansi) mode ,it dosn't dispaly the true words.
Post 12 Jan 2008, 17:45
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4073
Location: vpcmpistri
bitRAKE 12 Jan 2008, 18:23
Please, try it this way.


Description:
Download
Filename: MINIPAD.rar
Filesize: 2.98 KB
Downloaded: 279 Time(s)

Post 12 Jan 2008, 18:23
View user's profile Send private message Visit poster's website Reply with quote
snrtrui



Joined: 11 Jan 2008
Posts: 14
Location: China
snrtrui 12 Jan 2008, 18:43
when I use the IDE(FASMW)

the "中文" changed to “涓枃”
"
menu main_menu
menuitem '&F涓枃',0,MFR_POPUP
menuitem '&New',IDM_NEW
menuseparator
menuitem 'E&xit',IDM_EXIT,MFR_END
menuitem '涓枃',0,MFR_POPUP + MFR_END
menuitem '&About...',IDM_ABOUT,MFR_END
"
Post 12 Jan 2008, 18:43
View user's profile Send private message Visit poster's website Reply with quote
snrtrui



Joined: 11 Jan 2008
Posts: 14
Location: China
snrtrui 12 Jan 2008, 18:47
snrtrui wrote:
when I use the IDE(FASMW)

the "中文" changed to “涓枃”
"
menu main_menu
menuitem '&F涓枃',0,MFR_POPUP
menuitem '&New',IDM_NEW
menuseparator
menuitem 'E&xit',IDM_EXIT,MFR_END
menuitem '涓枃',0,MFR_POPUP + MFR_END
menuitem '&About...',IDM_ABOUT,MFR_END
"


Description:
Download
Filename: MINIPADs.rar
Filesize: 22.48 KB
Downloaded: 266 Time(s)


_________________
☆-DREAM-☆
Post 12 Jan 2008, 18:47
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 12 Jan 2008, 20:09
I have just realized that this discussion was taking place at "secret instructions" at Compiler Internals forum.

God, what a mix Smile Even this split is a half offtopic Razz
Post 12 Jan 2008, 20:09
View user's profile Send private message Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1614
Location: Ukraine
shoorick 14 Jan 2008, 05:55
here at forum already was a project with switching english/chinese menus - search forum for it.
Post 14 Jan 2008, 05:55
View user's profile Send private message Visit poster's website Reply with quote
LiuGuoHua(Chinese)



Joined: 26 Sep 2003
Posts: 25
LiuGuoHua(Chinese) 29 Jul 2008, 08:46
Let me explain the phenomenon.
In Chinese, "XX one's mother" is very vicious saying and it becomes a "Country's Curse". So Google translate "Fuck you" as "你他妈的". The literally meaning is "Your mother's ...".
I don't know what the back translated word means in English.
Post 29 Jul 2008, 08:46
View user's profile Send private message Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1614
Location: Ukraine
shoorick 29 Jul 2008, 08:59
LiuGuoHua(Chinese)
yeah... it's very significant phenomen in building multylanguage menus!
Post 29 Jul 2008, 08:59
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.