flat assembler
Message board for the users of flat assembler.
Index
> Windows > Where can I find a list of EDIT style names/values? |
Author |
|
revolution 25 Jan 2013, 13:06
Well the very first Google result for me searching for "WS_VISIBLE" (without the quotes) gave this:
Window Styles |
|||
25 Jan 2013, 13:06 |
|
AsmGuru62 25 Jan 2013, 17:01
'+' sometimes will not work properly if a style has not a single bit but more bits.
'or' must be used instead of a '+'. Code: WS_VISIBLE or ES_MULTILINE or ES_WANTRETURN or WS_CHILD ... etc. .. |
|||
25 Jan 2013, 17:01 |
|
krzys135 26 Jan 2013, 17:18
Thanks for Yours help. But now i have problem with exiting after hitting ESC. I have written something like that.
Code: format PE GUI 4.0 entry start include 'WIN32A.INC' ; ------------------------------------------------------------------------------------- IDD_DIALOG = 100 IDC_EDT_1 = 1000 IDC_EDT_2 = 1001 IDC_BTN_ADD = 1002 IDC_BTN_CLR = 1003 AW_ACTIVATE equ 00020000h AW_CENTER equ 00000010h AW_HIDE equ 00010000h ; ------------------------------------------------------------------------------------- section '.code' code readable executable start: invoke GetModuleHandle,0 invoke DialogBoxParam,eax,IDD_DIALOG,HWND_DESKTOP,DialogProc,0 or eax,eax jz exit exit: invoke ExitProcess,0 ; ------------------------------------------------------------------------------------- proc DialogProc uses esi edi ebx,hwnddlg,msg,wparam,lparam cmp [msg],WM_INITDIALOG je .wminitdialog cmp [msg],WM_COMMAND je .wmcommand cmp [msg], WM_KEYDOWN je .wmkeydown cmp [msg],WM_CLOSE je .wmclose xor eax,eax jmp .quit .wminitdialog: invoke AnimateWindow,[hwnddlg],500,AW_ACTIVATE or AW_CENTER invoke SetFocus,[hwnddlg] invoke SendDlgItemMessage,[hwnddlg],IDC_EDT_1,EM_LIMITTEXT,8,0 jmp .processed .wmcommand: cmp [wparam], BN_CLICKED shl 16 + IDC_BTN_ADD je .ADD cmp [wparam], BN_CLICKED shl 16 + IDC_BTN_CLR je .CLEAR cmp [wparam], VK_ESCAPE je .wmclose jmp .processed .ADD: invoke GetDlgItemInt,[hwnddlg],IDC_EDT_1,0,TRUE mov ebx,eax invoke GetDlgItemInt,[hwnddlg],IDC_EDT_2,0,TRUE add eax,ebx invoke SetDlgItemInt,[hwnddlg],IDC_EDT_2,eax,TRUE invoke SetDlgItemText,[hwnddlg],IDC_EDT_1,clear jmp .processed .CLEAR: invoke SetDlgItemText,[hwnddlg],IDC_EDT_1,clear invoke SetDlgItemText,[hwnddlg],IDC_EDT_2,clear jmp .processed .wmkeydown: ;cmp [wparam], VK_ESCAPE ;jne .wmclose .wmclose: invoke AnimateWindow,[hwnddlg],500,AW_HIDE or AW_CENTER invoke EndDialog,[hwnddlg],NULL invoke EndDialog,[hwnddlg],0 .processed: mov eax,1 .quit: ret endp ; ------------------------------------------------------------------------------------- section '.idata' import data readable writeable library kernel,'KERNEL32.DLL',\ user,'USER32.DLL' import kernel,\ GetModuleHandle,'GetModuleHandleA',\ lstrcat, 'lstrcat',\ ExitProcess,'ExitProcess' import user,\ DialogBoxParam,'DialogBoxParamA',\ SetDlgItemText,'SetDlgItemTextA',\ SendDlgItemMessage ,'SendDlgItemMessageW',\ LoadIcon , 'LoadIconA',\ SendMessage , 'SendMessageA',\ AnimateWindow, 'AnimateWindow',\ SetFocus , 'SetFocus',\ GetDlgItemInt, 'GetDlgItemInt',\ SetDlgItemInt, 'SetDlgItemInt',\ wsprintf, 'wsprintfA',\ MessageBox, 'MessageBoxA',\ EndDialog,'EndDialog' ; ------------------------------------------------------------------------------------- section '.text' readable writeable clear db "",0 ; ------------------------------------------------------------------------------------- section '.rc' resource data readable directory RT_DIALOG,dialogs resource dialogs,IDD_DIALOG,LANG_ENGLISH+SUBLANG_DEFAULT,main_dialog dialog main_dialog,'Kalkulator',150,150,150,120,WS_POPUP+WS_VISIBLE+WS_CAPTION+WS_SYSMENU+0x0800+WS_GROUP,0,0,"Lucida Console",11 dialogitem 'BUTTON','Dodawanie liczb',-1,7,5,140,100,0x00000007+WS_VISIBLE,0 dialogitem 'EDIT',"",IDC_EDT_1,12,34,48,15,WS_BORDER+0x2000+WS_VISIBLE+ES_RIGHT dialogitem 'EDIT',"",IDC_EDT_2,12,65,48,15,WS_BORDER+0x2000+WS_VISIBLE+ES_RIGHT+0x0800 dialogitem 'BUTTON',"+",IDC_BTN_ADD,80,30,20,20,WS_VISIBLE+WS_OVERLAPPED dialogitem 'BUTTON',"CLEAR",IDC_BTN_CLR,80,65,26,12, WS_VISIBLE+WS_OVERLAPPED enddialog |
|||
26 Jan 2013, 17:18 |
|
Walter 26 Jan 2013, 18:17
Use
cmp [wparam],IDCANCEL instead of cmp [wparam],VK_ESCAPE |
|||
26 Jan 2013, 18:17 |
|
krzys135 26 Jan 2013, 18:48
Thanks, it helps a lot
I have another problem i want to save value from eax to variable. If i declare it like this and want to move eax i have errors. sum dq 1 mov sum, [eax] |
|||
26 Jan 2013, 18:48 |
|
Walter 26 Jan 2013, 19:26
Not sure what you are trying to accomplish here, but,
best quess is two things. Instruction syntax and size. If you are trying to move the value of eax to the variable sum: mov [sum],eax ; general register to memory but then you will find that you have a size issue. eax is 32bits and sum (as you defined it) is 64 bits. Something will be needed there (perhaps sum defined as dd). See page 22 of FASM manual. |
|||
26 Jan 2013, 19:26 |
|
Force 29 Jan 2013, 01:20
Hi krzys135
I think you were confused in this code because i just used numbers in resource dialogitem 'EDIT',"",IDC_EDT_2,12,65,48,15,WS_BORDER+0x2000+WS_VISIBLE+ES_RIGHT+0x0800 0x2000 = ES_NUMBER 0x0800 = DS_CENTER |
|||
29 Jan 2013, 01:20 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.