Such simple things in assembly seem impossable, ive tryed makeing edit controls, by useing CreateWindowEx.. i cant seem to get it to work nomater what i try, eh. im looking for some clear referances, things just dont seem to make sence with iczelions tutorials.
Posted on 2002-05-04 04:37:19 by EvanderCrovax
Show us some of your code and we can help you.
Posted on 2002-05-04 04:41:59 by bdjames
Also,

Try looking at the examples that come withs Iczelions MASM32 package ...
Posted on 2002-05-04 04:45:03 by Dracton
Well, whats required to create a edit, so far ive been told by the tutorials, CreateWindowEx and its associated crap. and the editclass junk. now i build a template from prostart.exe and load the crap into there, and i get a compiler error about invoke doesnt match, blah blah, it doesnt like edit or some crap, ugh..
Posted on 2002-05-04 04:48:23 by EvanderCrovax
Thats alot of crap ;)

Post your source, either zip it up, or with the :CODE: :/CODE: blocks in a reply.

I'll give it a look thru and find what your missing for you. Im sure is something simple, dont worry about it.

:alright:
NaN
Posted on 2002-05-04 05:16:32 by NaN
OFFTOPIC:

Dracon, is that sheep "Dolly"? :)
Posted on 2002-05-04 05:21:19 by bazik
Maybe this can help,

Create parent window:




MainWindow: xor eax, eax ;
push eax ;
push hInstance ;
push eax ;
push eax ;
push MAIN_WINDOW_HEIGHT ;
push MAIN_WINDOW_WIDTH ;
push CW_USEDEFAULT ;
push CW_USEDEFAULT ;
push 94ca0044h ;
push offset className ;
push offset className ;
push 00010100h ;
call CreateWindowEx ;
mov hWnd, eax ;



Create edit window:

                        push                     NULL                                              ;

push hInstance ;
push PORT_EDIT_ID ;
push hWnd ;
push PORT_EDIT_HEIGHT ;
push PORT_EDIT_WIDTH ;
push PORT_EDIT_Y ;
push PORT_EDIT_X ;
push WS_CHILD or WS_VISIBLE or WS_BORDER or ES_LEFT or\;
ES_AUTOHSCROLL or ES_NUMBER or WS_TABSTOP ;
push NULL ;
push offset editClassName ;
push WS_EX_CLIENTEDGE ;
call CreateWindowEx ;
mov hWndPortEdit, eax ;


Show parent window:




DisplayMainWindow: push SW_SHOWDEFAULT ;
push hWnd ;
call ShowWindow ;



Update parent window:




UpdateMainWindow: mov eax, hWnd ;
push eax ;
call UpdateWindow ;



And a message loop:




mov ebx, offset msg ;
jmp @F ;
MainMessageLoop: push ebx ;
call TranslateMessage ;
push ebx ;
call DispatchMessage ;
@@: xor eax, eax ;
push eax ;
push eax ;
push eax ;
push ebx ;
call GetMessage ;
test eax, eax ;
jne MainMessageLoop ;

