Td Win32asm 013.Asm

Post on 02-Jun-2018

219 views 0 download

transcript

8/10/2019 Td Win32asm 013.Asm

http://slidepdf.com/reader/full/td-win32asm-013asm 1/12

td_win32asm_013.asm;==============================================================================; Test Department's WINDOWS 32 BIT x86 ASSEMBLY example's 013;==============================================================================

;==============================================================================; ==> Part 013 : Tab control class;------------------------------------------------------------------------------

; Hello everybody,; here is my TAB control example.; Like other win32asm example I show only the basics.;; The interesting thing for me was the SS_CENTERIMAGE style on a STATIC control.; If the STATIC control is greater than the picture the rest of the; STATIC control is filled with the picture color at coordinates 0,0.;;; TD td@crahkob.com

;;==============================================================================; Assembler directives;------------------------------------------------------------------------------.386 ; the processor our program want run on.Model Flat ,StdCall ; always the same for Win9x (32 Bit)option casemap:none ; case sensitive !!!

;==============================================================================; Include all files where API functins resist you want use, set correct path

;------------------------------------------------------------------------------include D:\Masm32\include\windows.incincludelib kernel32.libincludelib user32.libincludelib comctl32.libincludelib gdi32.lib

;==============================================================================; Declaration of used API functions,take a look into WIN32.HLP and *.inc files;------------------------------------------------------------------------------

GetModuleHandleA PROTO :DWORDMessageBoxA PROTO :DWORD,:DWORD,:DWORD,:DWORDInitCommonControls PROTOLoadIconA PROTO :DWORD,:DWORDLoadCursorA PROTO :DWORD,:DWORDRegisterClassExA PROTO :DWORDCreateSolidBrush PROTO :DWORDCreateWindowExA PROTO :DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD,  :DWORD,:DWORD,:DWORD,:DWORD,:DWORDShowWindow PROTO :DWORD,:DWORDUpdateWindow PROTO :DWORD

GetMessageA PROTO :DWORD,:DWORD,:DWORD,:DWORDTranslateMessage PROTO :DWORDDispatchMessageA PROTO :DWORDPostQuitMessage PROTO :DWORD

Page 1

8/10/2019 Td Win32asm 013.Asm

http://slidepdf.com/reader/full/td-win32asm-013asm 2/12

8/10/2019 Td Win32asm 013.Asm

http://slidepdf.com/reader/full/td-win32asm-013asm 3/12

8/10/2019 Td Win32asm 013.Asm

http://slidepdf.com/reader/full/td-win32asm-013asm 4/12

8/10/2019 Td Win32asm 013.Asm

http://slidepdf.com/reader/full/td-win32asm-013asm 5/12

8/10/2019 Td Win32asm 013.Asm

http://slidepdf.com/reader/full/td-win32asm-013asm 6/12

8/10/2019 Td Win32asm 013.Asm

http://slidepdf.com/reader/full/td-win32asm-013asm 7/12

8/10/2019 Td Win32asm 013.Asm

http://slidepdf.com/reader/full/td-win32asm-013asm 8/12

8/10/2019 Td Win32asm 013.Asm

http://slidepdf.com/reader/full/td-win32asm-013asm 9/12

8/10/2019 Td Win32asm 013.Asm

http://slidepdf.com/reader/full/td-win32asm-013asm 10/12

8/10/2019 Td Win32asm 013.Asm

http://slidepdf.com/reader/full/td-win32asm-013asm 11/12

8/10/2019 Td Win32asm 013.Asm

http://slidepdf.com/reader/full/td-win32asm-013asm 12/12

td_win32asm_013.asmpopad ;pop all register from stackmov eax,1h ;set EAX to TRUE (1)mov esp,ebp ;delete stack framepop ebpret 10h ;return and clear stack;##############################################################################

;******************************************************************************; My own subroutine(s) for a compacter code resist here ...;------------------------------------------------------------------------------My_CleanSystem:;------------------------------------------------------------------------------; API "DeleteObject" deletes a logical pen, brush, font, bitmap, region, or; palette, freeing all system resources associated with the object.; After the object is deleted, the specified handle is no longer valid.;------------------------------------------------------------------------------push hImg_static ;hObject, handle objectcall DeleteObject ;- API Function -ret;******************************************************************************

;==============================================================================; end Main = end of our program code;------------------------------------------------------------------------------end Main ;end of our program code, entry point

;==============================================================================; To create the exe file use this commands with your Microsoft Assembler/Linker

;------------------------------------------------------------------------------; ml.exe /c /coff td_win32asm_013.asm ;asm command; rc.exe /v rsrc.rc ;rc command; cvtres.exe /machine:ix86 rsrc.res; link.exe /subsystem:windows td_win32asm_013.obj rsrc.obj ;link command;==============================================================================

Page 12