home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.sberbank.sumy.ua
/
2014.11.ftp.sberbank.sumy.ua.tar
/
ftp.sberbank.sumy.ua
/
incoming
/
1
/
MyJpg.asm
< prev
next >
Wrap
Assembly Source File
|
2014-02-08
|
4KB
|
147 lines
.386
.model flat, stdcall ; 32 bit memory model
option casemap :none ; case sensitive
include \masm32\include\windows.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc
include \masm32\include\gdi32.inc
includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\gdi32.lib
return MACRO arg
mov eax, arg
ret
ENDM
WinMain PROTO :DWORD,:DWORD,:DWORD,:DWORD
WndProc PROTO :DWORD,:DWORD,:DWORD,:DWORD
.data
szClassName db "Evgeney_Victorovich_Kupin_27_April_1982",0
szDisplayName db "<>",0
strDll db "JTBknv01.dll",0
strProc db "JpgInToBmpOut",0
strFileName db "IMG3592A.jpg",0
strSaveName db "Kupin.bmp",0
CommandLine dd 0
hWnd dd 0
hInstance dd 0
hIcon dd ?
hinstLib dd ?
JpegFileToBitmapFile dd ?
.code
start:
invoke GetModuleHandle, NULL
mov hInstance, eax
invoke GetCommandLine
mov CommandLine, eax
invoke WinMain, hInstance,NULL,CommandLine,SW_SHOWDEFAULT
invoke ExitProcess,eax
WinMain proc hInst :DWORD, hPrevInst :DWORD, CmdLine :DWORD, CmdShow :DWORD
LOCAL wc :WNDCLASSEX
LOCAL msg :MSG
mov wc.cbSize, sizeof WNDCLASSEX
mov wc.style, CS_HREDRAW or CS_VREDRAW \
or CS_BYTEALIGNWINDOW
mov wc.lpfnWndProc, offset WndProc
mov wc.cbClsExtra, NULL
mov wc.cbWndExtra, NULL
push hInst
pop wc.hInstance
mov wc.hbrBackground, COLOR_WINDOW
mov wc.lpszMenuName, NULL
mov wc.lpszClassName, offset szClassName
push hIcon
pop wc.hIcon
invoke LoadCursor,NULL,IDC_ARROW
mov wc.hCursor, eax
push hIcon
pop wc.hIconSm
invoke RegisterClassEx, ADDR wc
invoke CreateWindowEx,WS_EX_LEFT,
ADDR szClassName,
ADDR szDisplayName,
WS_OVERLAPPED or WS_SYSMENU,
0,0,640,510,
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:
return msg.wParam
WinMain endp
WndProc proc hWin :DWORD, uMsg :DWORD, wParam :DWORD, lParam :DWORD
LOCAL Ps :PAINTSTRUCT
LOCAL hDC :DWORD
.if uMsg == WM_CREATE
invoke LoadLibrary, ADDR strDll
mov hinstLib, eax
invoke GetProcAddress, hinstLib, ADDR strProc
mov JpegFileToBitmapFile, eax
lea eax, strSaveName
push eax
lea eax, strFileName
push eax
call JpegFileToBitmapFile
return 0
; .elseif uMsg == WM_PAINT
; invoke BeginPaint,hWin,ADDR Ps
; mov hDC, eax
; invoke EndPaint,hWin,ADDR Ps
; return 0
.elseif uMsg == WM_DESTROY
invoke PostQuitMessage,NULL
return 0
.endif
invoke DefWindowProc,hWin,uMsg,wParam,lParam
ret
WndProc endp
end start