Posted on 2002-05-04 05:23:28 by bdjames
first off can you assemble the source codes that came with iczelions tutorials? if you cant its probably because you dont have the masm32 package by hutch. this package has alot of neccessities which a newbie will need. unfortunately its doesnt get any easier than iczelions tutuorials. those are the most basic written assembly programs. post some source code.
Posted on 2002-05-04 05:30:02 by smurf
i have the masm32 version 7 package from iczelions page, i still cant compile his tutorials, doesnt make sence :(
Posted on 2002-05-04 06:02:51 by EvanderCrovax
The batch files do not work or you can not install?

<edit> wow what format are those batch files in? </edit>
Posted on 2002-05-04 06:10:24 by bdjames

i have the masm32 version 7 package from iczelions page, i still cant compile his tutorials, doesnt make sence
If you want to be helped, you need to take the hint that several people have offered so far, and be specific and to the point about what your problem is, post some details. Nobody can solve your problems if you just whinge and moan.

You say that Icz's samples will not compile. How are you trying to compile them? What error messages do you get?
Posted on 2002-05-04 06:50:14 by sluggy
well since you have the masm32 package im assuming your using qeditor which is the editor that comes with the package. if this is the case and your using either windows 2000, or xp you will experience problems right off the bat. the qeditor settings need to be modified in order to except spaces that windows 200 and xp commonly have.

to change these settings open qeditor, click on tools on the menu, then scroll down and click on change editor settings. a window will popup and you will need to make some changes in the lower pane of the window. find all the text {b} and change them all to "{b}". this is preserve the spaces in your paths such as C:\Documents and Settings\Desktop\test\test.asm

i have a question myself that maybe someone can help me with. is there anyway to preserve a path that contains periods? for instance if i have a path like this: C:\Documents and Settings\Smurf.Na\Desktop\test\test.asm. currently when i try to assemble test.asm at that location i get an error because my path is only recognized as such: C:\Documents and Settings\Smurf.asm.
Posted on 2002-05-04 15:26:32 by smurf
Post either:

1) Your code that doesn't work
2) The assembly errors you get when you compile...

If we don't have at least 1 of these don't bother with anymore questions as we can't really help and all the crap in the world won't help...

:) :) :)

Sliver
Posted on 2002-05-04 15:47:42 by Sliver
EditID equ 1

.data
EditClass db "edit",0

INVOKE CreateWindowEx,NULL,ADDR EditClass,NULL,\
WS_VISIBLE or WS_CHILD or ES_LEFT or ES_MULTILINE or\
ES_AUTOHSCROLL or ES_AUTOVSCROLL,0,\
15,15,5,5,EditID,\
hInstance,NULL


