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 '.data' data readable writeable
_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
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 '.data' data readable writeable
_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
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 '.data' data readable writeable
_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
Nächstes Thema anzeigen Vorheriges Thema anzeigen
Sie können Beiträge in dieses Forum schreiben. Sie können auf Beiträge in diesem Forum antworten. Sie können Ihre Beiträge in diesem Forum nicht bearbeiten. Sie können Ihre Beiträge in diesem Forum nicht löschen. Sie können an Umfragen in diesem Forum nicht mitmachen.
c++.de ist Teilnehmer des Partnerprogramms von Amazon Europe S.à.r.l. und Partner des Werbeprogramms, das zur Bereitstellung eines Mediums
für Websites konzipiert wurde, mittels dessen durch die Platzierung von Werbeanzeigen und Links zu amazon.de
Werbekostenerstattung verdient werden kann.
Die Vervielfältigung der auf den Seiten www.c-plusplus.de, www.c-plusplus.info, www.c-sar.de, www.c-plusplus.net und www.baeckmann.de
enthaltenen Informationen ohne eine schriftliche Genehmigung des Seitenbetreibers ist untersagt
(vgl. §4 Urheberrechtsgesetz). Die Nutzung und Änderung der vorgestellten Strukturen und Verfahren in
privaten und kommerziellen Softwareanwendungen ist ausdrücklich erlaubt, soweit keine Rechte Dritter verletzt werden.
Der Seitenbetreiber übernimmt keine Gewähr für die Funktion einzelner Beiträge oder Programmfragmente, insbesondere
übernimmt er keine Haftung für eventuelle aus dem Gebrauch entstehenden Folgeschäden.