; ���������������������������������������������������������������������������
;
; Filename: GUIFadeImage.asm
; Version 1.0
; Date/Author: 10.09.2005, dave (juniorsoft)
; Description: Source File for the GUI of the FadeImage - Test
; application. This small app demonstrates how to
; integrate the FadeImageCtrl into your applications.
;
; You can use, modify and copy this source file to fit your
; needs, it's Freeware/OpenSource.
;
; ���������������������������������������������������������������������������
.486 ; create 32 bit code
.model flat, stdcall ; 32 bit memory model
option casemap :none ; case sensitive
include GUIFadeImage.inc ; local includes for this file
.code
WinMain proc n1:DWORD,n2:DWORD,n3:DWORD,n4:DWORD
jmp start
Ret
WinMain EndP
start:
invoke GetModuleHandle, NULL
mov hInstance,eax
invoke LoadIcon,hInstance, IDI_ICON ; icon ID
mov hIcon, eax
invoke RegisterFadeImage
invoke DialogBoxParam, hInstance, addr sDlgName,NULL,addr DlgProc,NULL
invoke ExitProcess,0
; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;
; Procedure: DlgProc
; Parameter: hWnd, uMsg, wParam, lParam (def. DlgProc parameter)
; Version: 1.0
; Date/Author: 10.09.2005, dave (juniorsoft)
; Description: Dialog Message-Handler. We must implement this function.
;
; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DlgProc proc hWnd2:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM
.IF uMsg==WM_INITDIALOG
mov eax, hWnd2
mov hWndDlg, eax
invoke SendMessage, hWndDlg, WM_SETICON, NULL, hIcon
invoke SetWindowText,hWndDlg, addr sAppTitle
;
invoke FillInfos
;
invoke CreateFadeImage,hWndDlg,IDB_MAINBMP,5,5
;
.ELSEIF uMsg==WM_CLOSE
invoke SendMessage,hWnd2,WM_COMMAND,IDM_EXIT,0
.elseif uMsg==WM_DESTROY
invoke DeleteObject,hBitmap
invoke PostQuitMessage,NULL
.ELSEIF uMsg==WM_COMMAND
mov eax,wParam
.IF lParam==0
.IF ax==IDM_EXIT
invoke EndDialog, hWnd2,NULL
.ENDIF
.ELSE
mov edx,wParam
shr edx,16
.if dx==BN_CLICKED
.IF ax==IDC_EXIT
invoke SendMessage,hWnd2,WM_COMMAND,IDM_EXIT,0
.ELSEIF ax==IDC_FADEOUT
invoke FadeOut
.ELSEIF ax==IDC_FADEIN
invoke FadeIn
.ENDIF
.ENDIF
.ENDIF
.ELSE
mov eax,FALSE
ret
.ENDIF
mov eax,TRUE
ret
DlgProc endp
; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;
; Procedure: FillInfos
; Parameter: (none)
; Version: 1.0
; Date/Author: 10.09.2005, dave (juniorsoft)
; Description: Load infos from config.inc to lables behind FadeImage
;
; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
FillInfos proc
invoke GetDlgItem,hWndDlg,IDC_LBLCOMPANY
invoke SetWindowText,eax, addr sCompany
invoke GetDlgItem,hWndDlg,IDC_LBLPRODUCT
invoke SetWindowText,eax, addr sProduct
invoke GetDlgItem,hWndDlg,IDC_LBLVERSION
invoke SetWindowText,eax, addr sVersion
Ret
FillInfos EndP
end start
; ���������������������������������������������������������������������������