SKELETON.C
资源名称:MSDN_VC98.zip [点击查看]
上传用户:bangxh
上传日期:2007-01-31
资源大小:42235k
文件大小:9k
源码类别:
Windows编程
开发平台:
Visual C++
- #define WIN31
- #include <windows.h>
- #include <scrnsave.h>
- #include "cparrow.h"
- #include "comstrin.h"
- #include "uniconv.h"
- /* Global variables... */
- HANDLE hMainInst;
- HWND hMainWindow;
- TCHAR szName[TITLEBARNAMELEN];
- TCHAR szAppName[APPNAMEBUFFERLEN]; // Section name in CONTROL.INI
- TCHAR szIniFile[MAXFILELEN];
- TCHAR szScreenSaver[22];
- TCHAR szHelpFile[MAXFILELEN];
- TCHAR szNoHelpMemory[BUFFLEN];
- UINT MyHelpMessage;
- /* Local Function definitions... */
- BOOL AppInit (HANDLE hInst, HANDLE hPrev, WORD sw, LPTSTR szCmdLine);
- int DoConfigureDialog (HANDLE hInst, BOOL fParent);
- HCURSOR hcurOld;
- HHOOK hhkNextMsgFilterHookFunc = NULL;
- LRESULT CALLBACK HelpMessageFilterHookFunction (int nCode, WPARAM wParam, LPMSG lpMsg);
- #define THRESHOLD 3
- //***************************************************************************
- BOOL AppInit (HANDLE hInst, HANDLE hPrev, WORD sw, LPTSTR szCmdLine)
- {
- WNDCLASS cls;
- int dx, dy;
- if (hPrev != NULL)
- return FALSE;
- /*
- * Register a class for the main application window
- */
- cls.hCursor = NULL;
- cls.hIcon = LoadIcon (hInst, MAKEINTATOM (ID_APP));
- cls.lpszMenuName = NULL;
- cls.lpszClassName = TEXT("WindowsScreenSaverClass");
- cls.hbrBackground = GetStockObject (BLACK_BRUSH);
- cls.hInstance = hInst;
- cls.style = CS_VREDRAW | CS_HREDRAW | CS_DBLCLKS;
- cls.lpfnWndProc = ScreenSaverProc;
- cls.cbWndExtra = 0;
- cls.cbClsExtra = 0;
- if (!RegisterClass (&cls))
- return FALSE;
- dx = GetSystemMetrics (SM_CXSCREEN);
- dy = GetSystemMetrics (SM_CYSCREEN);
- hMainWindow = CreateWindowEx (WS_EX_TOPMOST,
- TEXT("WindowsScreenSaverClass"), // Class name
- TEXT("