Compiles without a single error but, doesnt show up on the window....
ive been looking at the examples trying to figure out how this thing works, it doesnt seem to work for me.
Posted on 2002-05-04 18:23:02 by EvanderCrovax
INVOKE CreateWindowEx,NULL,ADDR EditClass,NULL,\
WS_VISIBLE or WS_CHILD or ES_LEFT or ES_MULTILINE\ or ES_AUTOHSCROLL or ES_AUTOVSCROLL,\
15,15,5,5,Posted on 2002-05-04 18:41:48 by bdjames
Try this as an example (tell me if it works and if not then tell me what errors if any you get



.586
.model flat, stdcall
option casemap :none

include /masm32/include/windows.inc
include /masm32/include/kernel32.inc
include /masm32/include/gdi32.inc
include /masm32/include/user32.inc
includelib /masm32/lib/kernel32.lib
includelib /masm32/lib/user32.lib
includelib /masm32/lib/gdi32.lib

WinMain PROTO :DWORD,:DWORD,:DWORD,:DWORD
WndProc PROTO :DWORD,:DWORD,:DWORD,:DWORD
TopXY PROTO :DWORD,:DWORD

.data
ClassName db "Test",0
CaptionText db "Template",0
EditClass db "Edit",0

.data?
hWnd HANDLE ?
hInstance HANDLE ?
hEdit HANDLE ?
hEdit1 HANDLE ?

.code
start:
invoke GetModuleHandle, NULL
mov hInstance, eax
invoke WinMain,hInstance,NULL,NULL,SW_SHOWDEFAULT
invoke ExitProcess,eax

; ########################################################################

WinMain proc hInst:DWORD, hPrevIns:DWORD, CmdLine:DWORD, CmdShow:DWORD

LOCAL wc :WNDCLASSEX
LOCAL msg :MSG
LOCAL Wwd :DWORD
LOCAL Wht :DWORD
LOCAL Wtx :DWORD
LOCAL Wty :DWORD

mov wc.cbSize, SIZEOF WNDCLASSEX
mov wc.style, CS_HREDRAW + CS_VREDRAW
mov wc.lpfnWndProc, OFFSET WndProc
mov wc.cbClsExtra, NULL
mov wc.cbWndExtra, NULL
mov eax, hInstance
mov wc.hInstance, eax
invoke LoadIcon, NULL,IDI_APPLICATION
mov wc.hIcon, eax
mov wc.hIconSm, eax
invoke LoadCursor, NULL,IDC_ARROW
mov wc.hCursor, eax
mov wc.hbrBackground,COLOR_BTNFACE+1
mov wc.lpszMenuName, NULL
mov wc.lpszClassName,OFFSET ClassName
invoke RegisterClassEx, addr wc

mov Wwd, 365
mov Wht, 310

invoke GetSystemMetrics,SM_CXSCREEN
invoke TopXY,Wwd,eax
mov Wtx, eax

invoke GetSystemMetrics,SM_CYSCREEN
invoke TopXY,Wht,eax
mov Wty, eax

invoke CreateWindowEx, 0,
ADDR ClassName,
ADDR CaptionText,
WS_OVERLAPPEDWINDOW,
Wtx,Wty,Wwd,Wht,
NULL,
NULL,
hInst,
NULL
mov hWnd,eax
invoke ShowWindow,hWnd,SW_SHOWNORMAL
invoke UpdateWindow,hWnd

StartLoop:
invoke GetMessage,ADDR msg,NULL,0,0
cmp eax, 0
je ExitLoop
invoke TranslateMessage, ADDR msg
invoke DispatchMessage, ADDR msg
jmp StartLoop
ExitLoop:

mov eax,msg.wParam
ret

WinMain endp

; ########################################################################

WndProc proc hWin:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM

.IF uMsg==WM_DESTROY
invoke PostQuitMessage,NULL

.ELSEIF uMsg == WM_CREATE
invoke CreateWindowEx, WS_EX_CLIENTEDGE,
ADDR EditClass,
0,
WS_CHILD+WS_VISIBLE+ES_READONLY+ ES_MULTILINE,
30,30,300,100,
hWin,
0,
hInstance,
0
mov hEdit,eax

invoke CreateWindowEx, WS_EX_CLIENTEDGE,
ADDR EditClass,
0,
WS_CHILD+WS_VISIBLE+ES_MULTILINE,
30,150,300,100,
hWin,
0,
hInstance,
0
mov hEdit1,eax

invoke SetWindowText,hEdit,addr ClassName
invoke SetWindowText,hEdit1,addr ClassName

.ELSEIF uMsg == WM_CTLCOLORSTATIC
mov eax,lParam
.if eax == hEdit
invoke GetStockObject, WHITE_BRUSH
ret
.endif

.ELSEIF uMsg == WM_COMMAND
mov eax,wParam
shr eax,16
.if ax == EN_SETFOCUS
mov eax,lParam
.if eax == hEdit
invoke DestroyCaret
.endif
.endif

.ELSE
invoke DefWindowProc,hWin,uMsg,wParam,lParam
ret
.ENDIF
xor eax,eax
ret

WndProc endp

; ########################################################################

TopXY proc wDim:DWORD, sDim:DWORD

shr sDim, 1
shr wDim, 1
mov eax, wDim
sub sDim, eax
mov eax,sDim
ret

TopXY endp

; #########################################################################

end start

Posted on 2002-05-04 18:43:22 by Sliver
thats dumb, i had it before and it didnt show up, i even resized it to see if it would show up it didnt :( well, so much the better, it works now thanks :grin:
Posted on 2002-05-04 18:47:15 by EvanderCrovax
EvanderCrovax: hehe, i thought your code was kinda funny. you had the size of your editbox set to 5 x 5 which is so small its almost impossible to see by the human eye. it was probably there you just couldnt see it.:grin:
Posted on 2002-05-04 19:39:08 by smurf
LMFAO! I KNOW, i had it big in the beginning but i changed it cause i thought it was going out of the screen or something lol. so i just put it small, but i can see it at 5x5 its just a very very small white line about 1 pix by 5 pix :P

(can you say microscope?)
Posted on 2002-05-04 23:22:27 by EvanderCrovax