;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
; FileName: blackscr.asm
; Function: A black screen saver
; Author: Purple Endurer
;Development: Windows 2000 pro + MASM32 V8
; Note: 本程序是在罗云彬屏幕保护程序模板Ver 1.0的基础上创建
;log
;==================================================================
; 2005.05.27 Created!
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
.386
.model flat, stdcall
option casemap :none ; case sensitive
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
; Include 数据
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
include \masm32\include\windows.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc
include \masm32\include\comctl32.inc
include \masm32\include\comdlg32.inc
include \masm32\include\gdi32.inc
include \masm32\include\advapi32.inc
include \masm32\include\shell32.inc
include \masm32\include\scrnsave.inc
includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\comctl32.lib
includelib \masm32\lib\comdlg32.lib
includelib \masm32\lib\gdi32.lib
includelib \masm32\lib\advapi32.lib
includelib \masm32\lib\shell32.lib
includelib \masm32\lib\scrnsave.lib
includelib \masm32\lib\msvcrt.lib
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
; Equ 数据
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ICO_MAIN equ 100 ;Must be 100
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
; 数据段
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
.data
g_szAbout db "本程序由Purple Endurer采用MASM32开发!", 0ah, 0dh, 0ah, 0dh, "不需要设置参数!", 0
g_szAppName db "黑屏保护程序", 0
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
; 代码段
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
.code
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
; 主程序窗口过程
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ScreenSaverProc proc hWnd: DWORD,uMsg: DWORD,wParam: DWORD,lParam: DWORD
.if uMsg == WM_DESTROY
invoke DestroyWindow, hWnd
invoke PostQuitMessage, NULL
.endif
invoke DefScreenSaverProc,hWnd,uMsg,wParam,lParam
ret
ScreenSaverProc endp
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
; 设置对话框过程
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ScreenSaverConfigureDialog proc hWnd:DWORD,wMsg:DWORD,wParam:DWORD,lParam:DWORD
.if wMsg == WM_INITDIALOG
invoke MessageBox, hWnd, ADDR g_szAbout, ADDR g_szAppName, MB_ICONINFORMATION
invoke EndDialog,hWnd,NULL ;关闭设置对话框
mov eax,FALSE
ret
.endif
mov eax,TRUE
ret
ScreenSaverConfigureDialog endp
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
; 注册设置对话框窗口Class过程
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
RegisterDialogClasses proc hInst:DWORD
mov eax,TRUE
ret
RegisterDialogClasses endp
end WinMain ;必须是WinMain
body{font:9pt/14pt 宋体, MSSong;};#1{color:#0000D0};#2{color:#FF0000};#3{color:#008000};#4{color:#808080};#5{color:#FF00FF};#6{color:#FF0000}
body{font:9pt/14pt 宋体, MS Song;}
body{font:9pt/14pt 宋体, MSSong;};#1{color:#0000D0};#2{color:#FF0000};#3{color:#008000};#4{color:#808080};#5{color:#FF00FF};#6{color:#FF0000}
body{font:9pt/14pt 宋体, MS Song;}
;##########################
;rsrc.rc
;##########################
#include "\masm32\include\resource.h"
#define ICO_MAIN 100 //图标的ID必须是100
#define DLG_SETUP 2003 //设置对话框的ID必须是2003
ICO_MAIN ICON "main.ico"
//设置对话框,大小为0
DLG_SETUP DIALOG DISCARDABLE 0, 0, 0, 0
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
{
}
STRINGTABLE DISCARDABLE
{
100 "保护程序"
}
本文地址:http://com.8s8s.com/it/it21788.htm