Initial commit
BIN
nkosrc4/.DS_Store
vendored
Executable file
BIN
nkosrc4/Neko98/.DS_Store
vendored
Executable file
411
nkosrc4/Neko98/AlwaysOnTopPet.cpp
Executable file
@@ -0,0 +1,411 @@
|
||||
// AlwaysOnTopPet.cpp: implementation of the CAlwaysOnTopPet class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "AlwaysOnTopPet.h"
|
||||
|
||||
//class name constant
|
||||
static const char* g_szOnTopClassName = "NekoOnTop_Wnd";
|
||||
|
||||
//forward declaration
|
||||
LRESULT CALLBACK WndProc_OnTop( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
|
||||
|
||||
//static member
|
||||
BOOL CAlwaysOnTopPet::m_fRegisteredClass = FALSE;
|
||||
|
||||
//external global variable
|
||||
extern HINSTANCE g_hInstance;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CAlwaysOnTopPet::CAlwaysOnTopPet() : CPet()
|
||||
{
|
||||
//clear regions
|
||||
m_hRgns = NULL;
|
||||
|
||||
//initialise members
|
||||
m_fBeingDragged = FALSE;
|
||||
m_hWndOnTop = NULL;
|
||||
|
||||
//register class
|
||||
if( m_fRegisteredClass == FALSE )
|
||||
{
|
||||
WNDCLASS wc;
|
||||
|
||||
wc.style = CS_OWNDC|CS_DBLCLKS|CS_SAVEBITS;
|
||||
wc.lpfnWndProc = (WNDPROC)WndProc_OnTop;
|
||||
wc.cbClsExtra = 0;
|
||||
wc.cbWndExtra = sizeof(LPVOID);
|
||||
wc.hInstance = g_hInstance;
|
||||
wc.hIcon = NULL;
|
||||
wc.hCursor = LoadCursor( NULL, MAKEINTRESOURCE(IDC_ARROW) );
|
||||
wc.hbrBackground = NULL;
|
||||
wc.lpszMenuName = NULL;
|
||||
wc.lpszClassName = g_szOnTopClassName;
|
||||
|
||||
m_fRegisteredClass = RegisterClass(&wc);
|
||||
}
|
||||
|
||||
//set bounding rectangle
|
||||
SetRect( &m_rcBounds, 0, 0, GetSystemMetrics(SM_CXSCREEN)-1, GetSystemMetrics(SM_CYSCREEN)-1 );
|
||||
|
||||
//move this pet off-screen to start with
|
||||
m_ptPosition.x = m_rcBounds.right;
|
||||
m_ptPosition.y = m_rcBounds.bottom;
|
||||
}
|
||||
|
||||
CAlwaysOnTopPet::~CAlwaysOnTopPet()
|
||||
{
|
||||
DestroyWindow( m_hWndOnTop );
|
||||
}
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Member Functions
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
void CAlwaysOnTopPet::Draw( int nImage )
|
||||
{
|
||||
//only draw if it's different && not being dragged
|
||||
if( nImage != m_nLastIcon && m_fBeingDragged == FALSE )
|
||||
{
|
||||
//clip the window to the shape of the icon
|
||||
HRGN hRgnCopy = CreateRectRgn( 0, 0, m_sizeImage.cx, m_sizeImage.cy );
|
||||
CombineRgn( hRgnCopy, m_hRgns[nImage], NULL, RGN_COPY );
|
||||
SetWindowRgn( m_hWndOnTop, hRgnCopy, TRUE );
|
||||
|
||||
//draw the current frame on the window
|
||||
HDC hDC = GetDC( m_hWndOnTop );
|
||||
DrawIconEx( hDC, 0, 0, m_hIcons[nImage], m_sizeImage.cx, m_sizeImage.cy, 0, NULL, DI_NORMAL );
|
||||
ReleaseDC( m_hWndOnTop, hDC );
|
||||
}
|
||||
}
|
||||
|
||||
void CAlwaysOnTopPet::Erase()
|
||||
{
|
||||
//do nothing
|
||||
}
|
||||
|
||||
void CAlwaysOnTopPet::SetImages(HICON * hIconTable, int nIcons )
|
||||
{
|
||||
//remove current region handles
|
||||
DestroyRegions();
|
||||
|
||||
//call base class
|
||||
CPet::SetImages( hIconTable, nIcons );
|
||||
|
||||
//prepare region handles
|
||||
BuildRegions();
|
||||
|
||||
//create the window if it doesn't exist already
|
||||
if( m_hWndOnTop == NULL )
|
||||
{
|
||||
m_hWndOnTop = CreateWindowEx( WS_EX_TOPMOST|WS_EX_TOOLWINDOW, g_szOnTopClassName, NULL, WS_POPUP, m_ptPosition.x, m_ptPosition.y, m_sizeImage.cx, m_sizeImage.cy, NULL, NULL, g_hInstance, NULL );
|
||||
|
||||
if( m_hWndOnTop )
|
||||
{
|
||||
SetWindowLong( m_hWndOnTop, 0, (LONG)this );
|
||||
ShowWindow( m_hWndOnTop, SW_SHOWNA );
|
||||
UpdateWindow( m_hWndOnTop );
|
||||
}
|
||||
}
|
||||
|
||||
//FIXME: don't change it in the whole class, just this window!!!
|
||||
//change it's default icon
|
||||
//SetClassLong( m_hWndOnTop, GCL_HICON, m_hIcons[0] );
|
||||
}
|
||||
|
||||
void CAlwaysOnTopPet::DestroyImages()
|
||||
{
|
||||
//call base class
|
||||
CPet::DestroyImages();
|
||||
|
||||
//delete regions
|
||||
DestroyRegions();
|
||||
}
|
||||
|
||||
void CAlwaysOnTopPet::DrawOnTarget( int x, int y, HICON hIcon )
|
||||
{
|
||||
//grab the device context of the display
|
||||
HDC hDC = GetDC( NULL );
|
||||
|
||||
//draw the icon on it
|
||||
DrawIconEx( hDC, x, y, hIcon, 0, 0, 0, NULL, DI_NORMAL );
|
||||
|
||||
//release the device context
|
||||
ReleaseDC( NULL, hDC );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// On Top Window Procedure
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
LRESULT CALLBACK WndProc_OnTop( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
switch( uMsg )
|
||||
{
|
||||
case WM_PAINT:
|
||||
{
|
||||
//draw the most recent icon if the window is being dragged
|
||||
CAlwaysOnTopPet* pPet = (CAlwaysOnTopPet*)GetWindowLong( hWnd, 0 );
|
||||
if( pPet->m_fBeingDragged )
|
||||
{
|
||||
//draw the current icon onto the window (we can't call draw because it checks for icon index and changes the window's region
|
||||
HDC hDC = GetDC( hWnd );
|
||||
DrawIconEx( hDC, 0, 0, pPet->m_hIcons[pPet->m_nLastIcon], pPet->GetSize().cx, pPet->GetSize().cy, 0, NULL, DI_NORMAL );
|
||||
ReleaseDC( hWnd, hDC );
|
||||
}
|
||||
ValidateRect( hWnd, NULL );
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_SYSCOMMAND:
|
||||
//if the user alt+F4s us or (somehow) minimises or maximises us, ignore it
|
||||
if( LOWORD(wParam) != SC_CLOSE && LOWORD(wParam) != SC_MINIMIZE && LOWORD(wParam) != SC_MAXIMIZE )
|
||||
return DefWindowProc( hWnd, uMsg, wParam, lParam );
|
||||
break;
|
||||
|
||||
case WM_ERASEBKGND:
|
||||
return TRUE; //don't erase the background
|
||||
|
||||
//pass mouse messages onto the class
|
||||
case WM_LBUTTONDOWN: ((CAlwaysOnTopPet*)GetWindowLong( hWnd, 0 ))->OnLButtonDown(); break;
|
||||
case WM_LBUTTONUP: ((CAlwaysOnTopPet*)GetWindowLong( hWnd, 0 ))->OnLButtonUp(); break;
|
||||
case WM_LBUTTONDBLCLK: ((CAlwaysOnTopPet*)GetWindowLong( hWnd, 0 ))->OnLButtonDblClk(); break;
|
||||
|
||||
case WM_MBUTTONDOWN: ((CAlwaysOnTopPet*)GetWindowLong( hWnd, 0 ))->OnMButtonDown(); break;
|
||||
case WM_MBUTTONUP: ((CAlwaysOnTopPet*)GetWindowLong( hWnd, 0 ))->OnMButtonUp(); break;
|
||||
case WM_MBUTTONDBLCLK: ((CAlwaysOnTopPet*)GetWindowLong( hWnd, 0 ))->OnMButtonDblClk(); break;
|
||||
|
||||
case WM_RBUTTONDOWN: ((CAlwaysOnTopPet*)GetWindowLong( hWnd, 0 ))->OnRButtonDown(); break;
|
||||
case WM_RBUTTONUP: ((CAlwaysOnTopPet*)GetWindowLong( hWnd, 0 ))->OnRButtonUp(); break;
|
||||
case WM_RBUTTONDBLCLK: ((CAlwaysOnTopPet*)GetWindowLong( hWnd, 0 ))->OnRButtonDblClk(); break;
|
||||
|
||||
//window is being dragged
|
||||
case WM_ENTERSIZEMOVE:
|
||||
{
|
||||
CAlwaysOnTopPet* pPet = (CAlwaysOnTopPet*)GetWindowLong( hWnd, 0 );
|
||||
pPet->m_fBeingDragged = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
//window is being dropped
|
||||
case WM_EXITSIZEMOVE:
|
||||
{
|
||||
CAlwaysOnTopPet* pPet = (CAlwaysOnTopPet*)GetWindowLong( hWnd, 0 );
|
||||
pPet->m_fBeingDragged = FALSE;
|
||||
RECT rc;
|
||||
GetWindowRect( hWnd, &rc );
|
||||
pPet->MoveTo( rc.left, rc.top );
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
return DefWindowProc( hWnd, uMsg, wParam, lParam );
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CAlwaysOnTopPet::OnLButtonDown()
|
||||
{
|
||||
//default left button handler - begin window dragging
|
||||
SendMessage( m_hWndOnTop, WM_SYSCOMMAND, SC_MOVE+2, 0 );
|
||||
}
|
||||
|
||||
void CAlwaysOnTopPet::DestroyRegions()
|
||||
{
|
||||
if( m_hRgns )
|
||||
{
|
||||
//delete all regions and free the array
|
||||
for( int i = 0; i < m_nIcons; i++ ) if( m_hRgns[i] ) DeleteObject( m_hRgns[i] );
|
||||
delete[] m_hRgns;
|
||||
m_hRgns = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void CAlwaysOnTopPet::MoveTo(int nNewX, int nNewY)
|
||||
{
|
||||
if( m_fBeingDragged == FALSE )
|
||||
{
|
||||
//store current position
|
||||
m_ptOldPosition.x = m_ptPosition.x;
|
||||
m_ptOldPosition.y = m_ptPosition.y;
|
||||
|
||||
//change current position
|
||||
m_ptPosition.x = nNewX;
|
||||
m_ptPosition.y = nNewY;
|
||||
|
||||
//move the window if it's not being moved by something else
|
||||
MoveWindow( m_hWndOnTop, nNewX, nNewY, m_sizeImage.cx, m_sizeImage.cy, TRUE );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CAlwaysOnTopPet::SetImageAndMoveTo(int nImage, int nNewX, int nNewY)
|
||||
{
|
||||
if( m_fBeingDragged == FALSE )
|
||||
{
|
||||
//move
|
||||
MoveTo( nNewX, nNewY );
|
||||
|
||||
//change image
|
||||
Draw( nImage );
|
||||
m_nLastIcon = nImage;
|
||||
}
|
||||
}
|
||||
|
||||
void CAlwaysOnTopPet::SetImage( int nImage )
|
||||
{
|
||||
if( m_fBeingDragged == FALSE ) CPet::SetImage( nImage );
|
||||
}
|
||||
|
||||
|
||||
|
||||
//This function was based on the BitmapToRegion function found in www.codeguru.com's "bitmaps and palettes" section
|
||||
// Author : Jean-Edouard Lachand-Robert (http://www.geocities.com/Paris/LeftBank/1160/resume.htm), June 1998.
|
||||
void CAlwaysOnTopPet::BuildRegions()
|
||||
{
|
||||
//create a memory DC inside which we will scan the bitmap content
|
||||
HDC hMemDC = CreateCompatibleDC(NULL);
|
||||
|
||||
//create a 32 bits depth bitmap and select it into the memory DC
|
||||
BITMAPINFOHEADER bi = { sizeof(BITMAPINFOHEADER), int(m_sizeImage.cx/m_fScale), int(m_sizeImage.cy/m_fScale), 1, 16, BI_RGB, 0, 0, 0, 0, 0 };
|
||||
VOID* pBitsDib;
|
||||
HBITMAP hBmDib = CreateDIBSection( hMemDC, (BITMAPINFO*)&bi, DIB_RGB_COLORS, &pBitsDib, NULL, 0 );
|
||||
HBITMAP hOldMemBmp = (HBITMAP)SelectObject( hMemDC, hBmDib );
|
||||
|
||||
//create a DC just to copy the bitmap into the memory DC
|
||||
HDC hDC = CreateCompatibleDC( hMemDC );
|
||||
|
||||
//get how many bytes per row we have for the bitmap bits (rounded up to 32 bits)
|
||||
BITMAP bmDib;
|
||||
GetObject( hBmDib, sizeof(bmDib), &bmDib );
|
||||
while( bmDib.bmWidthBytes % 4 ) bmDib.bmWidthBytes++;
|
||||
|
||||
//calculate scaling matrix
|
||||
XFORM xForm = { m_fScale, 0.0, 0.0, m_fScale, 0.0, 0.0 };
|
||||
|
||||
//allocate the region array
|
||||
m_hRgns = new HRGN[m_nIcons];
|
||||
|
||||
//build all regions
|
||||
for( int i = 0; i < m_nIcons; i++ )
|
||||
{
|
||||
HRGN hRgn = NULL;
|
||||
|
||||
//extract icon mask image
|
||||
ICONINFO ii;
|
||||
GetIconInfo( m_hIcons[i], &ii );
|
||||
DeleteObject( ii.hbmColor );
|
||||
|
||||
//get bitmap size
|
||||
BITMAP bm;
|
||||
GetObject( ii.hbmMask, sizeof(bm), &bm );
|
||||
|
||||
//copy the bitmap into the memory DC
|
||||
HBITMAP hOldBmp = (HBITMAP)SelectObject( hDC, ii.hbmMask );
|
||||
BitBlt( hMemDC, 0, 0, bm.bmWidth, bm.bmHeight, hDC, 0, 0, SRCCOPY );
|
||||
|
||||
//For better performances, we will use the ExtCreateRegion() function to create the
|
||||
//region. This function take a RGNDATA structure on entry. We will add rectangles by
|
||||
//amount of ALLOC_UNIT number in this structure.
|
||||
#define ALLOC_UNIT 100
|
||||
DWORD dwMaxRects = ALLOC_UNIT;
|
||||
HANDLE hData = GlobalAlloc( GMEM_MOVEABLE, sizeof(RGNDATAHEADER) + (sizeof(RECT) * dwMaxRects) );
|
||||
RGNDATA* pData = (RGNDATA *)GlobalLock( hData );
|
||||
pData->rdh.dwSize = sizeof(RGNDATAHEADER);
|
||||
pData->rdh.iType = RDH_RECTANGLES;
|
||||
pData->rdh.nCount = pData->rdh.nRgnSize = 0;
|
||||
SetRect( &pData->rdh.rcBound, MAXLONG, MAXLONG, 0, 0 );
|
||||
|
||||
//scan each bitmap row from bottom to top (the bitmap is inverted vertically)
|
||||
BYTE* pDib = (BYTE*)bmDib.bmBits + (bmDib.bmHeight - 1) * bmDib.bmWidthBytes;
|
||||
for( int y = 0; y < bm.bmHeight; y++ )
|
||||
{
|
||||
//scan each bitmap pixel from left to right
|
||||
for( int x = 0; x < bm.bmWidth; x++ )
|
||||
{
|
||||
//search for a continuous range of "non transparent pixels"
|
||||
int x0 = x;
|
||||
WORD* p = (WORD*)pDib + x;
|
||||
while( x < bm.bmWidth)
|
||||
{
|
||||
if( *p != 0 )
|
||||
//This pixel is "transparent"
|
||||
break;
|
||||
|
||||
p++;
|
||||
x++;
|
||||
}
|
||||
|
||||
if( x > x0 )
|
||||
{
|
||||
//Add the pixels (x0, y) to (x, y+1) as a new rectangle in the region
|
||||
if( pData->rdh.nCount >= dwMaxRects )
|
||||
{
|
||||
GlobalUnlock(hData);
|
||||
dwMaxRects += ALLOC_UNIT;
|
||||
hData = GlobalReAlloc( hData, sizeof(RGNDATAHEADER) + (sizeof(RECT) * dwMaxRects), GMEM_MOVEABLE );
|
||||
pData = (RGNDATA*)GlobalLock(hData);
|
||||
}
|
||||
RECT* pr = (RECT*)&pData->Buffer;
|
||||
SetRect(&pr[pData->rdh.nCount], x0, y, x, y+1);
|
||||
if (x0 < pData->rdh.rcBound.left) pData->rdh.rcBound.left = x0;
|
||||
if (y < pData->rdh.rcBound.top) pData->rdh.rcBound.top = y;
|
||||
if (x > pData->rdh.rcBound.right) pData->rdh.rcBound.right = x;
|
||||
if (y+1 > pData->rdh.rcBound.bottom) pData->rdh.rcBound.bottom = y+1;
|
||||
pData->rdh.nCount++;
|
||||
|
||||
//On Windows98, ExtCreateRegion() may fail if the number of rectangles is too
|
||||
//large (ie: > 4000). Therefore, we have to create the region by multiple steps.
|
||||
if( pData->rdh.nCount == 2000 )
|
||||
{
|
||||
HRGN h = ExtCreateRegion( &xForm, sizeof(RGNDATAHEADER) + (sizeof(RECT) * dwMaxRects), pData);
|
||||
if( hRgn )
|
||||
{
|
||||
CombineRgn( hRgn, hRgn, h, RGN_OR );
|
||||
DeleteObject(h);
|
||||
}
|
||||
else
|
||||
hRgn = h;
|
||||
|
||||
pData->rdh.nCount = 0;
|
||||
SetRect( &pData->rdh.rcBound, MAXLONG, MAXLONG, 0, 0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//go to next row (remember, the bitmap is inverted vertically)
|
||||
pDib -= bmDib.bmWidthBytes;
|
||||
}
|
||||
|
||||
//create or extend the region with the remaining rectangles
|
||||
HRGN h = ExtCreateRegion( &xForm, sizeof(RGNDATAHEADER) + (sizeof(RECT) * dwMaxRects), pData );
|
||||
if( hRgn )
|
||||
{
|
||||
CombineRgn( hRgn, hRgn, h, RGN_OR );
|
||||
DeleteObject(h);
|
||||
}
|
||||
else
|
||||
hRgn = h;
|
||||
|
||||
//clean up
|
||||
DeleteObject( SelectObject( hDC, hOldBmp ) );
|
||||
GlobalFree(hData);
|
||||
|
||||
//store the region
|
||||
m_hRgns[i] = hRgn;
|
||||
}
|
||||
|
||||
//clean up
|
||||
DeleteDC(hDC);
|
||||
DeleteObject( SelectObject( hMemDC, hOldMemBmp ) );
|
||||
DeleteDC( hMemDC );
|
||||
}
|
||||
63
nkosrc4/Neko98/AlwaysOnTopPet.h
Executable file
@@ -0,0 +1,63 @@
|
||||
// AlwaysOnTopPet.h: interface for the CAlwaysOnTopPet class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_ALWAYSONTOPPET_H__A69EBAA4_385D_11D2_9FF9_00001C192944__INCLUDED_)
|
||||
#define AFX_ALWAYSONTOPPET_H__A69EBAA4_385D_11D2_9FF9_00001C192944__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#include "Pet.h"
|
||||
|
||||
class CAlwaysOnTopPet : virtual public CPet
|
||||
{
|
||||
public:
|
||||
virtual void MoveTo( int nNewX, int nNewY );
|
||||
virtual void SetImage( int nImage );
|
||||
virtual void SetImageAndMoveTo( int nImage, int nNewX, int nNewY );
|
||||
virtual void SetImages( HICON* hIconTable, int nIcons );
|
||||
CAlwaysOnTopPet();
|
||||
virtual ~CAlwaysOnTopPet();
|
||||
|
||||
virtual void DrawOnTarget( int x, int y, HICON hIcon );
|
||||
|
||||
//virtual callback functions - these can all be overridden to perform different actions
|
||||
//depending on the various mouse clicks. Note: CAlwaysOnTopPet::OnLButtonDown() handles
|
||||
//the dragging - if this is overridden, OnLButtonUp is not called.
|
||||
|
||||
virtual void OnLButtonDown(); //implementation is in .cpp file
|
||||
virtual void OnLButtonUp() {};
|
||||
virtual void OnLButtonDblClk() {};
|
||||
virtual void OnMButtonDown() {};
|
||||
virtual void OnMButtonUp() {};
|
||||
virtual void OnMButtonDblClk() {};
|
||||
virtual void OnRButtonDown() {};
|
||||
virtual void OnRButtonUp() {};
|
||||
virtual void OnRButtonDblClk() {};
|
||||
|
||||
//class information functions
|
||||
inline BOOL IsDragging() { return m_fBeingDragged; };
|
||||
|
||||
protected:
|
||||
HWND m_hWndOnTop;
|
||||
BOOL m_fBeingDragged;
|
||||
HRGN IconMaskToRegion( HICON hIcon );
|
||||
virtual void DestroyImages();
|
||||
HRGN* m_hRgns;
|
||||
virtual void Erase();
|
||||
virtual void Draw( int nImage );
|
||||
|
||||
private:
|
||||
void BuildRegions();
|
||||
void DestroyRegions();
|
||||
static BOOL m_fRegisteredClass;
|
||||
|
||||
friend
|
||||
LRESULT CALLBACK WndProc_OnTop( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_ALWAYSONTOPPET_H__A69EBAA4_385D_11D2_9FF9_00001C192944__INCLUDED_)
|
||||
131
nkosrc4/Neko98/DesktopHack.cpp
Executable file
@@ -0,0 +1,131 @@
|
||||
// DesktopHack.cpp: implementation of the CDesktopHack class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include "DesktopHack.h"
|
||||
|
||||
//constants used by callback function
|
||||
#define ENUM_ALLWINDOWS 1
|
||||
#define ENUM_SHELLDEFVIEW 2
|
||||
#define ENUM_GETDESKTOP 3
|
||||
|
||||
//variables used by callback function
|
||||
HWND g_hWndDesktop = NULL;
|
||||
HWND g_hWndShellDefView = NULL;
|
||||
BOOL g_fActiveDesktop = FALSE;
|
||||
|
||||
//callback function prototype
|
||||
BOOL CALLBACK DesktopHunter( HWND hWnd, LPARAM lParam );
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CDesktopHack::CDesktopHack()
|
||||
{
|
||||
//find the desktop
|
||||
FindDesktopHandle();
|
||||
}
|
||||
|
||||
CDesktopHack::~CDesktopHack()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Member Functions
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
void CDesktopHack::FindDesktopHandle()
|
||||
{
|
||||
//reset everything
|
||||
g_hWndDesktop = NULL;
|
||||
g_hWndShellDefView = NULL;
|
||||
g_fActiveDesktop = FALSE;
|
||||
m_fNoChicagoDesktop = FALSE;
|
||||
|
||||
//enumerate all of the windows
|
||||
EnumWindows( (WNDENUMPROC)DesktopHunter, ENUM_ALLWINDOWS );
|
||||
|
||||
//if no desktop was found, we're running on a non-chicago style shell (win32s/NT3)
|
||||
if( g_hWndDesktop == NULL )
|
||||
{
|
||||
m_fNoChicagoDesktop = TRUE;
|
||||
g_hWndDesktop = GetDesktopWindow();
|
||||
}
|
||||
|
||||
//store the handle and whether it's an active desktop or not
|
||||
m_hWndDesktop = g_hWndDesktop;
|
||||
m_fActiveDesktop = g_fActiveDesktop;
|
||||
}
|
||||
|
||||
void CDesktopHack::GetDesktopRect( RECT& rcDesktop )
|
||||
{
|
||||
//retrieve the screen rect of the desktop
|
||||
SystemParametersInfo( SPI_GETWORKAREA, 0, &rcDesktop, FALSE );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Callback Function
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
BOOL CALLBACK DesktopHunter( HWND hWnd, LPARAM lParam )
|
||||
{
|
||||
char szBuffer[26];
|
||||
|
||||
switch( lParam )
|
||||
{
|
||||
case ENUM_ALLWINDOWS:
|
||||
//try and find program manager window
|
||||
GetClassName( hWnd, szBuffer, 25 );
|
||||
if( stricmp( szBuffer, "Progman" ) == 0 )
|
||||
{
|
||||
EnumChildWindows( hWnd, (WNDENUMPROC)DesktopHunter, ENUM_SHELLDEFVIEW );
|
||||
return ( g_hWndDesktop == NULL ); //keep looking if it's not found
|
||||
}
|
||||
break;
|
||||
|
||||
case ENUM_SHELLDEFVIEW:
|
||||
GetClassName( hWnd, szBuffer, 25 );
|
||||
if( stricmp( szBuffer, "SHELLDLL_DefView" ) == 0 )
|
||||
{
|
||||
g_hWndShellDefView = hWnd;
|
||||
EnumChildWindows( hWnd, (WNDENUMPROC)DesktopHunter, ENUM_GETDESKTOP );
|
||||
return FALSE;
|
||||
}
|
||||
break;
|
||||
|
||||
case ENUM_GETDESKTOP:
|
||||
//only look at child windows of the shell default view
|
||||
if( GetParent( hWnd ) != g_hWndShellDefView ) break;
|
||||
|
||||
GetClassName( hWnd, szBuffer, 25 );
|
||||
|
||||
//check for normal desktop
|
||||
if( stricmp( szBuffer, "SysListView32" ) == 0 )
|
||||
{
|
||||
//store handle but continue looking
|
||||
g_hWndDesktop = hWnd;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//check for IE4
|
||||
if( stricmp( szBuffer, "Internet Explorer_Server" ) == 0 )
|
||||
{
|
||||
g_hWndDesktop = hWnd;
|
||||
g_fActiveDesktop = TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
31
nkosrc4/Neko98/DesktopHack.h
Executable file
@@ -0,0 +1,31 @@
|
||||
// DesktopHack.h: interface for the CDesktopHack class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_DESKTOPHACK_H__A69EBAA1_385D_11D2_9FF9_00001C192944__INCLUDED_)
|
||||
#define AFX_DESKTOPHACK_H__A69EBAA1_385D_11D2_9FF9_00001C192944__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
||||
class CDesktopHack
|
||||
{
|
||||
public:
|
||||
void GetDesktopRect( RECT& rcDesktop );
|
||||
void FindDesktopHandle();
|
||||
CDesktopHack();
|
||||
virtual ~CDesktopHack();
|
||||
|
||||
protected:
|
||||
HWND m_hWndDesktop;
|
||||
|
||||
BOOL m_fActiveDesktop; //the desktop is an active (web) desktop
|
||||
BOOL m_fNoChicagoDesktop; //the desktop is not a windows 95/nt4 desktop
|
||||
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_DESKTOPHACK_H__A69EBAA1_385D_11D2_9FF9_00001C192944__INCLUDED_)
|
||||
75
nkosrc4/Neko98/DesktopPet.cpp
Executable file
@@ -0,0 +1,75 @@
|
||||
// DesktopPet.cpp: implementation of the CDesktopPet class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "DesktopPet.h"
|
||||
|
||||
//constants
|
||||
#define UPDATE_COUNTER_MAX 50 //number of redraws until desktop handle is recalculated
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CDesktopPet::CDesktopPet() : CDesktopHack(), CPet()
|
||||
{
|
||||
//clear the update counter
|
||||
m_nUpdateHWndCounter = 0;
|
||||
|
||||
//set bounds
|
||||
GetDesktopRect( m_rcBounds );
|
||||
}
|
||||
|
||||
CDesktopPet::~CDesktopPet()
|
||||
{
|
||||
RedrawWindow( m_hWndDesktop, NULL, NULL, RDW_INVALIDATE|RDW_ERASE );
|
||||
}
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Member Functions
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
void CDesktopPet::Draw( int nImage )
|
||||
{
|
||||
//grab the device context of the desktop
|
||||
HDC hDC = GetDC( m_hWndDesktop );
|
||||
|
||||
//draw the icon on it
|
||||
DrawIconEx( hDC, m_ptPosition.x, m_ptPosition.y, m_hIcons[nImage], m_sizeImage.cx, m_sizeImage.cy, 0, NULL, DI_NORMAL );
|
||||
|
||||
//release the device context
|
||||
ReleaseDC( m_hWndDesktop, hDC );
|
||||
|
||||
//increment the update counter and update if required
|
||||
if( ++m_nUpdateHWndCounter > UPDATE_COUNTER_MAX )
|
||||
{
|
||||
FindDesktopHandle();
|
||||
GetDesktopRect( m_rcBounds );
|
||||
}
|
||||
}
|
||||
|
||||
void CDesktopPet::Erase()
|
||||
{
|
||||
//set up rect to be erased
|
||||
RECT rcErase = { m_ptOldPosition.x, m_ptOldPosition.y,
|
||||
m_ptOldPosition.x + m_sizeImage.cx, m_ptOldPosition.y + m_sizeImage.cy };
|
||||
|
||||
//invalidate it and tell it to update
|
||||
InvalidateRect( m_hWndDesktop, &rcErase, TRUE );
|
||||
UpdateWindow( m_hWndDesktop );
|
||||
}
|
||||
|
||||
void CDesktopPet::DrawOnTarget( int x, int y, HICON hIcon )
|
||||
{
|
||||
//grab the device context of the desktop
|
||||
HDC hDC = GetDC( m_hWndDesktop );
|
||||
|
||||
//draw the icon on it
|
||||
DrawIconEx( hDC, x, y, hIcon, 0, 0, 0, NULL, DI_NORMAL );
|
||||
|
||||
//release the device context
|
||||
ReleaseDC( m_hWndDesktop, hDC );
|
||||
}
|
||||
|
||||
29
nkosrc4/Neko98/DesktopPet.h
Executable file
@@ -0,0 +1,29 @@
|
||||
// DesktopPet.h: interface for the CDesktopPet class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_DESKTOPPET_H__A69EBAA3_385D_11D2_9FF9_00001C192944__INCLUDED_)
|
||||
#define AFX_DESKTOPPET_H__A69EBAA3_385D_11D2_9FF9_00001C192944__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#include "Pet.h"
|
||||
#include "DesktopHack.h"
|
||||
|
||||
class CDesktopPet : public CDesktopHack, virtual public CPet
|
||||
{
|
||||
public:
|
||||
CDesktopPet();
|
||||
virtual ~CDesktopPet();
|
||||
|
||||
virtual void DrawOnTarget( int x, int y, HICON hIcon );
|
||||
|
||||
protected:
|
||||
int m_nUpdateHWndCounter;
|
||||
virtual void Erase();
|
||||
virtual void Draw( int nImage );
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_DESKTOPPET_H__A69EBAA3_385D_11D2_9FF9_00001C192944__INCLUDED_)
|
||||
651
nkosrc4/Neko98/Neko.cpp
Executable file
@@ -0,0 +1,651 @@
|
||||
// Neko.cpp: implementation of the CNeko class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <windows.h>
|
||||
#include "NekoCommon.h"
|
||||
#include "NekoSettings.h"
|
||||
#include "Neko.h"
|
||||
#include "resource.h"
|
||||
#include <math.h>
|
||||
|
||||
//maths calculations
|
||||
#define g_dSinPiPer8 0.3826834323651 // sin [pi/8]
|
||||
#define g_dSinPiPer8Times3 0.9238795325113 // sin ( [pi/8] x 3 )
|
||||
|
||||
//misc. constants
|
||||
#define MAX_TICK 9999 //Odd Only
|
||||
|
||||
//animation control constants
|
||||
#define STOP_TIME 4
|
||||
#define WASH_TIME 10
|
||||
#define SCRATCH_TIME 4
|
||||
#define YAWN_TIME 3
|
||||
#define AWAKE_TIME 3
|
||||
#define CLAW_TIME 10
|
||||
|
||||
//external system variable
|
||||
extern HINSTANCE g_hInstance;
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CNeko::CNeko( char* lpszName )
|
||||
{
|
||||
//store pet
|
||||
m_pPet = NULL;
|
||||
|
||||
//plug icons into animation table
|
||||
m_nAnimation[STOP][0] = 28; m_nAnimation[STOP][1] = 28;
|
||||
m_nAnimation[WASH][0] = 25; m_nAnimation[WASH][1] = 28;
|
||||
m_nAnimation[SCRATCH][0] = 26; m_nAnimation[SCRATCH][1] = 27;
|
||||
m_nAnimation[YAWN][0] = 29; m_nAnimation[YAWN][1] = 29;
|
||||
m_nAnimation[SLEEP][0] = 30; m_nAnimation[SLEEP][1] = 31;
|
||||
m_nAnimation[AWAKE][0] = 0; m_nAnimation[AWAKE][1] = 0;
|
||||
m_nAnimation[U_MOVE][0] = 1; m_nAnimation[U_MOVE][1] = 2;
|
||||
m_nAnimation[D_MOVE][0] = 9; m_nAnimation[D_MOVE][1] = 10;
|
||||
m_nAnimation[L_MOVE][0] = 13; m_nAnimation[L_MOVE][1] = 14;
|
||||
m_nAnimation[R_MOVE][0] = 5; m_nAnimation[R_MOVE][1] = 6;
|
||||
m_nAnimation[UL_MOVE][0] = 15; m_nAnimation[UL_MOVE][1] = 16;
|
||||
m_nAnimation[UR_MOVE][0] = 3; m_nAnimation[UR_MOVE][1] = 4;
|
||||
m_nAnimation[DL_MOVE][0] = 11; m_nAnimation[DL_MOVE][1] = 12;
|
||||
m_nAnimation[DR_MOVE][0] = 7; m_nAnimation[DR_MOVE][1] = 8;
|
||||
m_nAnimation[U_CLAW][0] = 17; m_nAnimation[U_CLAW][1] = 18;
|
||||
m_nAnimation[D_CLAW][0] = 23; m_nAnimation[D_CLAW][1] = 24;
|
||||
m_nAnimation[L_CLAW][0] = 21; m_nAnimation[L_CLAW][1] = 22;
|
||||
m_nAnimation[R_CLAW][0] = 19; m_nAnimation[R_CLAW][1] = 20;
|
||||
|
||||
//set variables
|
||||
m_nDX = m_nDY = 0;
|
||||
strcpy( m_szName, lpszName );
|
||||
m_dwSpeed = 16;
|
||||
m_dwIdleSpace = 6;
|
||||
m_Action = CHASE_MOUSE;
|
||||
m_nActionCount = 0;
|
||||
*m_szFootprintLibname = '\0';
|
||||
*m_szLibname = '\0';
|
||||
m_bFootprints = FALSE;
|
||||
|
||||
strcpy( m_szSndIdle1, "" );
|
||||
strcpy( m_szSndIdle2, "" );
|
||||
strcpy( m_szSndIdle3, "" );
|
||||
strcpy( m_szSndSleep, "" );
|
||||
strcpy( m_szSndAwake, "" );
|
||||
m_dwSndFrequency = 0;
|
||||
m_dwScale = 100;
|
||||
|
||||
//build configuration registry key
|
||||
char szKey[1024];
|
||||
strcpy( szKey, szNekoRegKey );
|
||||
if( strlen( m_szName ) > 0 )
|
||||
{
|
||||
strcat( szKey, "\\" );
|
||||
strcat( szKey, m_szName );
|
||||
}
|
||||
|
||||
//load configuration
|
||||
CNekoSettings NekoSettings( szKey, (strlen(m_szName) == 0) );
|
||||
if( NekoSettings.IsOpen() )
|
||||
{
|
||||
//load in all of the settings
|
||||
NekoSettings.GetInt( szNekoScaleKey, &m_dwScale );
|
||||
NekoSettings.GetInt( szNekoSpeedKey, &m_dwSpeed );
|
||||
NekoSettings.GetInt( szNekoSenseKey, &m_dwIdleSpace );
|
||||
NekoSettings.GetString( szNekoLibraryKey, m_szLibname, MAX_PATH-1 );
|
||||
NekoSettings.GetString( szNekoSndIdle1Key, m_szSndIdle1, MAX_PATH-1 );
|
||||
NekoSettings.GetString( szNekoSndIdle2Key, m_szSndIdle2, MAX_PATH-1 );
|
||||
NekoSettings.GetString( szNekoSndIdle3Key, m_szSndIdle3, MAX_PATH-1 );
|
||||
NekoSettings.GetString( szNekoSndSleepKey, m_szSndSleep, MAX_PATH-1 );
|
||||
NekoSettings.GetString( szNekoSndAwakeKey, m_szSndAwake, MAX_PATH-1 );
|
||||
NekoSettings.GetInt( szNekoSndFreqKey, &m_dwSndFrequency );
|
||||
NekoSettings.GetBool( szNekoFootprintKey, &m_bFootprints );
|
||||
NekoSettings.GetString( szNekoFootprintLibKey, m_szFootprintLibname, MAX_PATH-1 );
|
||||
|
||||
DWORD dwAction = m_Action;
|
||||
NekoSettings.GetInt( szNekoActionKey, &dwAction );
|
||||
m_Action = dwAction;
|
||||
|
||||
|
||||
DWORD bAlwaysOnTop = FALSE;
|
||||
NekoSettings.GetInt( szNekoOnTopKey, &bAlwaysOnTop );
|
||||
|
||||
//create the correct pet
|
||||
if( bAlwaysOnTop )
|
||||
m_pPet = new CAlwaysOnTopPet();
|
||||
else
|
||||
m_pPet = new CDesktopPet();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//configuration didn't open... create a desktop pet only
|
||||
m_pPet = new CDesktopPet();
|
||||
}
|
||||
|
||||
//initialse footprint icons
|
||||
for( int i = 0; i < 8; i++ ) m_hIconFootprints[i] = NULL;
|
||||
|
||||
//apply scaling
|
||||
m_pPet->SetScale( ((float)m_dwScale / 100.0f ) );
|
||||
|
||||
//load the images
|
||||
BOOL fLoadProblems = FALSE;
|
||||
if( m_szLibname == NULL || *m_szLibname == '\0' || ((int)ExtractIcon( g_hInstance, m_szLibname, -1 ) < 32 ))
|
||||
{
|
||||
//use default images if there is no file or not enough icons
|
||||
GetModuleFileName( NULL, m_szLibname, MAX_PATH );
|
||||
fLoadProblems = !LoadImages();
|
||||
}
|
||||
else
|
||||
{
|
||||
//load all the icons in the file
|
||||
fLoadProblems = !LoadImages();
|
||||
if( fLoadProblems )
|
||||
{
|
||||
//use default images if it fails with the user's choice
|
||||
GetModuleFileName( NULL, m_szLibname, MAX_PATH );
|
||||
fLoadProblems = !LoadImages();
|
||||
}
|
||||
}
|
||||
|
||||
/* FIXME:
|
||||
|
||||
It appears that Windows offers no support for ExtractIcon
|
||||
on icons that are not 32x32 - this means that all icon
|
||||
libraries selected by the user to use will have their icons
|
||||
scaled down to 32x32. I have tried the following:
|
||||
|
||||
1) Used LoadLibrary() to load the icon library chosen. This
|
||||
worked on some, but not all. I then used LoadLibraryEx()
|
||||
and passed it the 'don't call DllMain' flags. This caused
|
||||
the libraries that weren't working to work, and vice-versa.
|
||||
|
||||
2) After LoadLibrary(), attempting to load all resource IDs
|
||||
until 32 valid icons were loaded. This nearly worked, but
|
||||
took ages and was therefor unacceptable. It also failed
|
||||
with LoadLibrary() as in 1.
|
||||
|
||||
3) Tried EnumResourceNames() for all icons. It only loaded some
|
||||
of them and then gave up. At this point, so did I.
|
||||
|
||||
Result: It is only possible to use 32x32 icons in Neko, although
|
||||
these can be scaled up or down as required, resulting in blockyness
|
||||
etc.
|
||||
|
||||
*/
|
||||
|
||||
//set initial state
|
||||
SetState( STOP );
|
||||
|
||||
//set initial action
|
||||
m_nActionX = m_pPet->GetBoundsRect().left + ( rand() % (m_pPet->GetBoundsRect().right-(m_dwSpeed * 8)) );
|
||||
m_nActionY = m_pPet->GetBoundsRect().top + ( rand() % (m_pPet->GetBoundsRect().bottom-(m_dwSpeed * 8)) );
|
||||
m_nActionDX = ((( rand() % 2 ) ? 1 : -1) * (m_dwSpeed/2)) + 1;
|
||||
m_nActionDY = ((( rand() % 2 ) ? 1 : -1) * (m_dwSpeed/2)) + 1;
|
||||
|
||||
//set initial position (random)
|
||||
m_nToX = m_pPet->GetBoundsRect().left + ( rand() % ( (m_pPet->GetBoundsRect().right- m_pPet->GetSize().cx) - m_pPet->GetBoundsRect().left ) ) ;
|
||||
m_nToY = m_pPet->GetBoundsRect().top + ( rand() % ( (m_pPet->GetBoundsRect().bottom - m_pPet->GetSize().cy) - m_pPet->GetBoundsRect().top ) );
|
||||
|
||||
m_pPet->MoveTo( m_nToX, m_nToY );
|
||||
|
||||
//deal with error (fixme?)
|
||||
/*
|
||||
if( fLoadProblems )
|
||||
throw ICON_EXCEPTION;
|
||||
*/
|
||||
}
|
||||
|
||||
CNeko::~CNeko()
|
||||
{
|
||||
delete m_pPet;
|
||||
for( int i = 0; i < 8; i++ ) if( m_hIconFootprints[i] ) DestroyIcon( m_hIconFootprints[i] );
|
||||
}
|
||||
|
||||
BOOL CNeko::MoveStart()
|
||||
{
|
||||
return( !(( m_nOldToX >= m_nToX-(int)m_dwIdleSpace ) &&
|
||||
( m_nOldToX <= m_nToX+(int)m_dwIdleSpace ) &&
|
||||
( m_nOldToY >= m_nToY-(int)m_dwIdleSpace ) &&
|
||||
( m_nOldToY <= m_nToY+(int)m_dwIdleSpace )));
|
||||
}
|
||||
|
||||
void CNeko::CalcDirection()
|
||||
{
|
||||
State NewState;
|
||||
double LargeX, LargeY, Length, SinTheta;
|
||||
|
||||
if( (m_nDX == 0) && (m_nDY == 0) )
|
||||
NewState = STOP;
|
||||
else
|
||||
{
|
||||
LargeX = (double)m_nDX;
|
||||
LargeY = (double)(-m_nDY);
|
||||
Length = sqrt(LargeX * LargeX + LargeY * LargeY);
|
||||
SinTheta = LargeY / Length;
|
||||
|
||||
if( m_nDX > 0 )
|
||||
{
|
||||
if( SinTheta > g_dSinPiPer8Times3 )
|
||||
NewState = U_MOVE;
|
||||
else
|
||||
if( (SinTheta <= g_dSinPiPer8Times3 ) && ( SinTheta > g_dSinPiPer8 ) )
|
||||
NewState = UR_MOVE;
|
||||
else
|
||||
if( (SinTheta <= g_dSinPiPer8) && (SinTheta > -(g_dSinPiPer8) ) )
|
||||
NewState = R_MOVE;
|
||||
else
|
||||
if( (SinTheta <= -(g_dSinPiPer8) ) && (SinTheta > -(g_dSinPiPer8Times3) ) )
|
||||
NewState = DR_MOVE;
|
||||
else
|
||||
NewState = D_MOVE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( SinTheta > g_dSinPiPer8Times3 )
|
||||
NewState = U_MOVE;
|
||||
else
|
||||
if( (SinTheta <= g_dSinPiPer8Times3) && (SinTheta > g_dSinPiPer8) )
|
||||
NewState = UL_MOVE;
|
||||
else
|
||||
if( (SinTheta <= g_dSinPiPer8) && (SinTheta > -(g_dSinPiPer8) ) )
|
||||
NewState = L_MOVE;
|
||||
else
|
||||
if( (SinTheta <= -(g_dSinPiPer8)) && (SinTheta > -(g_dSinPiPer8Times3) ) )
|
||||
NewState = DL_MOVE;
|
||||
else
|
||||
NewState = D_MOVE;
|
||||
}
|
||||
}
|
||||
|
||||
if( m_State != NewState ) SetState( NewState );
|
||||
|
||||
}
|
||||
|
||||
void CNeko::RunTowards(int nX, int nY)
|
||||
{
|
||||
//store old and new target
|
||||
m_nOldToX = m_nToX; m_nOldToY = m_nToY;
|
||||
m_nToX = nX; m_nToY = nY;
|
||||
|
||||
//calculate distance to target and set delta positions
|
||||
double dLargeX, dLargeY, dDoubleLength, dLength;
|
||||
dLargeX = (double)(m_nToX - m_pPet->GetPosition().x - (int)m_pPet->GetSize().cx / 2); //stop in middle of cursor
|
||||
dLargeY = (double)(m_nToY - m_pPet->GetPosition().y - (int)m_pPet->GetSize().cy + 1); //...and just above
|
||||
dDoubleLength = dLargeX * dLargeX + dLargeY * dLargeY;
|
||||
|
||||
if( dDoubleLength != 0.0 )
|
||||
{
|
||||
dLength = sqrt( dDoubleLength );
|
||||
if( dLength <= (int)m_dwSpeed )
|
||||
{
|
||||
//less than top speed - jump the gap!
|
||||
m_nDX = (int)dLargeX;
|
||||
m_nDY = (int)dLargeY;
|
||||
}
|
||||
else
|
||||
{
|
||||
//more than top speed - run at top speed towards target
|
||||
m_nDX = (int)(((int)m_dwSpeed * dLargeX) / dLength );
|
||||
m_nDY = (int)(((int)m_dwSpeed * dLargeY) / dLength );
|
||||
}
|
||||
}
|
||||
else //we're at the target - stop
|
||||
m_nDX = m_nDY = 0;
|
||||
|
||||
//increment animation counter
|
||||
if ( ++m_uTickCount >= MAX_TICK ) m_uTickCount = 0;
|
||||
|
||||
if ( m_uTickCount%2 == 0 )
|
||||
if (m_uStateCount < MAX_TICK) m_uStateCount++;
|
||||
|
||||
//change state
|
||||
switch( m_State )
|
||||
{
|
||||
case STOP:
|
||||
if( MoveStart() )
|
||||
SetState( AWAKE );
|
||||
else
|
||||
if( m_uStateCount >= STOP_TIME )
|
||||
if( m_nDX < 0 && m_pPet->GetPosition().x <= 0 ) SetState( L_CLAW );
|
||||
else
|
||||
if( m_nDX > 0 && m_pPet->GetPosition().x >= ( m_pPet->GetBoundsRect().right - m_pPet->GetBoundsRect().left ) - m_pPet->GetSize().cx ) SetState( R_CLAW );
|
||||
else
|
||||
if( m_nDY < 0 && m_pPet->GetPosition().y <= 0 ) SetState( U_CLAW );
|
||||
else
|
||||
if( m_nDY > 0 && m_pPet->GetPosition().y >= ( m_pPet->GetBoundsRect().bottom - m_pPet->GetBoundsRect().top ) - m_pPet->GetSize().cy ) SetState( D_CLAW );
|
||||
else SetState( WASH );
|
||||
m_pPet->SetImage( GetStateAnimationFrameIndex() );
|
||||
break;
|
||||
|
||||
case WASH:
|
||||
if( MoveStart() ) SetState( AWAKE );
|
||||
else if( m_uStateCount >= WASH_TIME ) SetState( SCRATCH );
|
||||
m_pPet->SetImage( GetStateAnimationFrameIndex() );
|
||||
break;
|
||||
|
||||
case SCRATCH:
|
||||
if( MoveStart() ) SetState( AWAKE );
|
||||
else if (m_uStateCount >= SCRATCH_TIME ) SetState( YAWN );
|
||||
m_pPet->SetImage( GetStateAnimationFrameIndex() );
|
||||
break;
|
||||
|
||||
case YAWN:
|
||||
if( MoveStart() ) SetState( AWAKE );
|
||||
else if (m_uStateCount >= YAWN_TIME) SetState( SLEEP );
|
||||
m_pPet->SetImage( GetStateAnimationFrameIndex() );
|
||||
break;
|
||||
|
||||
case SLEEP:
|
||||
if( MoveStart() ) SetState( AWAKE );
|
||||
m_pPet->SetImage( GetStateAnimationFrameIndex() );
|
||||
break;
|
||||
|
||||
case AWAKE:
|
||||
if( m_uStateCount >= (UINT)(AWAKE_TIME + (rand()%20)) ) CalcDirection();
|
||||
m_pPet->SetImage( GetStateAnimationFrameIndex() );
|
||||
break;
|
||||
|
||||
case U_MOVE:
|
||||
case D_MOVE:
|
||||
case L_MOVE:
|
||||
case R_MOVE:
|
||||
case UL_MOVE:
|
||||
case UR_MOVE:
|
||||
case DL_MOVE:
|
||||
case DR_MOVE:
|
||||
{
|
||||
//make sure Neko does not go outside boundary area
|
||||
int nX = m_pPet->GetPosition().x, nY = m_pPet->GetPosition().y;
|
||||
int nNewX = nX + m_nDX, nNewY = nY + m_nDY;
|
||||
int nWidth = ( m_pPet->GetBoundsRect().right - m_pPet->GetBoundsRect().left ) - m_pPet->GetSize().cx;
|
||||
int nHeight = ( m_pPet->GetBoundsRect().bottom - m_pPet->GetBoundsRect().top ) - m_pPet->GetSize().cy;
|
||||
BOOL fOutside = ( nNewX <= 0 || nNewX >= nWidth || nNewY <= 0 || nNewY >= nHeight );
|
||||
|
||||
//change the image and move Neko
|
||||
CalcDirection();
|
||||
|
||||
//clip new x and y positions and see if we've moved anywhere
|
||||
if( nNewX < 0 ) nNewX = 0; else if( nNewX > nWidth ) nNewX = nWidth;
|
||||
if( nNewY < 0 ) nNewY = 0; else if( nNewY > nHeight ) nNewY = nHeight;
|
||||
BOOL fNotMoved = ( nNewX == nX ) && ( nNewY == nY );
|
||||
|
||||
//stop if we can't go any further
|
||||
if( fOutside && fNotMoved )
|
||||
SetState(STOP);
|
||||
else
|
||||
{
|
||||
m_pPet->SetImageAndMoveTo( GetStateAnimationFrameIndex(), nNewX, nNewY );
|
||||
if( m_bFootprints )
|
||||
{
|
||||
int iFpAnim = -1;
|
||||
switch( m_State )
|
||||
{
|
||||
case U_MOVE: iFpAnim = 0; break;
|
||||
case D_MOVE: iFpAnim = 4; break;
|
||||
case L_MOVE: iFpAnim = 6; break;
|
||||
case R_MOVE: iFpAnim = 2; break;
|
||||
case UL_MOVE: iFpAnim = 7; break;
|
||||
case UR_MOVE: iFpAnim = 1; break;
|
||||
case DL_MOVE: iFpAnim = 5; break;
|
||||
case DR_MOVE: iFpAnim = 3; break;
|
||||
}
|
||||
if( iFpAnim != -1 )
|
||||
{
|
||||
if( m_uTickCount & 1 )
|
||||
m_pPet->DrawOnTarget( nX-(m_nDY/2), nY, m_hIconFootprints[iFpAnim] );
|
||||
else
|
||||
m_pPet->DrawOnTarget( nX, nY-(m_nDX/2), m_hIconFootprints[iFpAnim] );
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case U_CLAW:
|
||||
case D_CLAW:
|
||||
case L_CLAW:
|
||||
case R_CLAW:
|
||||
if( MoveStart() ) SetState( AWAKE );
|
||||
else if( m_uStateCount >= CLAW_TIME ) SetState( SCRATCH );
|
||||
m_pPet->SetImage( GetStateAnimationFrameIndex() );
|
||||
break;
|
||||
|
||||
default:
|
||||
//something bad has happened!
|
||||
MessageBeep( 0xFFFFFFFF );
|
||||
SetState( STOP );
|
||||
m_pPet->SetImage( GetStateAnimationFrameIndex() );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int CNeko::GetStateAnimationFrameIndex()
|
||||
{
|
||||
if ( m_State != SLEEP )
|
||||
return m_nAnimation[m_State][m_uTickCount & 0x1];
|
||||
else
|
||||
return m_nAnimation[m_State][(m_uTickCount>>2) & 0x1];
|
||||
|
||||
}
|
||||
|
||||
void CNeko::SetState( State state )
|
||||
{
|
||||
//reset the animation counters
|
||||
m_uTickCount = 0;
|
||||
m_uStateCount = 0;
|
||||
|
||||
//update the state
|
||||
m_State = state;
|
||||
}
|
||||
|
||||
|
||||
BOOL CNeko::LoadImages()
|
||||
{
|
||||
/* Note: The icons should be in the following order in the file:
|
||||
|
||||
Awake
|
||||
Up 1
|
||||
Up 2
|
||||
Up Right 1
|
||||
Up Right 2
|
||||
Right 1
|
||||
Right 2
|
||||
Down Right 1
|
||||
Down Right 2
|
||||
Down 1
|
||||
Down 2
|
||||
Down Left 1
|
||||
Down Left 2
|
||||
Left 1
|
||||
Left 2
|
||||
Up Left 1
|
||||
Up Left 2
|
||||
Up Claw 1
|
||||
Up Claw 2
|
||||
Right Claw 1
|
||||
Right Claw 2
|
||||
Left Claw 1
|
||||
Left Claw 2
|
||||
Down Claw 1
|
||||
Down Claw 2
|
||||
Wash 2
|
||||
Scratch 1
|
||||
Scratch 2
|
||||
Yawn 1
|
||||
Yawn 2
|
||||
Sleep 1
|
||||
Sleep 2
|
||||
*/
|
||||
|
||||
//load the icons
|
||||
int n;
|
||||
HICON hIcons[32];
|
||||
for( n = 0; n < 32; n++ )
|
||||
hIcons[n] = ExtractIcon( g_hInstance, m_szLibname, n );
|
||||
|
||||
//check last icon
|
||||
if( (UINT)hIcons[31] <= 1 )
|
||||
{
|
||||
//error - delete all icons
|
||||
for( n = 0; n < 32; n++ ) DestroyIcon( hIcons[n] );
|
||||
|
||||
char szBuffer[1024];
|
||||
wsprintf( szBuffer, "There are not enough icons in this icon library\n%s\nIt must contain at least 32 icons", m_szLibname );
|
||||
MessageBox( NULL, szBuffer, "Error", MB_ICONERROR|MB_TASKMODAL );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//apply icons
|
||||
m_pPet->SetImages( hIcons, 32 );
|
||||
|
||||
//destroy icon table
|
||||
for( n = 0; n < 32; n++ ) DestroyIcon( hIcons[n] );
|
||||
|
||||
//load footprints
|
||||
if( m_bFootprints )
|
||||
{
|
||||
if( *m_szFootprintLibname )
|
||||
for( n = 0; n < 8; n++ ) m_hIconFootprints[n] = ExtractIcon( g_hInstance, m_szFootprintLibname, n );
|
||||
else
|
||||
{
|
||||
UINT uID[] = { IDI_FP_UP, IDI_FP_UPRIGHT, IDI_FP_RIGHT, IDI_FP_DOWNRIGHT, IDI_FP_DOWN, IDI_FP_DOWNLEFT, IDI_FP_LEFT, IDI_FP_UPLEFT };
|
||||
for( n = 0; n < 8; n++ ) m_hIconFootprints[n] = LoadIcon( g_hInstance, MAKEINTRESOURCE(uID[n]) );
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/********************************************************************************************************/
|
||||
|
||||
void CNeko::Update()
|
||||
{
|
||||
//apply VVPAI (very, very poor artificial intelligence!!!)
|
||||
switch( m_Action )
|
||||
{
|
||||
default:
|
||||
case CHASE_MOUSE:
|
||||
{
|
||||
POINT pt;
|
||||
GetCursorPos( &pt );
|
||||
RunTowards( pt.x, pt.y );
|
||||
break;
|
||||
}
|
||||
|
||||
case RUN_AWAY_FROM_MOUSE:
|
||||
{
|
||||
POINT pt;
|
||||
int xdiff, ydiff;
|
||||
GetCursorPos( &pt );
|
||||
DWORD dwLimit = m_dwIdleSpace*16;
|
||||
|
||||
xdiff = ( m_pPet->GetPosition().x + (m_pPet->GetSize().cx/2) ) - pt.x;
|
||||
ydiff = ( m_pPet->GetPosition().y + (m_pPet->GetSize().cy/2) ) - pt.y;
|
||||
|
||||
if( abs(xdiff) < (int)dwLimit && abs(ydiff) < (int)dwLimit )
|
||||
{
|
||||
//mouse cursor is too close
|
||||
int x, y;
|
||||
double dLength = sqrt(xdiff*xdiff + ydiff*ydiff);
|
||||
if( dLength != 0.0 )
|
||||
{
|
||||
x = m_pPet->GetPosition().x + (int)((xdiff / dLength) * dwLimit);
|
||||
y = m_pPet->GetPosition().y + (int)((ydiff / dLength) * dwLimit);
|
||||
}
|
||||
else
|
||||
x = y = 32;
|
||||
|
||||
//make Neko run away from the mouse
|
||||
RunTowards( x, y );
|
||||
if( m_State == AWAKE ) CalcDirection(); //don't show awake animation
|
||||
}
|
||||
else
|
||||
RunTowards( m_nToX, m_nToY ); //keep running...
|
||||
break;
|
||||
}
|
||||
|
||||
case RUN_AROUND_RANDOMLY:
|
||||
{
|
||||
if( m_State == SLEEP) m_nActionCount++;
|
||||
if( m_nActionCount > (int)m_dwIdleSpace*10 )
|
||||
{
|
||||
m_nActionCount = 0;
|
||||
RunTowards( m_pPet->GetBoundsRect().left + (rand() % (m_pPet->GetBoundsRect().right-m_pPet->GetBoundsRect().left)), m_pPet->GetBoundsRect().top + (rand() % (m_pPet->GetBoundsRect().bottom-m_pPet->GetBoundsRect().top)) );
|
||||
}
|
||||
else
|
||||
RunTowards( m_nToX, m_nToY );
|
||||
break;
|
||||
}
|
||||
|
||||
case PACE_AROUND_SCREEN:
|
||||
{
|
||||
if( (m_nDX == 0) && (m_nDY == 0) ) m_nActionCount = ( m_nActionCount + 1 ) % 4;
|
||||
switch( m_nActionCount )
|
||||
{
|
||||
case 0: RunTowards( m_pPet->GetBoundsRect().left + m_pPet->GetSize().cx, m_pPet->GetBoundsRect().top + m_pPet->GetSize().cy ); break;
|
||||
case 1: RunTowards( m_pPet->GetBoundsRect().left + m_pPet->GetSize().cx, m_pPet->GetBoundsRect().bottom - m_pPet->GetSize().cy ); break;
|
||||
case 2: RunTowards( m_pPet->GetBoundsRect().right - m_pPet->GetSize().cx, m_pPet->GetBoundsRect().bottom - m_pPet->GetSize().cy ); break;
|
||||
case 3: RunTowards( m_pPet->GetBoundsRect().right - m_pPet->GetSize().cx, m_pPet->GetBoundsRect().top + m_pPet->GetSize().cy ); break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case RUN_AROUND:
|
||||
{
|
||||
//bounding box repel border
|
||||
DWORD dwBoundingBox = m_dwSpeed * 8;
|
||||
|
||||
//move invisible ball
|
||||
m_nActionX += m_nActionDX;
|
||||
m_nActionY += m_nActionDY;
|
||||
|
||||
//repel invisible ball from the edges of the screen.
|
||||
if( m_nActionX < (int)(m_pPet->GetBoundsRect().left + dwBoundingBox) )
|
||||
if( m_nActionX > m_pPet->GetBoundsRect().left ) m_nActionDX++; else m_nActionDX = -m_nActionDX;
|
||||
else
|
||||
if( m_nActionX > (int)(m_pPet->GetBoundsRect().right - dwBoundingBox) )
|
||||
if( m_nActionX < m_pPet->GetBoundsRect().right ) m_nActionDX--; else m_nActionDX = -m_nActionDX;
|
||||
|
||||
if( m_nActionY < (int)(m_pPet->GetBoundsRect().top + dwBoundingBox) )
|
||||
if( m_nActionY > m_pPet->GetBoundsRect().top ) m_nActionDY++; else m_nActionDY = -m_nActionDY;
|
||||
else
|
||||
if( m_nActionY > (int)(m_pPet->GetBoundsRect().bottom - dwBoundingBox) )
|
||||
if( m_nActionY < m_pPet->GetBoundsRect().bottom ) m_nActionDY--; else m_nActionDY = -m_nActionDY;
|
||||
|
||||
//tell Neko to run towards the new point
|
||||
RunTowards( m_nActionX, m_nActionY );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//play idle sounds
|
||||
if( m_dwSndFrequency )
|
||||
{
|
||||
if( (DWORD)(rand()%100) <= m_dwSndFrequency )
|
||||
{
|
||||
switch( GetState() )
|
||||
{
|
||||
case AWAKE:
|
||||
PlaySound( m_szSndAwake, NULL, SND_NOSTOP|SND_NOWAIT|SND_FILENAME|SND_NODEFAULT|SND_ASYNC );
|
||||
break;
|
||||
|
||||
case SLEEP:
|
||||
PlaySound( m_szSndSleep, NULL, SND_NOSTOP|SND_NOWAIT|SND_FILENAME|SND_NODEFAULT|SND_ASYNC );
|
||||
break;
|
||||
|
||||
default:
|
||||
switch( rand()%3 )
|
||||
{
|
||||
case 0: PlaySound( m_szSndIdle1, NULL, SND_NOSTOP|SND_NOWAIT|SND_FILENAME|SND_NODEFAULT|SND_ASYNC ); break;
|
||||
case 1: PlaySound( m_szSndIdle2, NULL, SND_NOSTOP|SND_NOWAIT|SND_FILENAME|SND_NODEFAULT|SND_ASYNC ); break;
|
||||
default: PlaySound( m_szSndIdle3, NULL, SND_NOSTOP|SND_NOWAIT|SND_FILENAME|SND_NODEFAULT|SND_ASYNC ); break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
81
nkosrc4/Neko98/Neko.h
Executable file
@@ -0,0 +1,81 @@
|
||||
// Neko.h: interface for the CNeko class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_NEKO_H__A69EBAA5_385D_11D2_9FF9_00001C192944__INCLUDED_)
|
||||
#define AFX_NEKO_H__A69EBAA5_385D_11D2_9FF9_00001C192944__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#include "DesktopPet.h"
|
||||
#include "AlwaysOnTopPet.h"
|
||||
#include "NekoCommon.h"
|
||||
|
||||
class CNeko {
|
||||
|
||||
public:
|
||||
CNeko( char* pszName = "" );
|
||||
virtual ~CNeko();
|
||||
|
||||
//public interface
|
||||
virtual void Update();
|
||||
virtual void RunTowards( int nX, int nY );
|
||||
|
||||
protected:
|
||||
|
||||
//states. (note: I know that the numbering is unnecessary, but you never know... - these MUST go from 0-17)
|
||||
enum State { STOP = 0, WASH = 1, SCRATCH = 2, YAWN = 3, SLEEP = 4, AWAKE = 5, U_MOVE = 6,
|
||||
D_MOVE = 7, L_MOVE = 8, R_MOVE = 9, UL_MOVE = 10, UR_MOVE = 11, DL_MOVE = 12,
|
||||
DR_MOVE = 13, U_CLAW = 14, D_CLAW = 15, L_CLAW = 16, R_CLAW = 17 };
|
||||
|
||||
//position info
|
||||
int m_nDX, m_nDY;
|
||||
int m_nOldToX, m_nOldToY;
|
||||
int m_nToX, m_nToY;
|
||||
|
||||
//size info
|
||||
DWORD m_dwScale;
|
||||
|
||||
//state info
|
||||
UINT m_uTickCount, m_uStateCount;
|
||||
State m_State;
|
||||
|
||||
//action info
|
||||
int m_Action;
|
||||
int m_nActionCount;
|
||||
int m_nActionX, m_nActionY, m_nActionDX, m_nActionDY;
|
||||
|
||||
//attributes
|
||||
DWORD m_dwSpeed;
|
||||
DWORD m_dwIdleSpace;
|
||||
char m_szLibname[MAX_PATH];
|
||||
char m_szFootprintLibname[MAX_PATH];
|
||||
BOOL m_bFootprints;
|
||||
|
||||
//sound stuff
|
||||
char m_szSndIdle1[MAX_PATH], m_szSndIdle2[MAX_PATH], m_szSndIdle3[MAX_PATH];
|
||||
char m_szSndSleep[MAX_PATH], m_szSndAwake[MAX_PATH];
|
||||
DWORD m_dwSndFrequency;
|
||||
|
||||
//named Neko stuff
|
||||
char m_szName[MAX_NEKO_NAME];
|
||||
|
||||
//animation lookup table
|
||||
int m_nAnimation[18][2];
|
||||
|
||||
State GetState() { return m_State; }
|
||||
|
||||
HICON m_hIconFootprints[8];
|
||||
|
||||
private:
|
||||
CPet* m_pPet;
|
||||
BOOL LoadImages();
|
||||
int GetStateAnimationFrameIndex();
|
||||
void CalcDirection();
|
||||
BOOL MoveStart();
|
||||
void SetState( State state );
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_NEKO_H__A69EBAA5_385D_11D2_9FF9_00001C192944__INCLUDED_)
|
||||
169
nkosrc4/Neko98/Neko95.rc
Executable file
@@ -0,0 +1,169 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Neutral resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifndef _MAC
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,0,1
|
||||
PRODUCTVERSION 1,0,0,1
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x40004L
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "080904b0"
|
||||
BEGIN
|
||||
VALUE "Comments", "\0"
|
||||
VALUE "CompanyName", "DHSoft\0"
|
||||
VALUE "FileDescription", "Neko for Windows\0"
|
||||
VALUE "FileVersion", "4.0h\0"
|
||||
VALUE "InternalName", "Neko\0"
|
||||
VALUE "LegalCopyright", "Copyright <20> 1999\0"
|
||||
VALUE "LegalTrademarks", "\0"
|
||||
VALUE "OriginalFilename", "Neko98.exe\0"
|
||||
VALUE "PrivateBuild", "\0"
|
||||
VALUE "ProductName", "Neko98\0"
|
||||
VALUE "ProductVersion", "4.0h\0"
|
||||
VALUE "SpecialBuild", "\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x809, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#endif // !_MAC
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDI_AWAKE ICON DISCARDABLE "Res\\Awake.ico"
|
||||
IDI_UP1 ICON DISCARDABLE "Res\\Up1.ico"
|
||||
IDI_UP2 ICON DISCARDABLE "Res\\Up2.ico"
|
||||
IDI_UPRIGHT1 ICON DISCARDABLE "Res\\Upright1.ico"
|
||||
IDI_UPRIGHT2 ICON DISCARDABLE "Res\\Upright2.ico"
|
||||
IDI_RIGHT1 ICON DISCARDABLE "Res\\Right1.ico"
|
||||
IDI_RIGHT2 ICON DISCARDABLE "Res\\right2.ico"
|
||||
IDI_DOWNRIGHT1 ICON DISCARDABLE "Res\\Downright1.ico"
|
||||
IDI_DOWNRIGHT2 ICON DISCARDABLE "Res\\downright2.ico"
|
||||
IDI_DOWN1 ICON DISCARDABLE "Res\\Down1.ico"
|
||||
IDI_DOWN2 ICON DISCARDABLE "Res\\down2.ico"
|
||||
IDI_DOWNLEFT1 ICON DISCARDABLE "Res\\downleft1.ico"
|
||||
IDI_DOWNLEFT2 ICON DISCARDABLE "Res\\Downleft2.ico"
|
||||
IDI_LEFT1 ICON DISCARDABLE "Res\\left1.ico"
|
||||
IDI_LEFT2 ICON DISCARDABLE "Res\\left2.ico"
|
||||
IDI_UPLEFT1 ICON DISCARDABLE "Res\\Upleft1.ico"
|
||||
IDI_UPLEFT2 ICON DISCARDABLE "Res\\Upleft2.ico"
|
||||
IDI_UPCLAW1 ICON DISCARDABLE "Res\\upclaw1.ico"
|
||||
IDI_UPCLAW2 ICON DISCARDABLE "Res\\upclaw2.ico"
|
||||
IDI_RIGHTCLAW1 ICON DISCARDABLE "Res\\rightclaw1.ico"
|
||||
IDI_RIGHTCLAW2 ICON DISCARDABLE "Res\\Rightclaw2.ico"
|
||||
IDI_LEFTCLAW1 ICON DISCARDABLE "Res\\leftclaw1.ico"
|
||||
IDI_LEFTCLAW2 ICON DISCARDABLE "Res\\leftclaw2.ico"
|
||||
IDI_DOWNCLAW1 ICON DISCARDABLE "Res\\downclaw1.ico"
|
||||
IDI_DOWNCLAW2 ICON DISCARDABLE "Res\\downclaw2.ico"
|
||||
IDI_WASH2 ICON DISCARDABLE "Res\\wash2.ico"
|
||||
IDI_SCRATCH1 ICON DISCARDABLE "Res\\scratch1.ico"
|
||||
IDI_SCRATCH2 ICON DISCARDABLE "Res\\scratch2.ico"
|
||||
IDI_YAWN2 ICON DISCARDABLE "Res\\yawn2.ico"
|
||||
IDI_YAWN3 ICON DISCARDABLE "Res\\yawn3.ico"
|
||||
IDI_SLEEP1 ICON DISCARDABLE "Res\\sleep1.ico"
|
||||
IDI_SLEEP2 ICON DISCARDABLE "Res\\sleep2.ico"
|
||||
IDI_FP_UP ICON DISCARDABLE "Res\\fp_up.ico"
|
||||
IDI_FP_UPRIGHT ICON DISCARDABLE "Res\\fp_upright.ico"
|
||||
IDI_FP_RIGHT ICON DISCARDABLE "Res\\fp_right.ico"
|
||||
IDI_FP_DOWNRIGHT ICON DISCARDABLE "Res\\fp_downright.ico"
|
||||
IDI_FP_DOWN ICON DISCARDABLE "Res\\fp_down.ico"
|
||||
IDI_FP_DOWNLEFT ICON DISCARDABLE "Res\\fp_downleft.ico"
|
||||
IDI_FP_LEFT ICON DISCARDABLE "Res\\fp_left.ico"
|
||||
IDI_FP_UPLEFT ICON DISCARDABLE "Res\\fp_upleft.ico"
|
||||
#endif // Neutral resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.K.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
#endif // English (U.K.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
246
nkosrc4/Neko98/Neko98.cpp
Executable file
@@ -0,0 +1,246 @@
|
||||
/************************************
|
||||
Neko for Windows
|
||||
*************************************/
|
||||
|
||||
#include <windows.h>
|
||||
#include <commctrl.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "Tray.h"
|
||||
#include "NekoSettings.h"
|
||||
#include "NekoCommon.h"
|
||||
#include "resource.h"
|
||||
#include "Neko.h"
|
||||
|
||||
//global variables
|
||||
HINSTANCE g_hInstance = NULL;
|
||||
HWND g_hWndMain = NULL;
|
||||
BOOL g_fTaskbar = TRUE;
|
||||
CTray * Tray = NULL;
|
||||
|
||||
int g_nNumCats = 0;
|
||||
typedef CNeko* PNeko;
|
||||
PNeko* g_NekoArray = NULL; //array of CNeko pointers
|
||||
DWORD g_dwSleepTime = 100;
|
||||
|
||||
BOOL g_fNeedReinit = TRUE;
|
||||
|
||||
|
||||
/* ExecuteConfigProcess - runs the configuration program *******************************/
|
||||
void ExecuteConfigProcess()
|
||||
{
|
||||
if( (int)ShellExecute( NULL, "open", "NekoCFG.EXE", 0, "", SW_SHOWNORMAL ) <= 32 )
|
||||
MessageBox( NULL, "Neko was unable to start the configuration program\n'NekoCFG.EXE'\n\nMake sure that this file is in the same folder as the main Neko program.", "Configure Neko", MB_ICONEXCLAMATION );
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* LoadConfiguration - reloads the program configuration *******************************/
|
||||
void LoadConfiguration()
|
||||
{
|
||||
//load in the new global settings
|
||||
CNekoSettings * NekoSettings = new CNekoSettings( szNekoRegKey );
|
||||
NekoSettings->GetBool( szNekoTaskbarKey, &g_fTaskbar );
|
||||
|
||||
//delete all existing Nekos
|
||||
int i;
|
||||
for( i = 0; i < g_nNumCats; i++ ) delete g_NekoArray[i];
|
||||
delete[] g_NekoArray;
|
||||
|
||||
//load in new cats list
|
||||
DWORD dwNumCats = 0;
|
||||
NekoSettings->GetInt( szNekoNumCatsKey, &dwNumCats );
|
||||
g_nNumCats = dwNumCats;
|
||||
|
||||
if( g_nNumCats == 0 )
|
||||
{
|
||||
//the user hasn't run the config program, or there are no Nekos - use default
|
||||
g_NekoArray = new PNeko[1];
|
||||
g_NekoArray[0] = new CNeko();
|
||||
g_nNumCats = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_NekoArray = new PNeko[g_nNumCats];
|
||||
for( i = 0; i < g_nNumCats; i++ )
|
||||
{
|
||||
//build the key index
|
||||
char szSubKey[MAX_PATH], szName[MAX_NEKO_NAME];
|
||||
sprintf( szSubKey, "%d", i );
|
||||
|
||||
//load this cat's name from the registry
|
||||
NekoSettings->GetString( szSubKey, szName, MAX_NEKO_NAME-1 );
|
||||
|
||||
//add this Neko to the array
|
||||
g_NekoArray[i] = new CNeko( szName );
|
||||
}
|
||||
}
|
||||
|
||||
//erase the Neko settings
|
||||
delete NekoSettings;
|
||||
|
||||
//calculate new sleep time
|
||||
g_dwSleepTime = 100;
|
||||
if( g_nNumCats <= 20 ) g_dwSleepTime = 200 - ( 5 * g_nNumCats );
|
||||
|
||||
//update task bar
|
||||
if( g_fTaskbar )
|
||||
{
|
||||
if( Tray->GetCount() == 0 )
|
||||
Tray->AddIcon( g_hWndMain, LoadIcon( g_hInstance, MAKEINTRESOURCE( IDI_AWAKE )), 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( Tray->GetCount() > 0 )
|
||||
Tray->RemoveIcon( g_hWndMain, 1 );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* WndProc - message processing function for the hidden Neko window ********************/
|
||||
LRESULT CALLBACK WndProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
switch( message )
|
||||
{
|
||||
case WM_DESTROY:
|
||||
//terminate the program
|
||||
PostQuitMessage( 0 );
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
switch(LOWORD(wParam))
|
||||
{
|
||||
case ID_SETTINGS:
|
||||
ExecuteConfigProcess();
|
||||
break;
|
||||
|
||||
case ID_EXIT:
|
||||
PostQuitMessage( 0 );
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_DEVMODECHANGE:
|
||||
case WM_DISPLAYCHANGE:
|
||||
case WM_SETTINGCHANGE:
|
||||
case MY_UPDATENEKO:
|
||||
g_fNeedReinit = TRUE;
|
||||
break;
|
||||
|
||||
case MY_NOTIFYICON:
|
||||
switch( lParam )
|
||||
{
|
||||
case WM_LBUTTONDBLCLK:
|
||||
ExecuteConfigProcess();
|
||||
break;
|
||||
|
||||
case WM_RBUTTONUP:
|
||||
//this line is needed to make the menu go away!
|
||||
//(from Windows Developer FAQ [Robert Mashlan])
|
||||
SetForegroundWindow( hWnd );
|
||||
|
||||
//show the context menu
|
||||
Tray->ShowPopupMenu( hWnd );
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_TIMER:
|
||||
{
|
||||
//check to see if stuff needs reinitialisation
|
||||
if( g_fNeedReinit )
|
||||
{
|
||||
LoadConfiguration();
|
||||
g_fNeedReinit = FALSE;
|
||||
}
|
||||
|
||||
//update all Nekos
|
||||
for( int i = 0; i < g_nNumCats; i++ ) g_NekoArray[i]->Update();
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
return DefWindowProc( hWnd, message, wParam, lParam );
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* InitApplication - program initialisation function ***********************************/
|
||||
BOOL InitApplication( HINSTANCE hInstance )
|
||||
{
|
||||
//store the instance handle
|
||||
g_hInstance = hInstance;
|
||||
|
||||
//create the (hidden) window
|
||||
WNDCLASS wc;
|
||||
wc.style = 0;
|
||||
wc.lpfnWndProc = (WNDPROC)WndProc;
|
||||
wc.cbClsExtra = 0;
|
||||
wc.cbWndExtra = 0;
|
||||
wc.hInstance = hInstance;
|
||||
wc.hIcon = NULL;
|
||||
wc.hCursor = NULL;
|
||||
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
|
||||
wc.lpszMenuName = NULL;
|
||||
wc.lpszClassName = szNekoClassName;
|
||||
|
||||
if( RegisterClass(&wc) )
|
||||
{
|
||||
//create the window
|
||||
g_hWndMain = CreateWindow( szNekoClassName, szNekoWindowTitle, WS_OVERLAPPEDWINDOW, 0, 0, 0, 0, NULL, NULL, hInstance, NULL);
|
||||
|
||||
if( g_hWndMain == NULL ) return FALSE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
|
||||
//initialise random number generator
|
||||
srand( GetTickCount() );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/* WinMain - program entry point *******************************************************/
|
||||
int CALLBACK WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow )
|
||||
{
|
||||
//check for previous version & unload both if it's found
|
||||
HWND hWndOld = FindWindow( szNekoClassName, szNekoWindowTitle );
|
||||
if( hWndOld != NULL )
|
||||
{
|
||||
PostMessage( hWndOld, WM_QUIT, 0, 0 );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//initialise the program
|
||||
if( !InitApplication( hInstance ) ) return FALSE;
|
||||
|
||||
//create the tray object
|
||||
Tray = new CTray( hInstance );
|
||||
|
||||
//set a timer to update Neko
|
||||
SetTimer( g_hWndMain, ID_TIMER_NEKO, 200, NULL );
|
||||
|
||||
MSG msg;
|
||||
while( GetMessage( &msg, NULL, 0, 0 ) )
|
||||
{
|
||||
//pass the message onto our WndProc
|
||||
TranslateMessage( &msg );
|
||||
DispatchMessage( &msg );
|
||||
}
|
||||
|
||||
//remove the timer
|
||||
KillTimer( g_hWndMain, ID_TIMER_NEKO );
|
||||
|
||||
//delete all Nekos
|
||||
for( int i = 0; i < g_nNumCats; i++ ) delete g_NekoArray[i];
|
||||
delete[] g_NekoArray;
|
||||
|
||||
//remove the taskbar icon
|
||||
if( g_fTaskbar ) Tray->RemoveIcon( g_hWndMain, 1 );
|
||||
delete Tray;
|
||||
|
||||
return msg.wParam;
|
||||
}
|
||||
323
nkosrc4/Neko98/Neko98.dsp
Executable file
@@ -0,0 +1,323 @@
|
||||
# Microsoft Developer Studio Project File - Name="Neko98" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
CFG=Neko98 - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Neko98.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Neko98.mak" CFG="Neko98 - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "Neko98 - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "Neko98 - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "Neko98 - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /Ob2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD BASE RSC /l 0x809 /d "NDEBUG"
|
||||
# ADD RSC /l 0x809 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:windows /machine:I386
|
||||
|
||||
!ELSEIF "$(CFG)" == "Neko98 - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD BASE RSC /l 0x809 /d "_DEBUG"
|
||||
# ADD RSC /l 0x809 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "Neko98 - Win32 Release"
|
||||
# Name "Neko98 - Win32 Debug"
|
||||
# Begin Group "Resources"
|
||||
|
||||
# PROP Default_Filter ".ico;.bmp;.rc"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\Awake.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\Down1.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\down2.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\downclaw1.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\downclaw2.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\downleft1.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\Downleft2.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\Downright1.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\downright2.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\fp_down.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\fp_downleft.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\fp_downright.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\fp_left.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\fp_right.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\fp_up.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\fp_upleft.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\fp_upright.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\left1.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\left2.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\leftclaw1.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\leftclaw2.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Neko95.rc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\Right1.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\right2.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\rightclaw1.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\Rightclaw2.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\scratch1.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\scratch2.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\sleep1.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\sleep2.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\Up1.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\Up2.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\upclaw1.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\upclaw2.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\Upleft1.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\Upleft2.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\Upright1.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\Upright2.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\wash2.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\yawn2.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\yawn3.ico
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\AlwaysOnTopPet.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\AlwaysOnTopPet.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\DesktopHack.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\DesktopHack.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\DesktopPet.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\DesktopPet.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Neko.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Neko.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Neko98.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\NekoCommon.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\NekoSettings.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\NekoSettings.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Pet.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Pet.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Tray.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Tray.h
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
41
nkosrc4/Neko98/Neko98.dsw
Executable file
@@ -0,0 +1,41 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "Neko98"=".\Neko98.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "NekoCFG"=".\NekoCFG\NekoCFG.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
657
nkosrc4/Neko98/NekoCFG/NekoCFG.cpp
Executable file
@@ -0,0 +1,657 @@
|
||||
/****************
|
||||
NekoCFG
|
||||
|
||||
Configuration
|
||||
program for
|
||||
Neko95 v4.0
|
||||
|
||||
*****************/
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <commctrl.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "NekoCFG.h"
|
||||
#include "..\NekoCommon.h"
|
||||
#include "..\NekoSettings.h"
|
||||
#include "NekoCFG_resource.h"
|
||||
#include "NekoCFG_resource.hm"
|
||||
|
||||
/*************************************************************************************************/
|
||||
|
||||
const char* szWindowTitle = "Configure Neko";
|
||||
const char* szDefaultName = "Neko (default)";
|
||||
const char* szHelpFile = "Neko98.hlp";
|
||||
|
||||
/* help ID lookup table */
|
||||
static DWORD dwHelpID[] = {
|
||||
IDC_NAME, HIDC_NAME,
|
||||
IDC_NEW, HIDC_NEW,
|
||||
IDC_DELETE, HIDC_DELETE,
|
||||
IDC_TASKBAR, HIDC_TASKBAR,
|
||||
IDC_ABOUT, HIDC_ABOUT,
|
||||
IDOK, HIDOK,
|
||||
IDCANCEL, HIDCANCEL,
|
||||
IDC_APPLY, HIDC_APPLY,
|
||||
IDC_HELP, HIDC_HELP,
|
||||
IDC_TABS, HIDC_TABS,
|
||||
0,0
|
||||
};
|
||||
|
||||
//global variables
|
||||
HINSTANCE g_hInstance = NULL;
|
||||
HWND g_hWndNeko = NULL;
|
||||
|
||||
|
||||
//global settings
|
||||
BOOL g_fShowTaskbar = TRUE;
|
||||
|
||||
//list of all cats
|
||||
LPCATSETTINGS catSettings = NULL;
|
||||
|
||||
//function forward declaration
|
||||
void WINAPI WriteSettings();
|
||||
|
||||
/*************************************************************************************************/
|
||||
|
||||
/* DeleteCatSettings - removes the given cat from the list */
|
||||
BOOL WINAPI DeleteCatSettings( LPCATSETTINGS cat )
|
||||
{
|
||||
cat->fDeleted = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* DlgProc_NewNeko - dialog box procedure to add a neko */
|
||||
BOOL CALLBACK DlgProc_NewNeko( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
switch( uMsg )
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
//make sure the user isn't adding *too* many Nekos!
|
||||
LPCATSETTINGS cat = catSettings;
|
||||
int nCats = 0;
|
||||
while( cat )
|
||||
{
|
||||
if( cat->fDeleted == FALSE ) nCats++;
|
||||
cat = cat->next;
|
||||
}
|
||||
|
||||
if( nCats > 5 )
|
||||
{
|
||||
char szBuffer[128];
|
||||
sprintf( szBuffer, "You already have %d Nekos!\nAdding more is likely to slow down your computer - do you want to add one anyway?", nCats );
|
||||
if( IDNO == MessageBox( hDlg, szBuffer, "Add Neko", MB_YESNO|MB_ICONQUESTION ) )
|
||||
{
|
||||
EndDialog( hDlg, FALSE );
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
//initialise the text box
|
||||
SendDlgItemMessage( hDlg, IDC_NEWNEKONAME, CB_LIMITTEXT, IDC_NEWNEKONAME-2, 0 );
|
||||
|
||||
//add some demo items
|
||||
SendDlgItemMessage( hDlg, IDC_NEWNEKONAME, CB_ADDSTRING, 0, (LPARAM)"Arthur" );
|
||||
SendDlgItemMessage( hDlg, IDC_NEWNEKONAME, CB_ADDSTRING, 0, (LPARAM)"Boris" );
|
||||
SendDlgItemMessage( hDlg, IDC_NEWNEKONAME, CB_ADDSTRING, 0, (LPARAM)"Kitty" );
|
||||
SendDlgItemMessage( hDlg, IDC_NEWNEKONAME, CB_ADDSTRING, 0, (LPARAM)"Lucy" );
|
||||
SendDlgItemMessage( hDlg, IDC_NEWNEKONAME, CB_ADDSTRING, 0, (LPARAM)"Garfield" );
|
||||
SendDlgItemMessage( hDlg, IDC_NEWNEKONAME, CB_ADDSTRING, 0, (LPARAM)"Tom" );
|
||||
SendDlgItemMessage( hDlg, IDC_NEWNEKONAME, CB_ADDSTRING, 0, (LPARAM)"Bast" );
|
||||
SendDlgItemMessage( hDlg, IDC_NEWNEKONAME, CB_ADDSTRING, 0, (LPARAM)"Ginger" );
|
||||
SendDlgItemMessage( hDlg, IDC_NEWNEKONAME, CB_ADDSTRING, 0, (LPARAM)"Bob" );
|
||||
SendDlgItemMessage( hDlg, IDC_NEWNEKONAME, CB_ADDSTRING, 0, (LPARAM)"Tabs" );
|
||||
SendDlgItemMessage( hDlg, IDC_NEWNEKONAME, CB_ADDSTRING, 0, (LPARAM)"Tigger" );
|
||||
SendDlgItemMessage( hDlg, IDC_NEWNEKONAME, CB_ADDSTRING, 0, (LPARAM)"James" );
|
||||
SendDlgItemMessage( hDlg, IDC_NEWNEKONAME, CB_ADDSTRING, 0, (LPARAM)"Cooper" );
|
||||
SendDlgItemMessage( hDlg, IDC_NEWNEKONAME, CB_ADDSTRING, 0, (LPARAM)"Hey You" );
|
||||
SendDlgItemMessage( hDlg, IDC_NEWNEKONAME, CB_ADDSTRING, 0, (LPARAM)"Greebo" );
|
||||
SendDlgItemMessage( hDlg, IDC_NEWNEKONAME, CB_ADDSTRING, 0, (LPARAM)"Furball" );
|
||||
SendDlgItemMessage( hDlg, IDC_NEWNEKONAME, CB_ADDSTRING, 0, (LPARAM)"Sylvester" );
|
||||
SendDlgItemMessage( hDlg, IDC_NEWNEKONAME, CB_ADDSTRING, 0, (LPARAM)"Buffy" );
|
||||
SendDlgItemMessage( hDlg, IDC_NEWNEKONAME, CB_ADDSTRING, 0, (LPARAM)"Willow" );
|
||||
SendDlgItemMessage( hDlg, IDC_NEWNEKONAME, CB_ADDSTRING, 0, (LPARAM)"Sarah" );
|
||||
//SendDlgItemMessage( hDlg, IDC_NEWNEKONAME, CB_ADDSTRING, 0, (LPARAM)"Vicious Bastard" );
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_COMMAND:
|
||||
switch( LOWORD(wParam) )
|
||||
{
|
||||
case IDOK:
|
||||
{
|
||||
char szName[MAX_NEKO_NAME];
|
||||
GetDlgItemText( hDlg, IDC_NEWNEKONAME, szName, MAX_NEKO_NAME );
|
||||
char* lpszPtr = szName;
|
||||
|
||||
//make sure it's not empty
|
||||
if( strlen( szName ) == 0 )
|
||||
{
|
||||
MessageBox( hDlg, "Invalid Name: You must type a name", "New Neko", MB_ICONINFORMATION );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//make sure it only has letters, numbers and spaces in
|
||||
while( lpszPtr && *lpszPtr != '\0' )
|
||||
{
|
||||
if( !( isalpha(*lpszPtr) || isdigit(*lpszPtr) || *lpszPtr == ' ' ) )
|
||||
{
|
||||
MessageBox( hDlg, "Invalid Name: Sorry - a name can only contain letters, numbers and spaces", "Add Neko", MB_ICONINFORMATION );
|
||||
return TRUE;
|
||||
}
|
||||
lpszPtr++;
|
||||
}
|
||||
|
||||
//make sure it's unique
|
||||
LPCATSETTINGS cat = catSettings;
|
||||
while( cat )
|
||||
{
|
||||
if( !cat->fDeleted && (stricmp( cat->szName, szName ) == 0 || stricmp( cat->szName, szDefaultName ) == 0 ))
|
||||
{
|
||||
MessageBox( hDlg, "Invalid Name: This neko already exists!", "New Neko", MB_ICONINFORMATION );
|
||||
return TRUE;
|
||||
}
|
||||
cat = cat->next;
|
||||
}
|
||||
|
||||
|
||||
//create a new neko
|
||||
cat = new CATSETTINGS;
|
||||
strcpy( cat->szName, szName );
|
||||
|
||||
//set defaults
|
||||
strcpy( cat->szLibrary, "" );
|
||||
cat->uScale = 100;
|
||||
cat->uSpeed = 16;
|
||||
cat->uMouseSensitivity = 6;
|
||||
strcpy( cat->szSndIdle1, "" );
|
||||
strcpy( cat->szSndIdle2, "" );
|
||||
strcpy( cat->szSndIdle3, "" );
|
||||
strcpy( cat->szSndSleep, "" );
|
||||
strcpy( cat->szSndAwake, "" );
|
||||
cat->uSndFrequency = 0;
|
||||
cat->uAction = CHASE_MOUSE;
|
||||
cat->fAlwaysOnTop = FALSE;
|
||||
cat->bFootprints = FALSE;
|
||||
*cat->szFootprintLib = '\0';
|
||||
|
||||
//link it in
|
||||
cat->fDeleted = FALSE;
|
||||
cat->next = catSettings;
|
||||
catSettings = cat;
|
||||
|
||||
//add it to the list box & select it
|
||||
int i = SendDlgItemMessage( GetParent(hDlg), IDC_NAME, LB_ADDSTRING, 0, (LPARAM)szName );
|
||||
SendDlgItemMessage( GetParent(hDlg), IDC_NAME, LB_SETCURSEL, i, 0 );
|
||||
PostMessage( GetParent(hDlg), WM_COMMAND, MAKEWPARAM(IDC_NAME, CBN_SELCHANGE), 0 );
|
||||
|
||||
//close the dialog
|
||||
EndDialog( hDlg, TRUE );
|
||||
break;
|
||||
}
|
||||
|
||||
case IDCANCEL:
|
||||
EndDialog( hDlg, FALSE );
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* DlgProc_About - dialog box procedure for about dialog */
|
||||
BOOL CALLBACK DlgProc_About( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
if( ( uMsg == WM_CLOSE ) || ( uMsg == WM_COMMAND && LOWORD(wParam)==IDOK ) ) EndDialog( hDlg, TRUE ); else return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* DlgProc_Config - dialog box procedure for configuration dialog */
|
||||
BOOL CALLBACK DlgProc_Config( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
switch( uMsg )
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
SendDlgItemMessage( hDlg, IDC_TASKBAR, BM_SETCHECK, g_fShowTaskbar, 0 );
|
||||
|
||||
LPCATSETTINGS cat = catSettings;
|
||||
while( cat )
|
||||
{
|
||||
if( !cat->fDeleted ) SendDlgItemMessage( hDlg, IDC_NAME, LB_ADDSTRING, 0, ( strcmp( cat->szName, "" ) == 0 ) ? (LPARAM)szDefaultName : (LPARAM)cat->szName );
|
||||
cat = cat->next;
|
||||
}
|
||||
SendDlgItemMessage( hDlg, IDC_NAME, LB_SELECTSTRING, 0, (LPARAM)szDefaultName );
|
||||
EnableWindow( GetDlgItem( hDlg, IDC_DELETE ), FALSE );
|
||||
EnableWindow( GetDlgItem( hDlg, IDC_APPLY ), (g_hWndNeko != NULL ) ? TRUE : FALSE );
|
||||
|
||||
InitialisePropertyDialog( GetDlgItem( hDlg, IDC_TABS ) );
|
||||
SendMessage( hDlg, WM_COMMAND, MAKEWPARAM(IDC_NAME, LBN_SELCHANGE), 0 );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
case WM_DESTROY:
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
switch( LOWORD(wParam) )
|
||||
{
|
||||
case IDOK:
|
||||
SetCursor( LoadCursor( NULL, IDC_WAIT ) );
|
||||
g_fShowTaskbar = ( IsDlgButtonChecked( hDlg, IDC_TASKBAR ) == BST_CHECKED );
|
||||
WriteSettings();
|
||||
if( IsWindow( g_hWndNeko ) == FALSE ) g_hWndNeko = FindWindow( szNekoClassName, szNekoWindowTitle );
|
||||
SendMessage( g_hWndNeko, MY_UPDATENEKO, 0, 0 );
|
||||
SetCursor( LoadCursor( NULL, IDC_ARROW ) );
|
||||
EndDialog( hDlg, TRUE );
|
||||
break;
|
||||
|
||||
case IDCANCEL:
|
||||
EndDialog( hDlg, FALSE ); break;
|
||||
|
||||
case IDC_APPLY:
|
||||
SetCursor( LoadCursor( NULL, IDC_WAIT ) );
|
||||
g_fShowTaskbar = ( IsDlgButtonChecked( hDlg, IDC_TASKBAR ) == BST_CHECKED );
|
||||
WriteSettings();
|
||||
if( IsWindow( g_hWndNeko ) == FALSE ) g_hWndNeko = FindWindow( szNekoClassName, szNekoWindowTitle );
|
||||
SendMessage( g_hWndNeko, MY_UPDATENEKO, 0, 0 );
|
||||
SetCursor( LoadCursor( NULL, IDC_ARROW ) );
|
||||
break;
|
||||
|
||||
case IDC_ABOUT:
|
||||
DialogBox( g_hInstance, MAKEINTRESOURCE(IDD_ABOUTBOX), hDlg, (DLGPROC)DlgProc_About );
|
||||
break;
|
||||
|
||||
case IDC_NEW:
|
||||
DialogBox( g_hInstance, MAKEINTRESOURCE(IDD_NEWNEKO), hDlg, (DLGPROC)DlgProc_NewNeko );
|
||||
break;
|
||||
|
||||
case IDC_DELETE:
|
||||
{
|
||||
int iItem = SendDlgItemMessage( hDlg, IDC_NAME, LB_GETCURSEL, 0, 0 );
|
||||
char szDoomed[MAX_NEKO_NAME] = "";
|
||||
|
||||
//get string
|
||||
SendDlgItemMessage( hDlg, IDC_NAME, LB_GETTEXT, iItem, (LPARAM)szDoomed );
|
||||
if( strcmp( szDoomed, szDefaultName ) == 0 ) strcpy( szDoomed, "" );
|
||||
|
||||
//find it in the settings list and continue
|
||||
LPCATSETTINGS cat = catSettings;
|
||||
while( cat )
|
||||
{
|
||||
if( !cat->fDeleted )
|
||||
if( strcmp( cat->szName, szDoomed ) == 0 ) break;
|
||||
|
||||
cat = cat->next;
|
||||
}
|
||||
|
||||
if( cat )
|
||||
{
|
||||
//remove it from the list box
|
||||
SendDlgItemMessage( hDlg, IDC_NAME, LB_DELETESTRING, iItem, 0 );
|
||||
|
||||
//select another item
|
||||
SendDlgItemMessage( hDlg, IDC_NAME, LB_SETCURSEL, (iItem ? iItem-1 : 0), 0 );
|
||||
SendMessage( hDlg, WM_COMMAND, MAKEWPARAM(IDC_NAME,LBN_SELCHANGE), 0 );
|
||||
|
||||
//remove it from memory
|
||||
if( DeleteCatSettings( cat ) == FALSE )
|
||||
MessageBox( hDlg, "Internal Error: Could not delete cat!", szWindowTitle, MB_ICONERROR );
|
||||
}
|
||||
else
|
||||
MessageBox( hDlg, "Internal Error: Dropped off the end of the cat list!", szWindowTitle, MB_ICONERROR );
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case IDC_HELP:
|
||||
WinHelp( hDlg, szHelpFile, HELP_FINDER, 0 );
|
||||
break;
|
||||
|
||||
case IDC_NAME:
|
||||
if( HIWORD(wParam) == LBN_SELCHANGE )
|
||||
{
|
||||
int iNew = SendDlgItemMessage( hDlg, IDC_NAME, LB_GETCURSEL, 0, 0 );
|
||||
char szNew[MAX_NEKO_NAME] = "";
|
||||
|
||||
//get string and enable delete if it's not the default item (first)
|
||||
SendDlgItemMessage( hDlg, IDC_NAME, LB_GETTEXT, iNew, (LPARAM)szNew );
|
||||
if( strcmp( szNew, szDefaultName ) == 0 )
|
||||
{
|
||||
strcpy( szNew, "" );
|
||||
EnableWindow( GetDlgItem( hDlg, IDC_DELETE ), FALSE );
|
||||
}
|
||||
else EnableWindow( GetDlgItem( hDlg, IDC_DELETE ), TRUE );
|
||||
|
||||
//the user has selected a different name - find it in the settings list and continue
|
||||
LPCATSETTINGS cat = catSettings;
|
||||
while( cat )
|
||||
{
|
||||
if( !cat->fDeleted )
|
||||
if( strcmp( cat->szName, szNew ) == 0 ) break;
|
||||
|
||||
cat = cat->next;
|
||||
}
|
||||
|
||||
if( cat )
|
||||
SetActiveCat( cat );
|
||||
else
|
||||
MessageBox( hDlg, "Internal Error: Dropped off the end of the cat list!", szWindowTitle, MB_ICONERROR );
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_NOTIFY:
|
||||
{
|
||||
LPNMHDR nmhdr = (LPNMHDR)lParam;
|
||||
switch( nmhdr->idFrom )
|
||||
{
|
||||
case IDC_TABS:
|
||||
if( nmhdr->code == TCN_SELCHANGE ) OnSelChanged( GetDlgItem( hDlg, IDC_TABS ) );
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
/* help stuff */
|
||||
case WM_HELP:
|
||||
if( ((LPHELPINFO)lParam)->iCtrlId != (-1) )
|
||||
WinHelp( (HWND)((LPHELPINFO)lParam)->hItemHandle, szHelpFile, HELP_WM_HELP, (DWORD)(LPSTR)dwHelpID );
|
||||
else
|
||||
return FALSE;
|
||||
break;
|
||||
|
||||
case WM_CONTEXTMENU:
|
||||
WinHelp( (HWND)wParam, szHelpFile, HELP_CONTEXTMENU, (DWORD)(LPVOID)dwHelpID );
|
||||
break;
|
||||
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*************************************************************************************************/
|
||||
|
||||
/* WriteCatSetting - write a cat from the registry with the given cat settings block */
|
||||
void WINAPI WriteCatSettings( LPCATSETTINGS cat, LPCSTR szName )
|
||||
{
|
||||
//see if this cat is flagged as deleted
|
||||
if( cat->fDeleted == TRUE )
|
||||
{
|
||||
//remove this item from the registry
|
||||
if( strlen( szName ) > 0 )
|
||||
{
|
||||
HKEY hKey;
|
||||
char szKeyName[MAX_PATH];
|
||||
strcpy( szKeyName, szNekoRegKey );
|
||||
if( RegOpenKeyEx( HKEY_CURRENT_USER, szKeyName, 0, KEY_WRITE, &hKey ) == ERROR_SUCCESS )
|
||||
{
|
||||
LONG l = RegDeleteKey( hKey, cat->szName );
|
||||
if( l != ERROR_SUCCESS )
|
||||
{
|
||||
/*
|
||||
LPVOID lpMsgBuf;
|
||||
|
||||
FormatMessage(
|
||||
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
|
||||
NULL,
|
||||
l,
|
||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
|
||||
(LPTSTR) &lpMsgBuf,
|
||||
0,
|
||||
NULL
|
||||
);
|
||||
// Display the string.
|
||||
MessageBox( NULL, (char*)lpMsgBuf, "Can't Delete Key", MB_OK|MB_ICONINFORMATION );
|
||||
|
||||
// Free the buffer.
|
||||
LocalFree( lpMsgBuf );
|
||||
*/
|
||||
|
||||
}
|
||||
RegCloseKey( hKey );
|
||||
}
|
||||
else
|
||||
MessageBox( NULL, "Internal Error: Couldn't open registry key!", 0, MB_TASKMODAL );
|
||||
}
|
||||
else
|
||||
MessageBox( NULL, "Internal Error: Tried to delete default Neko!", 0, MB_TASKMODAL );
|
||||
}
|
||||
else
|
||||
{
|
||||
//build & open key
|
||||
char szKey[1024];
|
||||
strcpy( szKey, szNekoRegKey );
|
||||
if( strlen( szName ) > 0 )
|
||||
{
|
||||
strcat( szKey, "\\" );
|
||||
strcat( szKey, szName );
|
||||
}
|
||||
|
||||
//write cat to the registry
|
||||
CNekoSettings NekoSettings( szKey );
|
||||
|
||||
//display
|
||||
NekoSettings.SetString( szNekoLibraryKey, cat->szLibrary );
|
||||
NekoSettings.SetInt( szNekoScaleKey, cat->uScale );
|
||||
NekoSettings.SetInt( szNekoOnTopKey, cat->fAlwaysOnTop );
|
||||
|
||||
//movement
|
||||
NekoSettings.SetInt( szNekoSpeedKey, cat->uSpeed );
|
||||
NekoSettings.SetInt( szNekoSenseKey, cat->uMouseSensitivity );
|
||||
|
||||
//sounds
|
||||
NekoSettings.SetString( szNekoSndIdle1Key, cat->szSndIdle1 );
|
||||
NekoSettings.SetString( szNekoSndIdle2Key, cat->szSndIdle2 );
|
||||
NekoSettings.SetString( szNekoSndIdle3Key, cat->szSndIdle3 );
|
||||
NekoSettings.SetString( szNekoSndSleepKey, cat->szSndSleep );
|
||||
NekoSettings.SetString( szNekoSndAwakeKey, cat->szSndAwake );
|
||||
NekoSettings.SetInt( szNekoSndFreqKey, cat->uSndFrequency );
|
||||
|
||||
//independence
|
||||
NekoSettings.SetInt( szNekoActionKey, cat->uAction );
|
||||
|
||||
//effects
|
||||
NekoSettings.SetBool( szNekoFootprintKey, cat->bFootprints );
|
||||
NekoSettings.SetString( szNekoFootprintLibKey, cat->szFootprintLib );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* WriteSettings - writes all of the settings to the registry */
|
||||
void WINAPI WriteSettings()
|
||||
{
|
||||
//tell all dialogs to write what they've got so far into the data structure
|
||||
GetDialogSettings();
|
||||
|
||||
//write global settings
|
||||
CNekoSettings NekoSettings( szNekoRegKey );
|
||||
NekoSettings.SetBool( szNekoTaskbarKey, g_fShowTaskbar );
|
||||
|
||||
int nNumCats = 0;
|
||||
LPCATSETTINGS cat = catSettings;
|
||||
while( cat )
|
||||
{
|
||||
//write this cat's settings
|
||||
WriteCatSettings( cat, cat->szName );
|
||||
|
||||
//unlink it if it's been deleted, or write out the name index key if not
|
||||
if( cat->fDeleted == FALSE )
|
||||
{
|
||||
//build the key index
|
||||
char szSubKey[MAX_PATH];
|
||||
sprintf( szSubKey, "%d", nNumCats );
|
||||
|
||||
//write this cat's name to the registry
|
||||
NekoSettings.SetString( szSubKey, cat->szName );
|
||||
|
||||
//advance the list
|
||||
nNumCats++;
|
||||
cat = cat->next;
|
||||
}
|
||||
else
|
||||
{
|
||||
cat = cat->next;
|
||||
}
|
||||
}
|
||||
|
||||
NekoSettings.SetInt( szNekoNumCatsKey, nNumCats );
|
||||
}
|
||||
|
||||
/* ReadCatSetting - loads a cat from the registry into the given cat settings block */
|
||||
void WINAPI ReadCatSettings( LPCATSETTINGS cat, LPCSTR szName )
|
||||
{
|
||||
strcpy( cat->szName, szName );
|
||||
|
||||
//set defaults
|
||||
strcpy( cat->szLibrary, "" );
|
||||
cat->uScale = 100;
|
||||
cat->uSpeed = 16;
|
||||
cat->uMouseSensitivity = 6;
|
||||
strcpy( cat->szSndIdle1, "" );
|
||||
strcpy( cat->szSndIdle2, "" );
|
||||
strcpy( cat->szSndIdle3, "" );
|
||||
strcpy( cat->szSndSleep, "" );
|
||||
strcpy( cat->szSndAwake, "" );
|
||||
cat->uSndFrequency = 0;
|
||||
cat->uAction = CHASE_MOUSE;
|
||||
cat->fDeleted = FALSE;
|
||||
cat->fAlwaysOnTop = FALSE;
|
||||
cat->bFootprints = FALSE;
|
||||
*cat->szFootprintLib = '\0';
|
||||
|
||||
//build & open key
|
||||
char szKey[1024];
|
||||
strcpy( szKey, szNekoRegKey );
|
||||
if( strlen( szName ) > 0 )
|
||||
{
|
||||
strcat( szKey, "\\" );
|
||||
strcat( szKey, szName );
|
||||
}
|
||||
|
||||
CNekoSettings NekoSettings( szKey );
|
||||
|
||||
//display
|
||||
NekoSettings.GetString( szNekoLibraryKey, cat->szLibrary, MAX_PATH-1 );
|
||||
NekoSettings.GetInt( szNekoScaleKey, &cat->uScale );
|
||||
DWORD fAlwaysOnTop = cat->fAlwaysOnTop;
|
||||
NekoSettings.GetInt( szNekoOnTopKey, &fAlwaysOnTop );
|
||||
cat->fAlwaysOnTop = fAlwaysOnTop;
|
||||
|
||||
//movement
|
||||
NekoSettings.GetInt( szNekoSpeedKey, &cat->uSpeed );
|
||||
NekoSettings.GetInt( szNekoSenseKey, &cat->uMouseSensitivity );
|
||||
|
||||
//sounds
|
||||
NekoSettings.GetString( szNekoSndIdle1Key, cat->szSndIdle1, MAX_PATH-1 );
|
||||
NekoSettings.GetString( szNekoSndIdle2Key, cat->szSndIdle2, MAX_PATH-1 );
|
||||
NekoSettings.GetString( szNekoSndIdle3Key, cat->szSndIdle3, MAX_PATH-1 );
|
||||
NekoSettings.GetString( szNekoSndSleepKey, cat->szSndSleep, MAX_PATH-1 );
|
||||
NekoSettings.GetString( szNekoSndAwakeKey, cat->szSndAwake, MAX_PATH-1 );
|
||||
NekoSettings.GetInt( szNekoSndFreqKey, &cat->uSndFrequency );
|
||||
|
||||
//independence
|
||||
NekoSettings.GetInt( szNekoActionKey, &cat->uAction );
|
||||
|
||||
NekoSettings.GetBool( szNekoFootprintKey, &cat->bFootprints );
|
||||
NekoSettings.GetString( szNekoFootprintLibKey, cat->szFootprintLib, MAX_PATH-1 );
|
||||
}
|
||||
|
||||
/* ReadSettings - reads all of the settings from the registry and creates the global settings array */
|
||||
void WINAPI ReadSettings()
|
||||
{
|
||||
LPCATSETTINGS cat;
|
||||
|
||||
CNekoSettings * NekoSettings = new CNekoSettings( szNekoRegKey );
|
||||
NekoSettings->GetBool( szNekoTaskbarKey, &g_fShowTaskbar );
|
||||
|
||||
//load in new cats list
|
||||
DWORD nNumCats = 0;
|
||||
NekoSettings->GetInt( szNekoNumCatsKey, &nNumCats );
|
||||
|
||||
if( nNumCats == 0 )
|
||||
{
|
||||
//the user hasn't run the config program, or there are no Nekos - use default
|
||||
cat = new CATSETTINGS;
|
||||
cat->next = NULL;
|
||||
ReadCatSettings( cat, "" );
|
||||
|
||||
catSettings = cat;
|
||||
}
|
||||
else
|
||||
{
|
||||
for( DWORD i = 0; i < nNumCats; i++ )
|
||||
{
|
||||
//build the key index
|
||||
char szSubKey[MAX_PATH], szName[MAX_NEKO_NAME];
|
||||
sprintf( szSubKey, "%d", i );
|
||||
|
||||
//load this cat's name from the registry
|
||||
NekoSettings->GetString( szSubKey, szName, MAX_NEKO_NAME-1 );
|
||||
|
||||
//create a new setting for it and put the object into the list
|
||||
cat = new CATSETTINGS;
|
||||
cat->next = catSettings;
|
||||
ReadCatSettings( cat, szName );
|
||||
catSettings = cat;
|
||||
}
|
||||
}
|
||||
|
||||
delete NekoSettings;
|
||||
}
|
||||
|
||||
/* DeleteConfigList - deletes the list of settings from memory */
|
||||
void WINAPI DeleteConfigList()
|
||||
{
|
||||
LPCATSETTINGS cat = catSettings;
|
||||
while( catSettings )
|
||||
{
|
||||
cat = catSettings;
|
||||
catSettings = catSettings->next;
|
||||
delete cat;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* FindAndActivateOldInstance - activates the old instance of the configuration program
|
||||
if it has been loaded twice */
|
||||
BOOL FindAndActivateOldInstance()
|
||||
{
|
||||
HWND hWnd = FindWindow( NULL, szWindowTitle );
|
||||
if( hWnd )
|
||||
{
|
||||
OpenIcon(hWnd);
|
||||
SetForegroundWindow(hWnd);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* WinMain - main program start point */
|
||||
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow )
|
||||
{
|
||||
//see if the configuration program is loaded already
|
||||
if( FindAndActivateOldInstance() ) return 0;
|
||||
|
||||
//ensure the common control library is loaded
|
||||
InitCommonControls();
|
||||
|
||||
//store the instance handle and find the Neko window
|
||||
g_hInstance = hInstance;
|
||||
g_hWndNeko = FindWindow( szNekoClassName, szNekoWindowTitle );
|
||||
|
||||
//initialise program and display dialog
|
||||
ReadSettings();
|
||||
DialogBox( g_hInstance, MAKEINTRESOURCE(IDD_CONFIG), NULL, (DLGPROC)DlgProc_Config );
|
||||
DeleteConfigList();
|
||||
ShutdownPropertyDialog();
|
||||
return 0;
|
||||
}
|
||||
175
nkosrc4/Neko98/NekoCFG/NekoCFG.dsp
Executable file
@@ -0,0 +1,175 @@
|
||||
# Microsoft Developer Studio Project File - Name="NekoCFG" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
CFG=NekoCFG - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "NekoCFG.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "NekoCFG.mak" CFG="NekoCFG - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "NekoCFG - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "NekoCFG - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "NekoCFG - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD BASE RSC /l 0x809 /d "NDEBUG"
|
||||
# ADD RSC /l 0x809 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib winmm.lib /nologo /subsystem:windows /machine:I386
|
||||
|
||||
!ELSEIF "$(CFG)" == "NekoCFG - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD BASE RSC /l 0x809 /d "_DEBUG"
|
||||
# ADD RSC /l 0x809 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "NekoCFG - Win32 Release"
|
||||
# Name "NekoCFG - Win32 Debug"
|
||||
# Begin Group "Resource"
|
||||
|
||||
# PROP Default_Filter ".ico;.bmp;.rc;.cur"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\AppIcon.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Res\Awake.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\displayi.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\independence.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\movement.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\play.bmp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\playing.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\sounds.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Res\tab_effects.ico
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Help"
|
||||
|
||||
# PROP Default_Filter ".hpj;.rtf"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\NekoHelp\Neko98.HPJ
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\NekoHelp\Neko98.RTF
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\NekoCFG.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\NekoCFG.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\NekoCFG.rc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\NekoCFG_resource.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\NekoCFG_Tabs.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\NekoCommon.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\NekoSettings.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\NekoSettings.h
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
69
nkosrc4/Neko98/NekoCFG/NekoCFG.h
Executable file
@@ -0,0 +1,69 @@
|
||||
#ifndef _NEKOCFG_H
|
||||
#define _NEKOCFG_H
|
||||
|
||||
#include "..\NekoCommon.h"
|
||||
|
||||
//structures
|
||||
typedef struct tagTABINITDATA {
|
||||
char* szTitle;
|
||||
UINT uIDDialog;
|
||||
DLGPROC lpfnDlgProc;
|
||||
UINT uIDIcon;
|
||||
HWND hDlg;
|
||||
} TABINITDATA, *LPTABINITDATA;
|
||||
|
||||
typedef struct tagCATSETTINGS {
|
||||
char szName[MAX_NEKO_NAME];
|
||||
|
||||
//display
|
||||
char szLibrary[MAX_PATH];
|
||||
DWORD uScale;
|
||||
BOOL fAlwaysOnTop;
|
||||
|
||||
//movement
|
||||
DWORD uSpeed;
|
||||
DWORD uMouseSensitivity;
|
||||
|
||||
//sounds
|
||||
char szSndIdle1[MAX_PATH];
|
||||
char szSndIdle2[MAX_PATH];
|
||||
char szSndIdle3[MAX_PATH];
|
||||
char szSndSleep[MAX_PATH];
|
||||
char szSndAwake[MAX_PATH];
|
||||
DWORD uSndFrequency;
|
||||
|
||||
//independence
|
||||
DWORD uAction;
|
||||
|
||||
//effects
|
||||
BOOL bFootprints;
|
||||
char szFootprintLib[MAX_PATH];
|
||||
|
||||
//list items
|
||||
BOOL fDeleted;
|
||||
struct tagCATSETTINGS* next;
|
||||
|
||||
} CATSETTINGS, *LPCATSETTINGS;
|
||||
|
||||
//ranges for slider bars
|
||||
#define MIN_SPEED 2
|
||||
#define MAX_SPEED 48
|
||||
#define MIN_SENSE 1
|
||||
#define MAX_SENSE 64
|
||||
#define MIN_SNDFREQ 0
|
||||
#define MAX_SNDFREQ 100
|
||||
#define MIN_SCALE 10
|
||||
#define MAX_SCALE 400
|
||||
|
||||
//external functions
|
||||
extern void WINAPI InitialisePropertyDialog( HWND hWnd );
|
||||
extern void WINAPI ShutdownPropertyDialog();
|
||||
extern void WINAPI OnSelChanged( HWND hWnd );
|
||||
extern void WINAPI SetActiveCat( LPCATSETTINGS lpCat );
|
||||
extern void WINAPI GetDialogSettings();
|
||||
|
||||
//external variables
|
||||
extern HINSTANCE g_hInstance;
|
||||
extern const char* szHelpFile;
|
||||
|
||||
#endif //_NEKOCFG_H
|
||||
373
nkosrc4/Neko98/NekoCFG/NekoCFG.rc
Executable file
@@ -0,0 +1,373 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "NekoCFG_resource.h"
|
||||
|
||||
// Generated Help ID header file
|
||||
#define APSTUDIO_HIDDEN_SYMBOLS
|
||||
#include "NekoCFG_resource.hm"
|
||||
#undef APSTUDIO_HIDDEN_SYMBOLS
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.K.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDI_APPICON ICON DISCARDABLE "res\\appicon.ico"
|
||||
IDI_DEFAULT ICON DISCARDABLE "..\\res\\Awake.ico"
|
||||
IDI_TAB_SOUNDS ICON DISCARDABLE "Res\\sounds.ico"
|
||||
IDI_TAB_MOVEMENT ICON DISCARDABLE "Res\\movement.ico"
|
||||
IDI_TAB_DISPLAY ICON DISCARDABLE "Res\\displayi.ico"
|
||||
IDI_TAB_INDEPENDENCE ICON DISCARDABLE "res\\independence.ico"
|
||||
IDI_TAB_EFFECTS ICON DISCARDABLE "res\\tab_effects.ico"
|
||||
|
||||
#ifndef _MAC
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,0,1
|
||||
PRODUCTVERSION 1,0,0,1
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x40004L
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "000004b0"
|
||||
BEGIN
|
||||
VALUE "Comments", "\0"
|
||||
VALUE "CompanyName", "DHSoft\0"
|
||||
VALUE "FileDescription", "NekoCFG\0"
|
||||
VALUE "FileVersion", "4.0g\0"
|
||||
VALUE "InternalName", "NekoCFG\0"
|
||||
VALUE "LegalCopyright", "Copyright <20> 1998\0"
|
||||
VALUE "LegalTrademarks", "\0"
|
||||
VALUE "OriginalFilename", "NekoCFG.exe\0"
|
||||
VALUE "PrivateBuild", "\0"
|
||||
VALUE "ProductName", "Neko Configuration Program\0"
|
||||
VALUE "ProductVersion", "4.0g\0"
|
||||
VALUE "SpecialBuild", "\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x0, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#endif // !_MAC
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_CONFIG DIALOGEX 0, 0, 312, 210
|
||||
STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | DS_CONTEXTHELP |
|
||||
WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
EXSTYLE WS_EX_CONTROLPARENT
|
||||
CAPTION "Configure Neko"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "Na&me:",IDC_STATIC,7,7,22,8
|
||||
PUSHBUTTON "&Add A New Neko...",IDC_NEW,13,108,75,14,0,0,HIDC_NEW
|
||||
PUSHBUTTON "&Delete",IDC_DELETE,93,108,41,14,0,0,HIDC_DELETE
|
||||
GROUPBOX "&General",IDC_STATIC,5,140,125,40
|
||||
CONTROL "Show &icon in taskbar",IDC_TASKBAR,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,15,160,80,10,0,HIDC_TASKBAR
|
||||
PUSHBUTTON "Abo&ut...",IDC_ABOUT,7,189,50,14,0,0,HIDC_ABOUT
|
||||
CONTROL "Tab1",IDC_TABS,"SysTabControl32",TCS_MULTILINE |
|
||||
WS_TABSTOP,146,7,159,178,0,HIDC_TABS
|
||||
DEFPUSHBUTTON "OK",IDOK,145,189,50,14,0,0,HIDOK
|
||||
PUSHBUTTON "Cancel",IDCANCEL,200,189,50,14,0,0,HIDCANCEL
|
||||
PUSHBUTTON "&Apply",IDC_APPLY,255,189,50,14,0,0,HIDC_APPLY
|
||||
PUSHBUTTON "&Help",IDC_HELP,62,189,50,14,0,0,HIDC_HELP
|
||||
LISTBOX IDC_NAME,7,18,127,85,LBS_SORT | LBS_NOINTEGRALHEIGHT |
|
||||
WS_VSCROLL | WS_TABSTOP,0,HIDC_NAME
|
||||
END
|
||||
|
||||
IDD_MOVEMENT DIALOGEX 0, 0, 155, 151
|
||||
STYLE DS_CONTROL | WS_CHILD
|
||||
FONT 8, "MS Sans Serif", 0, 0, 0x1
|
||||
BEGIN
|
||||
GROUPBOX "&Speed",IDC_STATIC,7,7,141,48
|
||||
CONTROL "Slow",IDC_STATIC,"Static",SS_SIMPLE | WS_GROUP,12,23,15,
|
||||
8
|
||||
CONTROL "Slider1",IDC_SPEEDSLIDER,"msctls_trackbar32",
|
||||
TBS_NOTICKS | WS_TABSTOP,12,34,130,17,0,HIDC_SPEEDSLIDER
|
||||
CONTROL "Fast",IDC_STATIC,"Static",SS_SIMPLE | WS_GROUP,127,23,
|
||||
15,8
|
||||
GROUPBOX "&Mouse sensitivity",IDC_STATIC,7,65,141,45
|
||||
CONTROL "Low",IDC_STATIC,"Static",SS_SIMPLE | WS_GROUP,12,80,15,
|
||||
8
|
||||
CONTROL "Slider1",IDC_SENSESLIDER,"msctls_trackbar32",
|
||||
TBS_NOTICKS | WS_TABSTOP,12,90,130,17,0,HIDC_SENSESLIDER
|
||||
CONTROL "High",IDC_STATIC,"Static",SS_SIMPLE | WS_GROUP,127,80,
|
||||
15,8
|
||||
END
|
||||
|
||||
IDD_SOUND DIALOGEX 0, 0, 155, 151
|
||||
STYLE DS_CONTROL | WS_CHILD
|
||||
FONT 8, "MS Sans Serif", 0, 0, 0x1
|
||||
BEGIN
|
||||
GROUPBOX "&Frequency",IDC_STATIC,8,7,140,63
|
||||
LTEXT "None",IDC_STATIC,14,18,20,8
|
||||
CONTROL "Slider1",IDC_SOUNDFREQ,"msctls_trackbar32",TBS_NOTICKS |
|
||||
WS_TABSTOP,15,27,125,17,0,HIDC_SOUNDFREQ
|
||||
LTEXT "Always",IDC_STATIC,118,18,23,8
|
||||
LTEXT "&Event:",IDC_STATIC,10,77,22,8
|
||||
LISTBOX IDC_SOUNDSAVAIL,32,76,116,43,LBS_NOINTEGRALHEIGHT |
|
||||
WS_VSCROLL | WS_TABSTOP,0,HIDC_SOUNDSAVAIL
|
||||
LTEXT "Na&me:",IDC_STATIC,9,121,22,8
|
||||
EDITTEXT IDC_SOUNDNAME,35,121,113,12,ES_AUTOHSCROLL | ES_READONLY |
|
||||
NOT WS_BORDER,0,HIDC_SOUNDNAME
|
||||
PUSHBUTTON "",IDC_PREVIEW,10,134,15,14,BS_BITMAP,0,HIDC_PREVIEW
|
||||
PUSHBUTTON "&None",IDC_NONE,43,134,50,14,0,0,HIDC_NONE
|
||||
PUSHBUTTON "&Browse...",IDC_BROWSE,99,134,50,14,0,0,HIDC_BROWSE
|
||||
LTEXT "(Performance may be affected if this is much above 10%)",
|
||||
IDC_STATIC,15,47,130,20,0,WS_EX_TRANSPARENT
|
||||
LTEXT "Some",IDC_STATIC,66,18,20,8
|
||||
END
|
||||
|
||||
IDD_NEWNEKO DIALOG DISCARDABLE 0, 0, 213, 66
|
||||
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "New Neko"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
ICON IDI_DEFAULT,IDC_STATIC,7,9,20,20
|
||||
LTEXT "Enter the &name for your new Neko:",IDC_STATIC,38,7,111,
|
||||
8
|
||||
COMBOBOX IDC_NEWNEKONAME,38,16,168,78,CBS_DROPDOWN | CBS_SORT |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
DEFPUSHBUTTON "OK",IDOK,102,45,50,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,156,45,50,14
|
||||
END
|
||||
|
||||
IDD_ABOUTBOX DIALOGEX 0, 0, 182, 101
|
||||
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "About Neko"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK",IDOK,65,80,50,14
|
||||
ICON IDI_DEFAULT,IDC_STATIC,5,10,21,20
|
||||
LTEXT "This program is proud to be FREEWARE!",IDC_STATIC,25,60,
|
||||
131,8
|
||||
LTEXT "Neko for Windows v4.0g\nPorted by David Harvey from\nX-Windows source code by Masayuki Koba",
|
||||
IDC_STATIC,35,10,142,25,0,WS_EX_TRANSPARENT
|
||||
LTEXT "http://www.geocities.com/siliconvalley/haven/4173/",
|
||||
IDC_STATIC,5,40,170,8
|
||||
END
|
||||
|
||||
IDD_DISPLAY DIALOGEX 0, 0, 155, 151
|
||||
STYLE DS_CONTROL | WS_CHILD
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
GROUPBOX "&Size",IDC_STATIC,7,7,136,65
|
||||
LTEXT "Smaller",IDC_STATIC,12,20,24,8
|
||||
LTEXT "Larger",IDC_STATIC,122,20,21,8
|
||||
CONTROL "Slider1",IDC_SCALESLIDER,"msctls_trackbar32",
|
||||
TBS_NOTICKS | WS_TABSTOP,15,30,125,15,0,HIDC_SCALESLIDER
|
||||
LTEXT "Scale:",IDC_STATIC,36,55,21,8
|
||||
LTEXT "100%",IDC_SCALEDISPLAY,62,55,25,8,0,0,HIDC_SCALEDISPLAY
|
||||
PUSHBUTTON "Use &Default",IDC_SET100,92,52,50,14,0,0,HIDC_SET100
|
||||
GROUPBOX "&Image library",IDC_STATIC,7,76,136,54
|
||||
LTEXT "&File name:",IDC_STATIC,15,88,33,8
|
||||
EDITTEXT IDC_IMAGELIB,15,98,125,12,ES_AUTOHSCROLL | ES_READONLY |
|
||||
NOT WS_BORDER,0,HIDC_IMAGELIB
|
||||
PUSHBUTTON "&Change...",IDC_CHANGE,36,112,50,15,0,0,HIDC_CHANGE
|
||||
PUSHBUTTON "&Use Default",IDC_DEFAULT,92,112,50,15,0,0,HIDC_DEFAULT
|
||||
CONTROL "Alwa&ys On Top",IDC_ALWAYSONTOP,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,7,134,64,10,0,
|
||||
HIDC_ALWAYSONTOP
|
||||
END
|
||||
|
||||
IDD_INDEPENDENCE DIALOGEX 0, 0, 155, 149
|
||||
STYLE DS_CONTROL | WS_CHILD
|
||||
FONT 8, "MS Sans Serif", 0, 0, 0x1
|
||||
BEGIN
|
||||
GROUPBOX "&Behaviour",IDC_STATIC,7,7,141,58
|
||||
LTEXT "&Action:",IDC_STATIC,15,23,23,8
|
||||
COMBOBOX IDC_ACTION,40,19,100,66,CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||
WS_TABSTOP,0,HIDC_ACTION
|
||||
LTEXT "(none)",IDC_ACTIONDESC,15,35,125,25,0,0,HIDC_ACTIONDESC
|
||||
END
|
||||
|
||||
IDD_EFFECTS DIALOGEX 0, 0, 155, 151
|
||||
STYLE DS_CONTROL | WS_CHILD
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
GROUPBOX "&Footprint Images",IDC_STATIC,7,7,141,74
|
||||
CONTROL "&Enable Footprints",IDC_FOOTPRINTS,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,14,18,71,10,0,
|
||||
HIDC_FOOTPRINTS
|
||||
LTEXT "&File name:",IDC_STATIC,14,33,33,8
|
||||
EDITTEXT IDC_IMAGELIB,14,43,125,12,ES_AUTOHSCROLL | ES_READONLY |
|
||||
NOT WS_BORDER,0,HIDC_IMAGELIB
|
||||
PUSHBUTTON "&Change...",IDC_CHANGE,35,59,50,15,0,0,HIDC_CHANGE
|
||||
PUSHBUTTON "&Use Default",IDC_DEFAULT,91,59,50,15,0,0,HIDC_DEFAULT
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
BEGIN
|
||||
IDD_CONFIG, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 305
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 203
|
||||
END
|
||||
|
||||
IDD_MOVEMENT, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 148
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 144
|
||||
END
|
||||
|
||||
IDD_SOUND, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 148
|
||||
VERTGUIDE, 10
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 149
|
||||
HORZGUIDE, 137
|
||||
END
|
||||
|
||||
IDD_NEWNEKO, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 206
|
||||
VERTGUIDE, 38
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 59
|
||||
HORZGUIDE, 29
|
||||
END
|
||||
|
||||
IDD_ABOUTBOX, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 175
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 94
|
||||
END
|
||||
|
||||
IDD_DISPLAY, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 148
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 144
|
||||
END
|
||||
|
||||
IDD_INDEPENDENCE, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 148
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 142
|
||||
END
|
||||
|
||||
IDD_EFFECTS, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 148
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 144
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"NekoCFG_resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Cursor
|
||||
//
|
||||
|
||||
IDC_PLAYING CURSOR DISCARDABLE "res\\playing.cur"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Bitmap
|
||||
//
|
||||
|
||||
IDR_PLAYBITMAP BITMAP DISCARDABLE "res\\play.bmp"
|
||||
#endif // English (U.K.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
607
nkosrc4/Neko98/NekoCFG/NekoCFG_Tabs.cpp
Executable file
@@ -0,0 +1,607 @@
|
||||
/* property sheet functions */
|
||||
#include <windows.h>
|
||||
#include <commctrl.h>
|
||||
#include <stdio.h>
|
||||
#include "NekoCFG.h"
|
||||
#include "..\NekoCommon.h"
|
||||
#include "NekoCFG_resource.h"
|
||||
#include "NekoCFG_resource.hm"
|
||||
|
||||
|
||||
/* help ID lookup table */
|
||||
static DWORD dwHelpID[] = {
|
||||
IDC_SCALESLIDER, HIDC_SCALESLIDER,
|
||||
IDC_SCALEDISPLAY, HIDC_SCALEDISPLAY,
|
||||
IDC_SET100, HIDC_SET100,
|
||||
IDC_IMAGELIB, HIDC_IMAGELIB,
|
||||
IDC_CHANGE, HIDC_CHANGE,
|
||||
IDC_DEFAULT, HIDC_DEFAULT,
|
||||
|
||||
IDC_SPEEDSLIDER, HIDC_SPEEDSLIDER,
|
||||
IDC_SENSESLIDER, HIDC_SENSESLIDER,
|
||||
|
||||
IDC_SOUNDFREQ, HIDC_SOUNDFREQ,
|
||||
IDC_SOUNDSAVAIL, HIDC_SOUNDSAVAIL,
|
||||
IDC_SOUNDNAME, HIDC_SOUNDNAME,
|
||||
IDC_PREVIEW, HIDC_PREVIEW,
|
||||
IDC_NONE, HIDC_NONE,
|
||||
IDC_BROWSE, HIDC_BROWSE,
|
||||
|
||||
IDC_ACTION, HIDC_ACTION,
|
||||
IDC_ACTIONDESC, HIDC_ACTIONDESC,
|
||||
|
||||
IDC_ALWAYSONTOP, HIDC_ALWAYSONTOP,
|
||||
IDC_FOOTPRINTS, HIDC_FOOTPRINTS,
|
||||
0,0
|
||||
};
|
||||
|
||||
|
||||
/**************************************************************************************/
|
||||
|
||||
//cat settings
|
||||
LPCATSETTINGS g_lpCurrentCat = NULL;
|
||||
#define MY_WRITESETTINGS (WM_USER+32)
|
||||
#define MY_READSETTINGS (WM_USER+33)
|
||||
|
||||
/**************************************************************************************/
|
||||
//tab control data
|
||||
|
||||
#define NUM_PAGES 5
|
||||
BOOL CALLBACK PropPage_Display( HWND hPage, UINT uMsg, WPARAM wParam, LPARAM lParam );
|
||||
BOOL CALLBACK PropPage_Movement( HWND hPage, UINT uMsg, WPARAM wParam, LPARAM lParam );
|
||||
BOOL CALLBACK PropPage_Sound( HWND hPage, UINT uMsg, WPARAM wParam, LPARAM lParam );
|
||||
BOOL CALLBACK PropPage_Independence( HWND hPage, UINT uMsg, WPARAM wParam, LPARAM lParam );
|
||||
BOOL CALLBACK PropPage_Effects( HWND hPage, UINT uMsg, WPARAM wParam, LPARAM lParam );
|
||||
TABINITDATA tibTabs[NUM_PAGES] = {
|
||||
{ "Display", IDD_DISPLAY, (DLGPROC)PropPage_Display, IDI_TAB_DISPLAY, NULL },
|
||||
{ "Movement", IDD_MOVEMENT, (DLGPROC)PropPage_Movement, IDI_TAB_MOVEMENT, NULL },
|
||||
{ "Sound", IDD_SOUND, (DLGPROC)PropPage_Sound, IDI_TAB_SOUNDS, NULL },
|
||||
{ "Independence", IDD_INDEPENDENCE, (DLGPROC)PropPage_Independence, IDI_TAB_INDEPENDENCE, NULL },
|
||||
{ "Effects", IDD_EFFECTS, (DLGPROC)PropPage_Effects, IDI_TAB_EFFECTS, NULL },
|
||||
};
|
||||
|
||||
HWND g_hDlgDisplay = NULL; //current child dialog
|
||||
HWND g_hWndTab = NULL; //tab control
|
||||
RECT g_rcTabStart; //offset in dialog to draw tab pages
|
||||
|
||||
HIMAGELIST g_himgTabIcons = NULL;
|
||||
|
||||
/**************************************************************************************/
|
||||
|
||||
|
||||
/* InitialisePropertyDialog - loads all of the property sheet pages into the property sheet control */
|
||||
void WINAPI InitialisePropertyDialog( HWND hWnd )
|
||||
{
|
||||
int i;
|
||||
|
||||
//create the image list
|
||||
g_himgTabIcons = ImageList_Create( 16, 16, ILC_COLOR4|ILC_MASK, NUM_PAGES, 0 );
|
||||
for( i = 0; i < NUM_PAGES; i++ )
|
||||
{
|
||||
HICON hIcon = (HICON)LoadImage( g_hInstance, MAKEINTRESOURCE(tibTabs[i].uIDIcon), IMAGE_ICON, 0, 0, LR_DEFAULTSIZE );
|
||||
tibTabs[i].uIDIcon = ImageList_AddIcon( g_himgTabIcons, hIcon );
|
||||
DestroyIcon( hIcon );
|
||||
}
|
||||
TabCtrl_SetImageList( hWnd, g_himgTabIcons );
|
||||
|
||||
|
||||
//insert tabs for each of the dialog items and create the (hidden) dialog
|
||||
TC_ITEM tie;
|
||||
tie.mask = TCIF_TEXT | TCIF_IMAGE;
|
||||
for( i = 0; i < NUM_PAGES; i++ )
|
||||
{
|
||||
tie.iImage = tibTabs[i].uIDIcon;
|
||||
tie.pszText = tibTabs[i].szTitle;
|
||||
TabCtrl_InsertItem( hWnd, i, &tie );
|
||||
|
||||
tibTabs[i].hDlg = CreateDialog( g_hInstance, MAKEINTRESOURCE(tibTabs[i].uIDDialog), GetParent(hWnd), tibTabs[i].lpfnDlgProc );
|
||||
}
|
||||
|
||||
//calculate where to stick each dialog
|
||||
GetWindowRect( hWnd, &g_rcTabStart );
|
||||
ScreenToClient( GetParent(hWnd), (LPPOINT)&g_rcTabStart.left );
|
||||
ScreenToClient( GetParent(hWnd), (LPPOINT)&g_rcTabStart.right );
|
||||
g_rcTabStart.top += 42;
|
||||
g_rcTabStart.left += 3;
|
||||
|
||||
//store the handle and show the first page
|
||||
g_hWndTab = hWnd;
|
||||
OnSelChanged( hWnd );
|
||||
}
|
||||
|
||||
/* ShutdownPropertyDialog - releases any resources owned by the propery sheet */
|
||||
void WINAPI ShutdownPropertyDialog()
|
||||
{
|
||||
ImageList_Destroy( g_himgTabIcons );
|
||||
}
|
||||
|
||||
/* OnTabSelection - updates the tabs when one is selected */
|
||||
void WINAPI OnSelChanged( HWND hWnd )
|
||||
{
|
||||
int iSel = TabCtrl_GetCurSel( hWnd );
|
||||
|
||||
//destroy the current child dialog box, if any.
|
||||
if( g_hDlgDisplay != NULL) ShowWindow( g_hDlgDisplay, SW_HIDE );
|
||||
|
||||
//create the new child dialog box.
|
||||
g_hDlgDisplay = tibTabs[iSel].hDlg;
|
||||
ShowWindow( g_hDlgDisplay, SW_SHOW );
|
||||
|
||||
}
|
||||
|
||||
/* SetActiveCat - selects which cat to configure */
|
||||
void WINAPI SetActiveCat( LPCATSETTINGS lpCat )
|
||||
{
|
||||
GetDialogSettings();
|
||||
g_lpCurrentCat = lpCat;
|
||||
for( int i = 0; i < NUM_PAGES; i++ ) SendMessage( tibTabs[i].hDlg, MY_READSETTINGS, 0, 0 );
|
||||
}
|
||||
|
||||
/* GetDialogSettings - causes all property pages to write their settings into the data structure */
|
||||
void WINAPI GetDialogSettings()
|
||||
{
|
||||
if( g_lpCurrentCat )
|
||||
for( int i = 0; i < NUM_PAGES; i++ ) SendMessage( tibTabs[i].hDlg, MY_WRITESETTINGS, 0, 0 );
|
||||
}
|
||||
|
||||
/**************************************************************************************/
|
||||
|
||||
/* PropPage_Display - message processsing function for the 'display' property page */
|
||||
BOOL CALLBACK PropPage_Display( HWND hPage, UINT uMsg, WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
switch( uMsg )
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
SendDlgItemMessage( hPage, IDC_SCALESLIDER, TBM_SETRANGE, FALSE, MAKELPARAM(MIN_SCALE/10,MAX_SCALE/10) );
|
||||
break;
|
||||
|
||||
case MY_WRITESETTINGS:
|
||||
g_lpCurrentCat->uScale = SendDlgItemMessage( hPage, IDC_SCALESLIDER, TBM_GETPOS, 0, 0 ) * 10;
|
||||
GetDlgItemText( hPage, IDC_IMAGELIB, g_lpCurrentCat->szLibrary, MAX_PATH );
|
||||
g_lpCurrentCat->fAlwaysOnTop = IsDlgButtonChecked( hPage, IDC_ALWAYSONTOP );
|
||||
break;
|
||||
|
||||
case MY_READSETTINGS:
|
||||
SendDlgItemMessage( hPage, IDC_SCALESLIDER, TBM_SETPOS, TRUE, g_lpCurrentCat->uScale / 10 );
|
||||
SetDlgItemText( hPage, IDC_IMAGELIB, g_lpCurrentCat->szLibrary );
|
||||
CheckDlgButton( hPage, IDC_ALWAYSONTOP, g_lpCurrentCat->fAlwaysOnTop );
|
||||
SendMessage( hPage, WM_HSCROLL, 0, 0 );
|
||||
break;
|
||||
|
||||
case WM_HSCROLL:
|
||||
{
|
||||
//update the % indicator
|
||||
char szBuffer[32];
|
||||
sprintf( szBuffer, "%d%%", SendDlgItemMessage( hPage, IDC_SCALESLIDER, TBM_GETPOS, 0, 0 ) * 10 );
|
||||
SetDlgItemText( hPage, IDC_SCALEDISPLAY, szBuffer );
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_COMMAND:
|
||||
|
||||
switch( LOWORD(wParam) )
|
||||
{
|
||||
case IDC_SET100:
|
||||
SendDlgItemMessage( hPage, IDC_SCALESLIDER, TBM_SETPOS, TRUE, 10 );
|
||||
SendMessage( hPage, WM_HSCROLL, 0, 0 );
|
||||
break;
|
||||
|
||||
case IDC_DEFAULT:
|
||||
SetDlgItemText( hPage, IDC_IMAGELIB, "" );
|
||||
break;
|
||||
|
||||
case IDC_CHANGE:
|
||||
{
|
||||
OPENFILENAME ofn;
|
||||
char lpstrLibrary[MAX_PATH];
|
||||
LPCTSTR lpstrFileMasks = "Icon Libraries\0*.icl;*.exe;*.dll\0All Files (*.*)\0*.*\0\0";
|
||||
|
||||
//get the current file
|
||||
GetDlgItemText( hPage, IDC_IMAGELIB, lpstrLibrary, MAX_PATH-1 );
|
||||
|
||||
ofn.lStructSize = sizeof(OPENFILENAME);
|
||||
ofn.hwndOwner = hPage;
|
||||
ofn.hInstance = NULL;
|
||||
ofn.lpstrFilter = lpstrFileMasks;
|
||||
ofn.lpstrCustomFilter = NULL;
|
||||
ofn.nFilterIndex = 1;
|
||||
ofn.lpstrFile = lpstrLibrary;
|
||||
ofn.nMaxFile = MAX_PATH-1;
|
||||
ofn.lpstrFileTitle = NULL;
|
||||
ofn.nMaxFileTitle = 0;
|
||||
ofn.lpstrInitialDir = NULL;
|
||||
ofn.lpstrTitle = "Select Image Library";
|
||||
ofn.Flags = OFN_EXPLORER|OFN_HIDEREADONLY|OFN_PATHMUSTEXIST|OFN_FILEMUSTEXIST;
|
||||
ofn.lpstrDefExt = "icl";
|
||||
if( GetOpenFileName( &ofn ) )
|
||||
{
|
||||
//check to make sure it's got enough icons in...
|
||||
if( (UINT)ExtractIcon( g_hInstance, ofn.lpstrFile, (UINT)-1 ) < 32 )
|
||||
MessageBox( hPage, "That file does not have enough icons in it - it must have at least 32", "Change Image Library", MB_ICONEXCLAMATION );
|
||||
else
|
||||
SetDlgItemText( hPage, IDC_IMAGELIB, ofn.lpstrFile );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_SHOWWINDOW:
|
||||
if( wParam ) SetWindowPos( hPage, HWND_TOP, g_rcTabStart.left, g_rcTabStart.top, 0, 0, SWP_NOSIZE );
|
||||
break;
|
||||
|
||||
/* help stuff */
|
||||
case WM_HELP:
|
||||
if( ((LPHELPINFO)lParam)->iCtrlId != (-1) )
|
||||
WinHelp( (HWND)((LPHELPINFO)lParam)->hItemHandle, szHelpFile, HELP_WM_HELP, (DWORD)(LPSTR)dwHelpID );
|
||||
else
|
||||
return FALSE;
|
||||
break;
|
||||
|
||||
case WM_CONTEXTMENU:
|
||||
WinHelp( (HWND)wParam, szHelpFile, HELP_CONTEXTMENU, (DWORD)(LPVOID)dwHelpID );
|
||||
break;
|
||||
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/* PropPage_Movement - message processsing function for the 'movement' property page */
|
||||
BOOL CALLBACK PropPage_Movement( HWND hPage, UINT uMsg, WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
switch( uMsg )
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
SendDlgItemMessage( hPage, IDC_SPEEDSLIDER, TBM_SETRANGE, FALSE, MAKELPARAM(MIN_SPEED,MAX_SPEED) );
|
||||
SendDlgItemMessage( hPage, IDC_SENSESLIDER, TBM_SETRANGE, FALSE, MAKELPARAM(MIN_SENSE,MAX_SENSE) );
|
||||
break;
|
||||
|
||||
case MY_WRITESETTINGS:
|
||||
g_lpCurrentCat->uSpeed = SendDlgItemMessage( hPage, IDC_SPEEDSLIDER, TBM_GETPOS, 0, 0 );
|
||||
g_lpCurrentCat->uMouseSensitivity = MAX_SENSE - SendDlgItemMessage( hPage, IDC_SENSESLIDER, TBM_GETPOS, 0, 0 );
|
||||
break;
|
||||
|
||||
case MY_READSETTINGS:
|
||||
SendDlgItemMessage( hPage, IDC_SPEEDSLIDER, TBM_SETPOS, TRUE, g_lpCurrentCat->uSpeed );
|
||||
SendDlgItemMessage( hPage, IDC_SENSESLIDER, TBM_SETPOS, TRUE, MAX_SENSE - g_lpCurrentCat->uMouseSensitivity );
|
||||
break;
|
||||
|
||||
|
||||
case WM_SHOWWINDOW:
|
||||
if( wParam ) SetWindowPos( hPage, HWND_TOP, g_rcTabStart.left, g_rcTabStart.top, 0, 0, SWP_NOSIZE );
|
||||
break;
|
||||
|
||||
/* help stuff */
|
||||
case WM_HELP:
|
||||
if( ((LPHELPINFO)lParam)->iCtrlId != (-1) )
|
||||
WinHelp( (HWND)((LPHELPINFO)lParam)->hItemHandle, szHelpFile, HELP_WM_HELP, (DWORD)(LPSTR)dwHelpID );
|
||||
else
|
||||
return FALSE;
|
||||
break;
|
||||
|
||||
case WM_CONTEXTMENU:
|
||||
WinHelp( (HWND)wParam, szHelpFile, HELP_CONTEXTMENU, (DWORD)(LPVOID)dwHelpID );
|
||||
break;
|
||||
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* PropPage_Sound - message processsing function for the 'sound' property page */
|
||||
BOOL CALLBACK PropPage_Sound( HWND hPage, UINT uMsg, WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
static HCURSOR s_hcPlaying = NULL;
|
||||
|
||||
switch( uMsg )
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
SendDlgItemMessage( hPage, IDC_PREVIEW, BM_SETIMAGE, IMAGE_BITMAP, (LPARAM)LoadImage( g_hInstance, MAKEINTRESOURCE(IDR_PLAYBITMAP), IMAGE_BITMAP, 0, 0, LR_LOADMAP3DCOLORS ) );
|
||||
SendDlgItemMessage( hPage, IDC_SOUNDFREQ, TBM_SETRANGE, FALSE, MAKELPARAM(MIN_SNDFREQ,MAX_SNDFREQ) );
|
||||
|
||||
SendDlgItemMessage( hPage, IDC_SOUNDSAVAIL, LB_ADDSTRING, 0, (LPARAM)"Idle One" );
|
||||
SendDlgItemMessage( hPage, IDC_SOUNDSAVAIL, LB_ADDSTRING, 0, (LPARAM)"Idle Two" );
|
||||
SendDlgItemMessage( hPage, IDC_SOUNDSAVAIL, LB_ADDSTRING, 0, (LPARAM)"Idle Three" );
|
||||
SendDlgItemMessage( hPage, IDC_SOUNDSAVAIL, LB_ADDSTRING, 0, (LPARAM)"Sleep" );
|
||||
SendDlgItemMessage( hPage, IDC_SOUNDSAVAIL, LB_ADDSTRING, 0, (LPARAM)"Awake" );
|
||||
|
||||
//load the playing cursor
|
||||
s_hcPlaying = LoadCursor( g_hInstance, MAKEINTRESOURCE(IDC_PLAYING) );
|
||||
|
||||
//select first item in the list & update
|
||||
SendDlgItemMessage( hPage, IDC_SOUNDSAVAIL, LB_SETCURSEL, 0, 0 );
|
||||
break;
|
||||
|
||||
case WM_DESTROY:
|
||||
DestroyCursor( s_hcPlaying );
|
||||
break;
|
||||
|
||||
case MY_WRITESETTINGS:
|
||||
g_lpCurrentCat->uSndFrequency = SendDlgItemMessage( hPage, IDC_SOUNDFREQ, TBM_GETPOS, 0, 0 );
|
||||
break;
|
||||
|
||||
case MY_READSETTINGS:
|
||||
SendDlgItemMessage( hPage, IDC_SOUNDFREQ, TBM_SETPOS, TRUE, g_lpCurrentCat->uSndFrequency );
|
||||
|
||||
SendDlgItemMessage( hPage, IDC_SOUNDSAVAIL, LB_SETITEMDATA, 0, (LPARAM)g_lpCurrentCat->szSndIdle1 );
|
||||
SendDlgItemMessage( hPage, IDC_SOUNDSAVAIL, LB_SETITEMDATA, 1, (LPARAM)g_lpCurrentCat->szSndIdle2 );
|
||||
SendDlgItemMessage( hPage, IDC_SOUNDSAVAIL, LB_SETITEMDATA, 2, (LPARAM)g_lpCurrentCat->szSndIdle3 );
|
||||
SendDlgItemMessage( hPage, IDC_SOUNDSAVAIL, LB_SETITEMDATA, 3, (LPARAM)g_lpCurrentCat->szSndSleep );
|
||||
SendDlgItemMessage( hPage, IDC_SOUNDSAVAIL, LB_SETITEMDATA, 4, (LPARAM)g_lpCurrentCat->szSndAwake );
|
||||
PostMessage( hPage, WM_COMMAND, MAKEWPARAM( IDC_SOUNDSAVAIL, 0 ), 0 );
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
switch( LOWORD(wParam) )
|
||||
{
|
||||
case IDC_SOUNDSAVAIL:
|
||||
{
|
||||
int iCurSel = SendDlgItemMessage( hPage, IDC_SOUNDSAVAIL, LB_GETCURSEL, 0, 0 );
|
||||
char * lpszFile = (char*)SendDlgItemMessage( hPage, IDC_SOUNDSAVAIL, LB_GETITEMDATA, iCurSel, 0 );
|
||||
|
||||
if( strcmp( lpszFile, "" ) == 0 )
|
||||
{
|
||||
SetDlgItemText( hPage, IDC_SOUNDNAME, "" );
|
||||
EnableWindow( GetDlgItem( hPage, IDC_PREVIEW ), FALSE );
|
||||
EnableWindow( GetDlgItem( hPage, IDC_NONE ), FALSE );
|
||||
}
|
||||
else
|
||||
{
|
||||
SetDlgItemText( hPage, IDC_SOUNDNAME, lpszFile );
|
||||
EnableWindow( GetDlgItem( hPage, IDC_PREVIEW ), TRUE );
|
||||
EnableWindow( GetDlgItem( hPage, IDC_NONE ), TRUE );
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case IDC_PREVIEW:
|
||||
{
|
||||
int iCurSel = SendDlgItemMessage( hPage, IDC_SOUNDSAVAIL, LB_GETCURSEL, 0, 0 );
|
||||
char * lpszFile = (char*)SendDlgItemMessage( hPage, IDC_SOUNDSAVAIL, LB_GETITEMDATA, iCurSel, 0 );
|
||||
|
||||
if( strcmp( lpszFile, "" ) != 0 )
|
||||
{
|
||||
SetCursor( s_hcPlaying );
|
||||
if( !PlaySound( lpszFile, NULL, SND_FILENAME|SND_NODEFAULT|SND_SYNC ) ) MessageBox( hPage, "Unable to start playing wave file!", "Preview Sound", MB_ICONEXCLAMATION );
|
||||
SetCursor( LoadCursor( NULL, MAKEINTRESOURCE(IDC_ARROW) ) );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case IDC_NONE:
|
||||
{
|
||||
int iCurSel = SendDlgItemMessage( hPage, IDC_SOUNDSAVAIL, LB_GETCURSEL, 0, 0 );
|
||||
|
||||
strcpy( (char*)SendDlgItemMessage( hPage, IDC_SOUNDSAVAIL, LB_GETITEMDATA, iCurSel, 0 ), "" );
|
||||
|
||||
//update the display
|
||||
PostMessage( hPage, WM_COMMAND, MAKEWPARAM( IDC_SOUNDSAVAIL, 0 ), 0 );
|
||||
break;
|
||||
}
|
||||
|
||||
case IDC_BROWSE:
|
||||
{
|
||||
OPENFILENAME ofn;
|
||||
char szPrompt[256] = "Browse for ", szSoundName[256];
|
||||
LPCTSTR lpstrFileMasks ="Sounds (*.wav)\0*.wav\0All Files (*.*)\0*.*\0\0";
|
||||
int iCurSel = SendDlgItemMessage( hPage, IDC_SOUNDSAVAIL, LB_GETCURSEL, 0, 0 );
|
||||
|
||||
//build browse dialog prompt
|
||||
SendDlgItemMessage( hPage, IDC_SOUNDSAVAIL, LB_GETTEXT, iCurSel, (LPARAM)szSoundName );
|
||||
strcat( szPrompt, szSoundName );
|
||||
strcat( szPrompt, " sound" );
|
||||
|
||||
strcpy( szSoundName, (char*)SendDlgItemMessage( hPage, IDC_SOUNDSAVAIL, LB_GETITEMDATA, iCurSel, 0 ) );
|
||||
|
||||
//get the current file
|
||||
ofn.lStructSize = sizeof(OPENFILENAME);
|
||||
ofn.hwndOwner = hPage;
|
||||
ofn.hInstance = NULL;
|
||||
ofn.lpstrFilter = lpstrFileMasks;
|
||||
ofn.lpstrCustomFilter = NULL;
|
||||
ofn.nFilterIndex = 1;
|
||||
ofn.lpstrFile = szSoundName;
|
||||
ofn.nMaxFile = MAX_PATH-1;
|
||||
ofn.lpstrFileTitle = NULL;
|
||||
ofn.nMaxFileTitle = 0;
|
||||
ofn.lpstrInitialDir = NULL;
|
||||
ofn.lpstrTitle = szPrompt;
|
||||
ofn.Flags = OFN_EXPLORER|OFN_HIDEREADONLY|OFN_PATHMUSTEXIST|OFN_FILEMUSTEXIST;
|
||||
ofn.lpstrDefExt = "WAV";
|
||||
if( GetOpenFileName( &ofn ) )
|
||||
{
|
||||
//update everything with the new sound
|
||||
SetDlgItemText( hPage, IDC_SOUNDNAME, ofn.lpstrFile );
|
||||
strcpy( (char*)SendDlgItemMessage( hPage, IDC_SOUNDSAVAIL, LB_GETITEMDATA, iCurSel, 0 ), szSoundName );
|
||||
|
||||
//update the display
|
||||
PostMessage( hPage, WM_COMMAND, MAKEWPARAM( IDC_SOUNDSAVAIL, 0 ), 0 );
|
||||
|
||||
//make sure it will make a sound
|
||||
if( SendDlgItemMessage( hPage, IDC_SOUNDFREQ, TBM_GETPOS, 0, 0 ) == 0 )
|
||||
SendDlgItemMessage( hPage, IDC_SOUNDFREQ, TBM_SETPOS, TRUE, 2 );
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_SHOWWINDOW:
|
||||
if( wParam ) SetWindowPos( hPage, HWND_TOP, g_rcTabStart.left, g_rcTabStart.top, 0, 0, SWP_NOSIZE );
|
||||
break;
|
||||
|
||||
/* help stuff */
|
||||
case WM_HELP:
|
||||
if( ((LPHELPINFO)lParam)->iCtrlId != (-1) )
|
||||
WinHelp( (HWND)((LPHELPINFO)lParam)->hItemHandle, szHelpFile, HELP_WM_HELP, (DWORD)(LPSTR)dwHelpID );
|
||||
else
|
||||
return FALSE;
|
||||
break;
|
||||
|
||||
case WM_CONTEXTMENU:
|
||||
WinHelp( (HWND)wParam, szHelpFile, HELP_CONTEXTMENU, (DWORD)(LPVOID)dwHelpID );
|
||||
break;
|
||||
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/* PropPage_Independence - message processsing function for the 'independence' property page */
|
||||
BOOL CALLBACK PropPage_Independence( HWND hPage, UINT uMsg, WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
switch( uMsg )
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
SendDlgItemMessage( hPage, IDC_ACTION, CB_ADDSTRING, 0, (LPARAM)"Chase the mouse (default)" );
|
||||
SendDlgItemMessage( hPage, IDC_ACTION, CB_ADDSTRING, 0, (LPARAM)"Run away from the mouse");
|
||||
SendDlgItemMessage( hPage, IDC_ACTION, CB_ADDSTRING, 0, (LPARAM)"Run around randomly");
|
||||
SendDlgItemMessage( hPage, IDC_ACTION, CB_ADDSTRING, 0, (LPARAM)"Pace around the screen");
|
||||
SendDlgItemMessage( hPage, IDC_ACTION, CB_ADDSTRING, 0, (LPARAM)"Run around the screen");
|
||||
break;
|
||||
|
||||
case MY_WRITESETTINGS:
|
||||
g_lpCurrentCat->uAction = SendDlgItemMessage( hPage, IDC_ACTION, CB_GETCURSEL, 0, 0 );
|
||||
break;
|
||||
|
||||
case MY_READSETTINGS:
|
||||
SendDlgItemMessage( hPage, IDC_ACTION, CB_SETCURSEL, g_lpCurrentCat->uAction, 0 );
|
||||
SendMessage( hPage, WM_COMMAND, MAKEWPARAM(IDC_ACTION, CBN_SELCHANGE), 0 );
|
||||
break;
|
||||
|
||||
case WM_SHOWWINDOW:
|
||||
if( wParam ) SetWindowPos( hPage, HWND_TOP, g_rcTabStart.left, g_rcTabStart.top, 0, 0, SWP_NOSIZE );
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
switch( LOWORD(wParam) )
|
||||
{
|
||||
case IDC_ACTION:
|
||||
if( HIWORD(wParam) == CBN_SELCHANGE )
|
||||
{
|
||||
const char* szActionDesc[] = {
|
||||
"Neko will follow the mouse cursor wherever it goes",
|
||||
"Neko will run away when the mouse cursor gets too near, and sleep when it isn't near",
|
||||
"Neko will run to a random spot on the desktop, sleep for a while, and then continue running around",
|
||||
"Neko will run around the outside of the desktop",
|
||||
"Neko will run around the desktop, without stopping"
|
||||
};
|
||||
|
||||
SetDlgItemText( hPage, IDC_ACTIONDESC, szActionDesc[SendDlgItemMessage( hPage, IDC_ACTION, CB_GETCURSEL, 0, 0 )] );
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
/* help stuff */
|
||||
case WM_HELP:
|
||||
if( ((LPHELPINFO)lParam)->iCtrlId != (-1) )
|
||||
WinHelp( (HWND)((LPHELPINFO)lParam)->hItemHandle, szHelpFile, HELP_WM_HELP, (DWORD)(LPSTR)dwHelpID );
|
||||
else
|
||||
return FALSE;
|
||||
break;
|
||||
|
||||
case WM_CONTEXTMENU:
|
||||
WinHelp( (HWND)wParam, szHelpFile, HELP_CONTEXTMENU, (DWORD)(LPVOID)dwHelpID );
|
||||
break;
|
||||
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* PropPage_Effects - message processsing function for the 'effects' property page */
|
||||
BOOL CALLBACK PropPage_Effects( HWND hPage, UINT uMsg, WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
switch( uMsg )
|
||||
{
|
||||
case MY_WRITESETTINGS:
|
||||
GetDlgItemText( hPage, IDC_IMAGELIB, g_lpCurrentCat->szFootprintLib, MAX_PATH );
|
||||
g_lpCurrentCat->bFootprints = IsDlgButtonChecked( hPage, IDC_FOOTPRINTS );
|
||||
break;
|
||||
|
||||
case MY_READSETTINGS:
|
||||
SetDlgItemText( hPage, IDC_IMAGELIB, g_lpCurrentCat->szFootprintLib );
|
||||
CheckDlgButton( hPage, IDC_FOOTPRINTS, g_lpCurrentCat->bFootprints );
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
|
||||
switch( LOWORD(wParam) )
|
||||
{
|
||||
case IDC_DEFAULT:
|
||||
SetDlgItemText( hPage, IDC_IMAGELIB, "" );
|
||||
break;
|
||||
|
||||
case IDC_CHANGE:
|
||||
{
|
||||
OPENFILENAME ofn;
|
||||
char lpstrLibrary[MAX_PATH];
|
||||
LPCTSTR lpstrFileMasks = "Icon Libraries\0*.icl;*.exe;*.dll\0All Files (*.*)\0*.*\0\0";
|
||||
|
||||
//get the current file
|
||||
GetDlgItemText( hPage, IDC_IMAGELIB, lpstrLibrary, MAX_PATH-1 );
|
||||
|
||||
ofn.lStructSize = sizeof(OPENFILENAME);
|
||||
ofn.hwndOwner = hPage;
|
||||
ofn.hInstance = NULL;
|
||||
ofn.lpstrFilter = lpstrFileMasks;
|
||||
ofn.lpstrCustomFilter = NULL;
|
||||
ofn.nFilterIndex = 1;
|
||||
ofn.lpstrFile = lpstrLibrary;
|
||||
ofn.nMaxFile = MAX_PATH-1;
|
||||
ofn.lpstrFileTitle = NULL;
|
||||
ofn.nMaxFileTitle = 0;
|
||||
ofn.lpstrInitialDir = NULL;
|
||||
ofn.lpstrTitle = "Select Footprint Image Library";
|
||||
ofn.Flags = OFN_EXPLORER|OFN_HIDEREADONLY|OFN_PATHMUSTEXIST|OFN_FILEMUSTEXIST;
|
||||
ofn.lpstrDefExt = "icl";
|
||||
if( GetOpenFileName( &ofn ) )
|
||||
{
|
||||
//check to make sure it's got enough icons in...
|
||||
if( (UINT)ExtractIcon( g_hInstance, ofn.lpstrFile, (UINT)-1 ) < 8 )
|
||||
MessageBox( hPage, "That file does not have enough icons in it - it must have at least 8", "Change Image Library", MB_ICONEXCLAMATION );
|
||||
else
|
||||
{
|
||||
SetDlgItemText( hPage, IDC_IMAGELIB, ofn.lpstrFile );
|
||||
CheckDlgButton( hPage, IDC_FOOTPRINTS, TRUE );
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_SHOWWINDOW:
|
||||
if( wParam ) SetWindowPos( hPage, HWND_TOP, g_rcTabStart.left, g_rcTabStart.top, 0, 0, SWP_NOSIZE );
|
||||
break;
|
||||
|
||||
/* help stuff */
|
||||
case WM_HELP:
|
||||
if( ((LPHELPINFO)lParam)->iCtrlId != (-1) )
|
||||
WinHelp( (HWND)((LPHELPINFO)lParam)->hItemHandle, szHelpFile, HELP_WM_HELP, (DWORD)(LPSTR)dwHelpID );
|
||||
else
|
||||
return FALSE;
|
||||
break;
|
||||
|
||||
case WM_CONTEXTMENU:
|
||||
WinHelp( (HWND)wParam, szHelpFile, HELP_CONTEXTMENU, (DWORD)(LPVOID)dwHelpID );
|
||||
break;
|
||||
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
126
nkosrc4/Neko98/NekoCFG/NekoCFG_resource.h
Executable file
@@ -0,0 +1,126 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by NekoCFG.rc
|
||||
//
|
||||
#define IDS_DESC1 1
|
||||
#define IDS_DESC2 2
|
||||
#define IDS_DESC3 3
|
||||
#define IDS_DESC4 4
|
||||
#define IDS_DESC5 5
|
||||
#define IDS_DESC6 6
|
||||
#define IDI_APPICON 101
|
||||
#define ID_SETTINGS 101
|
||||
#define IDC_SPEEDSLIDER 102
|
||||
#define ID_EXIT 102
|
||||
#define IDC_SENSESLIDER 103
|
||||
#define ID_NEKOUPDATETIMER 103
|
||||
#define IDC_IMAGELIB 104
|
||||
#define IDC_PREVIEW 105
|
||||
#define IDC_TASKBAR 106
|
||||
#define IDC_CHANGE 107
|
||||
#define IDC_DEFAULT 108
|
||||
#define IDD_GENERAL 109
|
||||
#define IDD_MOVEMENT 109
|
||||
#define IDD_INDEPENDENCE 110
|
||||
#define IDD_DISPLAY 112
|
||||
#define IDI_AWAKE 113
|
||||
#define IDI_UP1 114
|
||||
#define IDI_UP2 115
|
||||
#define IDI_UPRIGHT1 116
|
||||
#define IDI_UPRIGHT2 117
|
||||
#define IDI_RIGHT1 118
|
||||
#define IDI_RIGHT2 119
|
||||
#define IDI_DOWNRIGHT1 120
|
||||
#define IDI_DOWNRIGHT2 121
|
||||
#define IDI_DOWN1 122
|
||||
#define IDI_DOWN2 123
|
||||
#define IDI_DOWNLEFT1 124
|
||||
#define IDI_DOWNLEFT2 125
|
||||
#define IDI_LEFT1 126
|
||||
#define IDI_LEFT2 127
|
||||
#define IDI_UPLEFT1 128
|
||||
#define IDI_UPLEFT2 129
|
||||
#define IDI_UPCLAW1 130
|
||||
#define IDI_UPCLAW2 131
|
||||
#define IDI_RIGHTCLAW1 132
|
||||
#define IDI_RIGHTCLAW2 133
|
||||
#define IDI_LEFTCLAW1 134
|
||||
#define IDI_LEFTCLAW2 135
|
||||
#define IDI_DOWNCLAW1 136
|
||||
#define IDI_DOWNCLAW2 137
|
||||
#define IDI_WASH2 138
|
||||
#define IDI_SCRATCH1 139
|
||||
#define IDI_SCRATCH2 140
|
||||
#define IDI_YAWN2 141
|
||||
#define IDI_YAWN3 142
|
||||
#define IDI_SLEEP1 143
|
||||
#define IDI_SLEEP2 144
|
||||
#define IDI_TASKBAR 145
|
||||
#define IDI_DEFAULT 146
|
||||
#define IDI_DISPLAYICON 147
|
||||
#define IDI_MOVEMENTICON 148
|
||||
#define IDI_ABOUTICON 149
|
||||
#define IDD_ABOUT 150
|
||||
#define IDI_SOUNDSICON 151
|
||||
#define IDD_SOUNDS 152
|
||||
#define IDB_TASKBAR 155
|
||||
#define IDB_CATCLOCK 156
|
||||
#define IDI_IE4 157
|
||||
#define IDD_CONFIG 158
|
||||
#define IDD_IMAGELIB 159
|
||||
#define IDD_SCALE 160
|
||||
#define IDD_SOUND 162
|
||||
#define IDD_NEWNEKO 163
|
||||
#define IDD_ABOUTBOX 164
|
||||
#define IDC_PLAYING 165
|
||||
#define IDD_EFFECTS 165
|
||||
#define IDI_TAB_SOUNDS 168
|
||||
#define IDI_TAB_MOVEMENT 169
|
||||
#define IDI_TAB_DISPLAY 170
|
||||
#define IDI_TAB_INDEPENDENCE 171
|
||||
#define IDR_PLAYBITMAP 172
|
||||
#define IDI_TAB_EFFECTS 172
|
||||
#define IDC_CHANCESLIDER 1000
|
||||
#define IDC_CHANCE 1002
|
||||
#define IDC_CHASECOMBO 1003
|
||||
#define IDC_CHASERANDOM 1007
|
||||
#define IDC_DESCRIPTION 1009
|
||||
#define IDC_WEBPAGE 1011
|
||||
#define IDC_EMAIL 1013
|
||||
#define IDC_LIST1 1014
|
||||
#define IDC_SOUNDSAVAIL 1014
|
||||
#define IDC_SOUNDNAME 1029
|
||||
#define IDC_BROWSE 1030
|
||||
#define IDC_SOUNDFREQ 1033
|
||||
#define IDC_NONE 1034
|
||||
#define IDC_CHEESE 1035
|
||||
#define IDC_SCALESCLIDE 1036
|
||||
#define IDC_SCALESLIDER 1036
|
||||
#define IDC_SCALEDISPLAY 1037
|
||||
#define IDC_IE4MODE 1039
|
||||
#define IDC_SET100 1040
|
||||
#define IDC_APPLY 1041
|
||||
#define IDC_TABS 1042
|
||||
#define IDC_NEWNEKO 1043
|
||||
#define IDC_NEW 1043
|
||||
#define IDC_DELETE 1044
|
||||
#define IDC_NAME 1045
|
||||
#define IDC_NEWNEKONAME 1048
|
||||
#define IDC_ABOUT 1049
|
||||
#define IDC_QUEUEDRAWING 1052
|
||||
#define IDC_HELP 1053
|
||||
#define IDC_ACTION 1054
|
||||
#define IDC_ACTIONDESC 1055
|
||||
#define IDC_ALWAYSONTOP 1056
|
||||
#define IDC_FOOTPRINTS 1058
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 174
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1059
|
||||
#define _APS_NEXT_SYMED_VALUE 104
|
||||
#endif
|
||||
#endif
|
||||
31
nkosrc4/Neko98/NekoCFG/NekoCFG_resource.hm
Executable file
@@ -0,0 +1,31 @@
|
||||
// Microsoft Developer Studio generated Help ID include file.
|
||||
// Used by NekoCFG.rc
|
||||
//
|
||||
#define HIDCANCEL 0x809e0002 // IDD_CONFIG
|
||||
#define HIDC_ABOUT 0x809e0419 // IDD_CONFIG
|
||||
#define HIDC_ACTION 0x806e041e // IDD_INDEPENDENCE
|
||||
#define HIDC_ACTIONDESC 0x806e041f // IDD_INDEPENDENCE
|
||||
#define HIDC_ALWAYSONTOP 0x80700420 // IDD_DISPLAY
|
||||
#define HIDC_APPLY 0x809e0411 // IDD_CONFIG
|
||||
#define HIDC_BROWSE 0x80a20406 // IDD_SOUND
|
||||
#define HIDC_CHANGE 0x8070006b // IDD_DISPLAY
|
||||
#define HIDC_DEFAULT 0x8070006c // IDD_DISPLAY
|
||||
#define HIDC_DELETE 0x809e0414 // IDD_CONFIG
|
||||
#define HIDC_FOOTPRINTS 0x80a50422 // IDD_EFFECTS
|
||||
#define HIDC_HELP 0x809e041d // IDD_CONFIG
|
||||
#define HIDC_IMAGELIB 0x80700068 // IDD_DISPLAY
|
||||
#define HIDC_NAME 0x809e0415 // IDD_CONFIG
|
||||
#define HIDC_NEW 0x809e0413 // IDD_CONFIG
|
||||
#define HIDC_NONE 0x80a2040a // IDD_SOUND
|
||||
#define HIDC_PREVIEW 0x80a20069 // IDD_SOUND
|
||||
#define HIDC_SCALEDISPLAY 0x8070040d // IDD_DISPLAY
|
||||
#define HIDC_SCALESLIDER 0x8070040c // IDD_DISPLAY
|
||||
#define HIDC_SENSESLIDER 0x806d0067 // IDD_MOVEMENT
|
||||
#define HIDC_SET100 0x80700410 // IDD_DISPLAY
|
||||
#define HIDC_SOUNDFREQ 0x80a20409 // IDD_SOUND
|
||||
#define HIDC_SOUNDNAME 0x80a20405 // IDD_SOUND
|
||||
#define HIDC_SOUNDSAVAIL 0x80a203f6 // IDD_SOUND
|
||||
#define HIDC_SPEEDSLIDER 0x806d0066 // IDD_MOVEMENT
|
||||
#define HIDC_TABS 0x809e0412 // IDD_CONFIG
|
||||
#define HIDC_TASKBAR 0x809e006a // IDD_CONFIG
|
||||
#define HIDOK 0x809e0001 // IDD_CONFIG
|
||||
BIN
nkosrc4/Neko98/NekoCFG/Res/AppIcon.ico
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
nkosrc4/Neko98/NekoCFG/Res/displayi.ico
Executable file
|
After Width: | Height: | Size: 318 B |
BIN
nkosrc4/Neko98/NekoCFG/Res/independence.ico
Executable file
|
After Width: | Height: | Size: 318 B |
BIN
nkosrc4/Neko98/NekoCFG/Res/movement.ico
Executable file
|
After Width: | Height: | Size: 318 B |
BIN
nkosrc4/Neko98/NekoCFG/Res/play.bmp
Executable file
|
After Width: | Height: | Size: 154 B |
BIN
nkosrc4/Neko98/NekoCFG/Res/playing.cur
Executable file
|
After Width: | Height: | Size: 326 B |
BIN
nkosrc4/Neko98/NekoCFG/Res/sounds.ico
Executable file
|
After Width: | Height: | Size: 318 B |
BIN
nkosrc4/Neko98/NekoCFG/Res/tab_effects.ico
Executable file
|
After Width: | Height: | Size: 318 B |
56
nkosrc4/Neko98/NekoCommon.h
Executable file
@@ -0,0 +1,56 @@
|
||||
/************************************
|
||||
|
||||
Common Definitions header
|
||||
|
||||
Contains definitions used by both
|
||||
Neko95 and NekoCFG applications
|
||||
|
||||
*************************************/
|
||||
|
||||
#ifndef _NEKOCOMMON_H
|
||||
#define _NEKOCOMMON_H
|
||||
|
||||
//class & window names
|
||||
#define szNekoClassName "Neko95Class"
|
||||
#define szNekoWindowTitle "Neko95"
|
||||
|
||||
//registry key for Neko's settings
|
||||
#define szNekoRegKey "Software\\DHSoft\\Neko95"
|
||||
|
||||
//sub-key names
|
||||
#define szNekoTaskbarKey "Taskbar Icon"
|
||||
|
||||
#define szNekoSpeedKey "Speed"
|
||||
#define szNekoSenseKey "Sensitivity"
|
||||
#define szNekoLibraryKey "Library"
|
||||
#define szNekoSndIdle1Key "Snd_Idle1"
|
||||
#define szNekoSndIdle2Key "Snd_Idle2"
|
||||
#define szNekoSndIdle3Key "Snd_Idle3"
|
||||
#define szNekoSndSleepKey "Snd_Sleep"
|
||||
#define szNekoSndAwakeKey "Snd_Awake"
|
||||
#define szNekoSndFreqKey "Sound Frequency"
|
||||
#define szNekoScaleKey "Size"
|
||||
#define szNekoOnTopKey "On Top"
|
||||
#define szNekoFootprintLibKey "Footprint Library"
|
||||
#define szNekoFootprintKey "Footprints"
|
||||
|
||||
#define szNekoActionKey "Action"
|
||||
|
||||
#define szNekoNumCatsKey "NumNekos"
|
||||
|
||||
|
||||
//identifiers for different Neko actions
|
||||
#define CHASE_MOUSE 0
|
||||
#define RUN_AWAY_FROM_MOUSE 1
|
||||
#define RUN_AROUND_RANDOMLY 2
|
||||
#define PACE_AROUND_SCREEN 3
|
||||
#define RUN_AROUND 4
|
||||
|
||||
|
||||
//message sent from NekoCFG to Neko to signal settings have changed
|
||||
#define MY_UPDATENEKO (WM_USER+33)
|
||||
|
||||
//maximum length of a neko 'Name'
|
||||
#define MAX_NEKO_NAME (64)
|
||||
|
||||
#endif
|
||||
BIN
nkosrc4/Neko98/NekoHelp/Neko98.GID
Executable file
23
nkosrc4/Neko98/NekoHelp/Neko98.HPJ
Executable file
@@ -0,0 +1,23 @@
|
||||
; This file is maintained by HCW. Do not modify this file directly.
|
||||
|
||||
; This file is maintained by WHD. Copyright (c) Nick Ameladiotis
|
||||
[OPTIONS]
|
||||
COMPRESS=12 Hall Zeck
|
||||
ERRORLOG=Neko98.LOG
|
||||
LCID=0x809 0x0 0x0 ; English (United Kingdom)
|
||||
REPORT=Yes
|
||||
CONTENTS=Neko98
|
||||
TITLE=Neko98
|
||||
CNT=Neko98.CNT
|
||||
COPYRIGHT=<3D> 1998 DHSoft
|
||||
PREFIX=HIDC_
|
||||
HLP=Neko98.hlp
|
||||
|
||||
[FILES]
|
||||
Neko98.RTF
|
||||
|
||||
[MAP]
|
||||
#include ..\NekoCFG\NekoCFG_resource.hm
|
||||
|
||||
[WINDOWS]
|
||||
main="Neko98",(640,109,384,682),27648,(r14811135),(r12632256),1
|
||||
180
nkosrc4/Neko98/NekoHelp/Neko98.RTF
Executable file
@@ -0,0 +1,180 @@
|
||||
{\rtf1\ansi\ansicpg1252\uc1 \deff0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f3\froman\fcharset2\fprq2{\*\panose 05050102010706020507}Symbol;}
|
||||
{\f11\fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}MS Sans Serif;}{\f27\fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma;}{\f32\froman\fcharset238\fprq2 Times New Roman CE;}{\f33\froman\fcharset204\fprq2 Times New Roman Cyr;}
|
||||
{\f35\froman\fcharset161\fprq2 Times New Roman Greek;}{\f36\froman\fcharset162\fprq2 Times New Roman Tur;}{\f37\froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f38\froman\fcharset178\fprq2 Times New Roman (Arabic);}
|
||||
{\f39\froman\fcharset186\fprq2 Times New Roman Baltic;}{\f248\fswiss\fcharset238\fprq2 Tahoma CE;}{\f249\fswiss\fcharset204\fprq2 Tahoma Cyr;}{\f251\fswiss\fcharset161\fprq2 Tahoma Greek;}{\f252\fswiss\fcharset162\fprq2 Tahoma Tur;}
|
||||
{\f253\fswiss\fcharset177\fprq2 Tahoma (Hebrew);}{\f254\fswiss\fcharset178\fprq2 Tahoma (Arabic);}{\f255\fswiss\fcharset186\fprq2 Tahoma Baltic;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;
|
||||
\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;
|
||||
\red192\green192\blue192;}{\stylesheet{\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \snext0 Normal;}{\s1\ql \li0\ri0\keepn\nowidctlpar\faauto\adjustright\rin0\lin0\itap0
|
||||
\b\f11\fs11\cf1\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \sbasedon0 \snext0 heading 1;}{\*\cs10 \additive Default Paragraph Font;}{\s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0
|
||||
\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \sbasedon0 \snext15 endnote text;}{\s16\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \sbasedon0 \snext16 footnote text;}{\*\cs17
|
||||
\additive \super \sbasedon10 footnote reference;}{\*\cs18 \additive \super \sbasedon10 endnote reference;}{\s19\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \cbpat9 \f27\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033
|
||||
\sbasedon0 \snext19 Document Map;}{\*\cs20 \additive \ul\cf2 \sbasedon10 Hyperlink;}{\s21\ql \li0\ri0\nowidctlpar\faauto\adjustright\rin0\lin0\itap0 \f11\fs11\cf1\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \sbasedon0 \snext21 Body Text;}{
|
||||
\s22\ql \li0\ri0\widctlpar\tqc\tx4153\tqr\tx8306\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \sbasedon0 \snext22 header;}{\s23\ql \li0\ri0\widctlpar\tqc\tx4153\tqr\tx8306\faauto\adjustright\rin0\lin0\itap0
|
||||
\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \sbasedon0 \snext23 footer;}}{\*\listtable{\list\listtemplateid134807567\listsimple{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext
|
||||
\'02\'00.;}{\levelnumbers\'01;}\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1 \fi-360\li360\jclisttab\tx360 }{\listname ;}\listid33046753}{\list\listtemplateid134807553\listsimple{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0
|
||||
\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li360\jclisttab\tx360 }{\listname ;}\listid349258629}{\list\listtemplateid134807553\listsimple
|
||||
{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li360\jclisttab\tx360 }{\listname
|
||||
;}\listid857964170}{\list\listtemplateid134807553\listsimple{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1
|
||||
\chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li360\jclisttab\tx360 }{\listname ;}\listid1845120029}}{\*\listoverridetable{\listoverride\listid1845120029\listoverridecount0\ls1}{\listoverride\listid349258629\listoverridecount0\ls2}
|
||||
{\listoverride\listid33046753\listoverridecount0\ls3}{\listoverride\listid857964170\listoverridecount0\ls4}}{\info{\title #Click these tabs to see more options}{\author David Harvey}{\operator David Harvey}{\creatim\yr1999\mo12\dy23\hr21\min21}
|
||||
{\revtim\yr1999\mo12\dy23\hr21\min22}{\version3}{\edmins0}{\nofpages36}{\nofwords941}{\nofchars5369}{\*\company }{\nofcharsws6593}{\vern8247}}\margl1880\margr1880
|
||||
\widowctrl\endnotes\aendnotes\ftnnrlc\aftnnar\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\horzdoc\dghspace120\dgvspace120\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind4\viewscale190\nolnhtadjtbl \fet1{\*\aftnsep
|
||||
\pard\plain \ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\chftnsep
|
||||
\par }}\sectd \linex0\headery709\footery709\colsx709\sectdefaultcl {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl4
|
||||
\pnlcltr\pnstart1\pnindent720\pnhang{\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}
|
||||
{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}\pard\plain \ql \li0\ri0\nowidctlpar\faauto\adjustright\rin0\lin0\itap0
|
||||
\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\f11\fs11\super #{\footnote\ftnalt \pard\plain \s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super #}{
|
||||
\f11\lang1031\langfe1033\cgrid0\langnp1031 HIDC_TABS}}}{\f11\fs11\cf1\cgrid0 Click these tabs to see more options.\page }{\cs18\f11\fs11\cf1\super\cgrid0 #{\footnote\ftnalt \pard\plain \s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0
|
||||
\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super #}{ HIDC_NAME}}}{\f11\fs11\cf1\cgrid0 Select the name of the Neko that you would like to configure.\page }{\cs18\f11\fs11\cf1\super\cgrid0 #{\footnote\ftnalt \pard\plain
|
||||
\s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super #}{ HIDC_NEW}}}{\f11\fs11\cf1\cgrid0 Click this button to create a new Neko.\page }{\cs18\f11\fs11\cf1\super\cgrid0 #
|
||||
{\footnote\ftnalt \pard\plain \s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super #}{ HIDC_DELETE}}}{\f11\fs11\cf1\cgrid0
|
||||
Click this button to remove the currently selected Neko. You cannot remove the default Neko.\page }{\cs18\f11\fs11\cf1\super\cgrid0 #{\footnote\ftnalt \pard\plain \s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0
|
||||
\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super #}{ HIDC_ABOUT}}}{\f11\fs11\cf1\cgrid0 Click this button to see the program version information and copyright.
|
||||
\par \page }{\cs18\f11\fs11\cf1\super\cgrid0 #{\footnote\ftnalt \pard\plain \s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super #}{ HIDC_HELP}}}{\f11\fs11\cf1\cgrid0
|
||||
Click this button to display the Neko help.\page }{\cs18\f11\fs11\cf1\super\cgrid0 #{\footnote\ftnalt \pard\plain \s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super #}{ HIDOK}
|
||||
}}{\f11\fs11\cf1\cgrid0 Click this button to close this program and save the settings.\page }{\cs18\f11\fs11\cf1\super\cgrid0 #{\footnote\ftnalt \pard\plain \s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0
|
||||
\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super #}{ HIDCANCEL}}}{\f11\fs11\cf1\cgrid0 Click this button to close the program without saving settings.\page }{\cs18\f11\fs11\cf1\super\cgrid0 #{\footnote\ftnalt \pard\plain
|
||||
\s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super #}{ HIDC_APPLY}}}{\f11\fs11\cf1\cgrid0 Click this button to save settings without exiting.\page }{\cs18\f11\fs11\super #
|
||||
{\footnote\ftnalt \pard\plain \s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super #}{\f11\lang1031\langfe1033\cgrid0\langnp1031 HIDC_TASKBAR}}}{\f11\fs11\cf1\cgrid0
|
||||
This option will display a small icon in the taskbar to allow you to exit Neko or display the configuration program.\page }{\cs18\f11\fs11\cf1\super\cgrid0 #{\footnote\ftnalt \pard\plain \s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0
|
||||
\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super #}{ HIDC_NONE}}}{\f11\fs11\cf1\cgrid0 This button will remove any sound associated with the current event.\page }{\cs18\f11\fs11\cf1\super\cgrid0 #{\footnote\ftnalt \pard\plain
|
||||
\s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super #}{ HIDC_SPEEDSLIDER}}}{\f11\fs11\cf1\cgrid0 This will set how fast Neko runs.\page }{\cs18\f11\fs11\cf1\super\cgrid0 #
|
||||
{\footnote\ftnalt \pard\plain \s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super #}{ HIDC_SET100}}}{\f11\fs11\cf1\cgrid0 This will set Neko back to normal size.\page }{
|
||||
\cs18\f11\fs11\cf1\super\cgrid0 #{\footnote\ftnalt \pard\plain \s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super #}{ HIDC_SCALEDISPLAY}}}{\f11\fs11\cf1\cgrid0
|
||||
This shows Neko's current scale.\page }{\cs18\f11\fs11\cf1\super\cgrid0 #{\footnote\ftnalt \pard\plain \s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super #}{ HIDC_SENSESLIDER}
|
||||
}}{\f11\fs11\cf1\cgrid0 This slider sets Neko's sensitivity to the mouse moving when sleeping. The higher this is, the further the mouse must be moved to wake Neko up.\page }{\cs18\f11\fs11\cf1\super\cgrid0 #{\footnote\ftnalt \pard\plain
|
||||
\s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super #}{ HIDC_IMAGELIB}}}{\f11\fs11\cf1\cgrid0 This displays the current image library that this Neko will use. \page }{
|
||||
\cs18\f11\fs11\cf1\super\cgrid0 #{\footnote\ftnalt \pard\plain \s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super #}{ HIDC_SCALESLIDER}}}{\f11\fs11\cf1\cgrid0
|
||||
This slider sets how large or small Neko will be.\page }{\cs18\f11\fs11\cf1\super\cgrid0 #{\footnote\ftnalt \pard\plain \s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super #}{
|
||||
HIDC_DEFAULT}}}{\f11\fs11\cf1\cgrid0 This button will use the default image library for Neko.\page }{\cs18\f11\fs11\cf1\super\cgrid0 #{\footnote\ftnalt \pard\plain \s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0
|
||||
\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super #}{ HIDC_SOUNDSAVAIL}}}{\f11\fs11\cf1\cgrid0 This lists the events available\page }{\cs18\f11\fs11\cf1\super\cgrid0 #{\footnote\ftnalt \pard\plain
|
||||
\s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super #}{ HIDC_BROWSE}}}{\f11\fs11\cf1\cgrid0 This option will let you browse for a new sound for the selected event.\page }{
|
||||
\cs18\f11\fs11\cf1\super\cgrid0 #{\footnote\ftnalt \pard\plain \s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super #}{ HIDC_SOUNDFREQ}}}{\f11\fs11\cf1\cgrid0
|
||||
This slider sets how frequently Neko plays sounds. Your system may run slowly if this is much above 10%. To turn sounds off without selecting "none" for each one, move this slider to "none".\page }{\cs18\f11\fs11\cf1\super\cgrid0 #{\footnote\ftnalt
|
||||
\pard\plain \s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super #}{ HIDC_SOUNDNAME}}}{\f11\fs11\cf1\cgrid0 This shows the .wav file being used for the current event.\page }{
|
||||
\cs18\f11\fs11\cf1\super\cgrid0 #{\footnote\ftnalt \pard\plain \s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super #}{ HIDC_CHANGE}}}{\f11\fs11\cf1\cgrid0
|
||||
This will let you browse for a new image library to change how Neko looks. You can download more image libraries.\page }{\cs18\f11\fs11\cf1\super\cgrid0 #{\footnote\ftnalt \pard\plain \s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0
|
||||
\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super #}{ HIDC_PREVIEW}}}{\f11\fs11\cf1\cgrid0 This button will play the sound for the current event.
|
||||
\par \page }{\cs18\f11\fs11\cf1\super\cgrid0 #{\footnote\ftnalt \pard\plain \s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super #}{ HIDC_ACTION}}}{\f11\fs11\cf1\cgrid0
|
||||
This lists all of the available actions that this Neko can perform while on the desktop.\page }{\cs18\f11\fs11\cf1\super\cgrid0 #{\footnote\ftnalt \pard\plain \s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0
|
||||
\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super #}{ HIDC_ALWAYSONTOP}}}{\f11\fs11\cf1\cgrid0 This causes this Neko to run on top of other Windows.
|
||||
\par Note: Having too many on top Nekos may degrade system performance.\page }{\cs18\f11\fs11\cf1\super\cgrid0 #{\footnote\ftnalt \pard\plain \s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033
|
||||
{\cs18\super #}{ HIDC_ACTIONDESC}}}{\f11\fs11\cf1\cgrid0 This gives a more detailed description of an individual action.
|
||||
\par \page }{\cs18\f11\fs11\cf1\super\cgrid0 #{\footnote\ftnalt \pard\plain \s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super #}{ HIDC_FOOTPRINTS}}}{\f11\fs11\cf1\cgrid0
|
||||
Causes Neko to leave footprints. This option doesn't work too well with Always On Top mode.\page }{\cs18\f11\fs11\cf1\super\cgrid0 #{\footnote\ftnalt \pard\plain \s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0
|
||||
\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super #}{ Extending_Neko}}${\footnote\ftnalt \pard\plain \s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super $}{
|
||||
Extending Neko}}K{\footnote\ftnalt \pard\plain \s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super K}{ More Image Libraries & Sounds}}}{\f11\fs11\cf1\cgrid0
|
||||
\par }\pard\plain \s1\ql \li0\ri0\keepn\nowidctlpar\faauto\outlinelevel0\adjustright\rin0\lin0\itap0 \b\f11\fs11\cf1\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {Image Libraries and Sounds
|
||||
\par }\pard\plain \ql \li0\ri0\nowidctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\f11\fs11\cf1\cgrid0 You can download more image libraries and sounds for Neko from the Neko home page at:
|
||||
\par http://www.geocities.com/SiliconValley/Haven/4173/
|
||||
\par
|
||||
\par }\pard\plain \s1\ql \li0\ri0\keepn\nowidctlpar\faauto\outlinelevel0\adjustright\rin0\lin0\itap0 \b\f11\fs11\cf1\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {Create Your Own
|
||||
\par }\pard\plain \ql \li0\ri0\nowidctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\f11\fs11\cf1\cgrid0
|
||||
Alternatively, you can create your own by using any icon library editor, such as Microangelo from Impact Software, which is available at:
|
||||
\par http://www.impactsoft.com/\page }{\cs18\f11\fs11\cf1\super\cgrid0 #{\footnote\ftnalt \pard\plain \s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super #}{ Other_Versions}}$
|
||||
{\footnote\ftnalt \pard\plain \s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super $}{ Other Versions}}K{\footnote\ftnalt \pard\plain
|
||||
\s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super K}{ Windows 3.0/3.1; X-Windows; Mac; Java; OS/2}}}{\f11\fs11\cf1\cgrid0
|
||||
\par }\pard\plain \s1\ql \li0\ri0\keepn\nowidctlpar\faauto\outlinelevel0\adjustright\rin0\lin0\itap0 \b\f11\fs11\cf1\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {Other Versions
|
||||
\par }\pard\plain \ql \li0\ri0\nowidctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\f11\fs11\cf1\cgrid0 Neko is not just available for Windows 95/98.
|
||||
\par
|
||||
\par }\pard\plain \s1\ql \li0\ri0\keepn\nowidctlpar\faauto\outlinelevel0\adjustright\rin0\lin0\itap0 \b\f11\fs11\cf1\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {Windows 3.0/3.1
|
||||
\par }\pard\plain \ql \li0\ri0\nowidctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\f11\fs11\cf1\cgrid0
|
||||
This was written by a different author than this version and developed long before Neko95. It's designed for Windows 3.0 and the archive name is 'Neko20.zip'. You should be able to find it on most Windows 3.0 shareware sites, or from:
|
||||
\par ftp://ftp.cdrom.com/.2/games/windows/jokes/neko20.zip
|
||||
\par
|
||||
\par }\pard\plain \s1\ql \li0\ri0\keepn\nowidctlpar\faauto\outlinelevel0\adjustright\rin0\lin0\itap0 \b\f11\fs11\cf1\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {X-Windows
|
||||
\par }\pard\plain \ql \li0\ri0\nowidctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\f11\fs11\cf1\cgrid0 The Neko source files are available for most X-Windows UNIX variants etc. This is th
|
||||
e original version and it should be on almost every X-Windows site in the world!
|
||||
\par
|
||||
\par }\pard\plain \s1\ql \li0\ri0\keepn\nowidctlpar\faauto\outlinelevel0\adjustright\rin0\lin0\itap0 \b\f11\fs11\cf1\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {Mac
|
||||
\par }\pard\plain \ql \li0\ri0\nowidctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\f11\fs11\cf1\cgrid0 It is rumoured that a Mac version exists, but it isn't known where it can be downloaded.
|
||||
\par
|
||||
\par The author is not going to write a Mac version of Neko, mainly because he doesn't have a Mac. If you would like to port Neko to the Mac, feel free to use the Neko95 source files in any way you like!
|
||||
\par
|
||||
\par }\pard\plain \s1\ql \li0\ri0\keepn\nowidctlpar\faauto\outlinelevel0\adjustright\rin0\lin0\itap0 \b\f11\fs11\cf1\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {OS/2
|
||||
\par }\pard\plain \ql \li0\ri0\nowidctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\f11\fs11\cf1\cgrid0 An OS/2 version of Neko was released with one versi
|
||||
on of OS/2 - it is believed that it was called "Boris" and chased a butterfly. Little else is known about this and it is not believed that it is available on the Internet for free.
|
||||
\par
|
||||
\par }\pard\plain \s1\ql \li0\ri0\keepn\nowidctlpar\faauto\outlinelevel0\adjustright\rin0\lin0\itap0 \b\f11\fs11\cf1\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {Java
|
||||
\par }\pard\plain \ql \li0\ri0\nowidctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\f11\fs11\cf1\cgrid0 There are a couple of implementations of Neko for Java around the web... some better than others.
|
||||
\par The best that the author has seen is at:
|
||||
\par http://acm.cs.umn.edu/~chaz/html/jneko.htm.
|
||||
\par
|
||||
\par Alternatively, you can use the term "applet:neko" on http://www.altavista.digital.com to search for Neko Java Applets.\page }{\cs18\f11\fs11\cf1\super\cgrid0 #{\footnote\ftnalt \pard\plain \s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0
|
||||
\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super #}{ Other_Programs}}${\footnote\ftnalt \pard\plain \s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super $}{
|
||||
Other Programs}}K{\footnote\ftnalt \pard\plain \s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super K}{ Freeware; By The Same Author}}}{\f11\fs11\cf1\cgrid0
|
||||
\par }{\b\f11\fs11\cf1\cgrid0 Other Programs}{\f11\fs11\cf1\cgrid0
|
||||
\par The author has written other }{\f11\fs11\cf6\cgrid0 freeware}{\f11\fs11\cf1\cgrid0 programs, which are available from:
|
||||
\par http://www.geocities.com/SiliconValley/Haven/4173/
|
||||
\par
|
||||
\par \page }{\cs18\f11\fs11\super #{\footnote\ftnalt \pard\plain \s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super #}{\f11\lang1031\langfe1033\cgrid0\langnp1031 Neko98}}$
|
||||
{\footnote\ftnalt \pard\plain \s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super $}{\f11\lang1031\langfe1033\cgrid0\langnp1031 Neko98}}K{\footnote\ftnalt \pard\plain
|
||||
\s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super K}{\f11\lang1031\langfe1033\cgrid0\langnp1031 License;Terms Of Use;About}}}{\f11\fs11\cf1\cgrid0
|
||||
\par }{\b\f11\fs11\cf1\cgrid0 Neko95/98}{\f11\fs11\cf1\cgrid0 was ported by David Harvey from the original X-Windows source code by Masayuki Koba.
|
||||
\par
|
||||
\par }\pard \ql \li0\ri0\nowidctlpar\faauto\outlinelevel0\adjustright\rin0\lin0\itap0 {\b\f11\fs11\cf1\cgrid0 License
|
||||
\par }\pard \ql \li0\ri0\nowidctlpar\faauto\adjustright\rin0\lin0\itap0 {\f11\fs11\cf1\cgrid0 This program is FREEWARE. This means that yo
|
||||
u can distribute it to anyone you like, as long as no fee is charged (except for a small disk-copying fee) and that every file is passed on.
|
||||
\par
|
||||
\par }\pard \ql \li0\ri0\nowidctlpar\faauto\outlinelevel0\adjustright\rin0\lin0\itap0 {\b\f11\fs11\cf1\cgrid0 Terms Of Use
|
||||
\par }\pard \ql \li0\ri0\nowidctlpar\faauto\adjustright\rin0\lin0\itap0 {\f11\fs11\cf1\cgrid0 This program is totally unsupported and you use it at your own risk. Neither the author nor anyone in
|
||||
volved in the distribution of this program can be held responsible for any damage or loss of revenue that the use of this program may cause.
|
||||
\par }\pard\plain \s21\ql \li0\ri0\nowidctlpar\faauto\adjustright\rin0\lin0\itap0 \f11\fs11\cf1\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {
|
||||
As this program is unsupported, the author is under no obligation to read or reply to any questions regarding the operation of this program.
|
||||
\par \page }{\cs18\super #{\footnote\ftnalt \pard\plain \s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super #}{ Whats_New}}${\footnote\ftnalt \pard\plain
|
||||
\s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super $}{ What's New}}K{\footnote\ftnalt \pard\plain \s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0
|
||||
\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super K}{ New in version 4.0g}}}{
|
||||
\par }{\b What's New
|
||||
\par }{New in Neko for Windows 95/98 version 4g:
|
||||
\par
|
||||
\par {\pntext\pard\plain\s21 \f3\fs11\cf1\lang2057\langfe1033\langnp2057 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \s21\ql \fi-360\li360\ri0\nowidctlpar\jclisttab\tx360{\*\pn \pnlvlblt\ilvl0\ls1\pnrnot0\pnf3\pnstart1\pnindent360\pnsp120\pnhang{\pntxtb \'b7}}
|
||||
\faauto\ls1\adjustright\rin0\lin360\itap0 {Footprints
|
||||
\par {\pntext\pard\plain\s21 \f3\fs11\cf1\lang2057\langfe1033\langnp2057 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \s21\ql \fi-360\li360\ri0\nowidctlpar\jclisttab\tx360{\*\pn \pnlvlblt\ilvl0\ls1\pnrnot0\pnf3\pnstart1\pnindent360\pnsp120\pnhang{\pntxtb \'b7}}
|
||||
\faauto\ls1\adjustright\rin0\lin360\itap0 {Always on top bug fix. This should (hopefully!!!) squash the always on top crash bug.
|
||||
\par }\pard \s21\ql \li0\ri0\nowidctlpar\faauto\adjustright\rin0\lin0\itap0 {
|
||||
\par \page }{\cs18\super #{\footnote\ftnalt \pard\plain \s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super #}{ Active_Desktop}}${\footnote\ftnalt \pard\plain
|
||||
\s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super $}{ Active Desktop}}K{\footnote\ftnalt \pard\plain \s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0
|
||||
\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super K}{ Active Desktop; Flicker}}}{
|
||||
\par }{\b Active Desktop Flicker}{
|
||||
\par If you have chosen an animated .gif file as your wallpaper, Neko will flicker quite badly. It is recommended that instead of selecting the animated .gif as wallpaper, you add it as an activ
|
||||
e desktop component, via the 'web' tab in your display properties. This will mean that Neko will not flicker unless running directly over the picture.
|
||||
\par If you have selected to 'tile' the animated .gif, rather than 'center' it, it is not possible to eliminate the flickering.
|
||||
\par
|
||||
\par }{\b Technical Description of the Cause
|
||||
\par }{The flickering is due to the fact that Windows is drawing the desktop at the same time as Neko is being drawn. Because Windows doesn't control Neko, these two drawings are out of sync, and Windows erase
|
||||
s the picture of Neko on the desktop and Neko then erases himself as well. These two factors combine to make Neko appear and disappear quickly, causing the flicker.
|
||||
\par \page }{\cs18\super #{\footnote\ftnalt \pard\plain \s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super #}{ Common_Problems}}${\footnote\ftnalt \pard\plain
|
||||
\s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0 \fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super $}{ Common Problems}}K{\footnote\ftnalt \pard\plain \s15\ql \li0\ri0\widctlpar\faauto\adjustright\rin0\lin0\itap0
|
||||
\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\cs18\super K}{ Sounds Don\rquote t Work; FAQ; Common Problems}}}{
|
||||
\par }{\b Common Problems}{
|
||||
\par
|
||||
\par }{\ul I can't get the sounds to work!
|
||||
\par {\pntext\pard\plain\s21 \f3\fs11\cf1\lang2057\langfe1033\langnp2057 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \s21\ql \fi-360\li360\ri0\nowidctlpar\jclisttab\tx360{\*\pn \pnlvlblt\ilvl0\ls2\pnrnot0\pnf3\pnstart1\pnindent360\pnsp120\pnhang{\pntxtb \'b7}}
|
||||
\faauto\ls2\adjustright\rin0\lin360\itap0 {Make sure that the frequency slider is not set to "none".
|
||||
\par {\pntext\pard\plain\s21 \f3\fs11\cf1\lang2057\langfe1033\langnp2057 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \s21\ql \fi-360\li360\ri0\nowidctlpar\jclisttab\tx360{\*\pn \pnlvlblt\ilvl0\ls2\pnrnot0\pnf3\pnstart1\pnindent360\pnsp120\pnhang{\pntxtb \'b7}}
|
||||
\faauto\ls2\adjustright\rin0\lin360\itap0 {Make sure that you have a valid .wav file selected for each event - download the sample sound pack from the Neko home page.
|
||||
\par }\pard \s21\ql \li0\ri0\nowidctlpar\faauto\adjustright\rin0\lin0\itap0 {
|
||||
\par }{\ul How can I make Neko start when I start my computer?}{
|
||||
\par Follow these steps:
|
||||
\par {\pntext\pard\plain\s21 \f11\fs11\cf1\lang2057\langfe1033\langnp2057 \hich\af11\dbch\af0\loch\f11 1.\tab}}\pard \s21\ql \fi-360\li360\ri0\nowidctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls3\pnrnot0\pndec\pnstart1\pnindent360\pnsp120\pnhang{\pntxta .}}
|
||||
\faauto\ls3\adjustright\rin0\lin360\itap0 {Click on the start button.
|
||||
\par {\pntext\pard\plain\s21 \f11\fs11\cf1\lang2057\langfe1033\langnp2057 \hich\af11\dbch\af0\loch\f11 2.\tab}}\pard \s21\ql \fi-360\li360\ri0\nowidctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls3\pnrnot0\pndec\pnstart1\pnindent360\pnsp120\pnhang{\pntxta .}}
|
||||
\faauto\ls3\adjustright\rin0\lin360\itap0 {Select settings, followed by taskbar.
|
||||
\par {\pntext\pard\plain\s21 \f11\fs11\cf1\lang2057\langfe1033\langnp2057 \hich\af11\dbch\af0\loch\f11 3.\tab}}\pard \s21\ql \fi-360\li360\ri0\nowidctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls3\pnrnot0\pndec\pnstart1\pnindent360\pnsp120\pnhang{\pntxta .}}
|
||||
\faauto\ls3\adjustright\rin0\lin360\itap0 {Click the "Start Menu Programs" tab on the window that appears.
|
||||
\par {\pntext\pard\plain\s21 \f11\fs11\cf1\lang2057\langfe1033\langnp2057 \hich\af11\dbch\af0\loch\f11 4.\tab}}\pard \s21\ql \fi-360\li360\ri0\nowidctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls3\pnrnot0\pndec\pnstart1\pnindent360\pnsp120\pnhang{\pntxta .}}
|
||||
\faauto\ls3\adjustright\rin0\lin360\itap0 {Click the "Add..." button.
|
||||
\par {\pntext\pard\plain\s21 \f11\fs11\cf1\lang2057\langfe1033\langnp2057 \hich\af11\dbch\af0\loch\f11 5.\tab}}\pard \s21\ql \fi-360\li360\ri0\nowidctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls3\pnrnot0\pndec\pnstart1\pnindent360\pnsp120\pnhang{\pntxta .}}
|
||||
\faauto\ls3\adjustright\rin0\lin360\itap0 {Click "Browse", select the Neko program and click "Next"
|
||||
\par {\pntext\pard\plain\s21 \f11\fs11\cf1\lang2057\langfe1033\langnp2057 \hich\af11\dbch\af0\loch\f11 6.\tab}}\pard \s21\ql \fi-360\li360\ri0\nowidctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls3\pnrnot0\pndec\pnstart1\pnindent360\pnsp120\pnhang{\pntxta .}}
|
||||
\faauto\ls3\adjustright\rin0\lin360\itap0 {In the list of folders, choose "StartUp" and click "Next"
|
||||
\par {\pntext\pard\plain\s21 \f11\fs11\cf1\lang2057\langfe1033\langnp2057 \hich\af11\dbch\af0\loch\f11 7.\tab}}\pard \s21\ql \fi-360\li360\ri0\nowidctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls3\pnrnot0\pndec\pnstart1\pnindent360\pnsp120\pnhang{\pntxta .}}
|
||||
\faauto\ls3\adjustright\rin0\lin360\itap0 {Click "Finish"
|
||||
\par }\pard \s21\ql \li0\ri0\nowidctlpar\faauto\adjustright\rin0\lin0\itap0 {
|
||||
\par }{\ul I can't delete the Neko configuration program or the main Neko program - it says that it's being used by Windows
|
||||
\par {\pntext\pard\plain\s21 \f3\fs11\cf1\lang2057\langfe1033\langnp2057 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \s21\ql \fi-360\li360\ri0\nowidctlpar\jclisttab\tx360{\*\pn \pnlvlblt\ilvl0\ls4\pnrnot0\pnf3\pnstart1\pnindent360\pnsp120\pnhang{\pntxtb \'b7}}
|
||||
\faauto\ls4\adjustright\rin0\lin360\itap0 {Make sure that the program isn't running.
|
||||
\par {\pntext\pard\plain\s21 \f3\fs11\cf1\lang2057\langfe1033\langnp2057 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \s21\ql \fi-360\li360\ri0\nowidctlpar\jclisttab\tx360{\*\pn \pnlvlblt\ilvl0\ls4\pnrnot0\pnf3\pnstart1\pnindent360\pnsp120\pnhang{\pntxtb \'b7}}
|
||||
\faauto\ls4\adjustright\rin0\lin360\itap0 {If Neko is running, run the program a second time - this will close Neko.
|
||||
\par }\pard \s21\ql \li0\ri0\nowidctlpar\faauto\adjustright\rin0\lin0\itap0 {
|
||||
\par }}
|
||||
73
nkosrc4/Neko98/NekoSettings.cpp
Executable file
@@ -0,0 +1,73 @@
|
||||
/************************************
|
||||
|
||||
Neko's configuration
|
||||
|
||||
*************************************/
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include "NekoSettings.h"
|
||||
|
||||
CNekoSettings::CNekoSettings( LPCSTR key, BOOL fCreate /*TRUE*/ )
|
||||
{
|
||||
m_hKey = NULL;
|
||||
if( fCreate )
|
||||
{
|
||||
DWORD dwDisposition;
|
||||
RegCreateKeyEx( HKEY_CURRENT_USER, key, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &m_hKey, &dwDisposition );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( RegOpenKeyEx( HKEY_CURRENT_USER, key, 0, KEY_READ|KEY_WRITE, &m_hKey ) != ERROR_SUCCESS )
|
||||
m_hKey = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
CNekoSettings::~CNekoSettings()
|
||||
{
|
||||
if( m_hKey ) RegCloseKey( m_hKey );
|
||||
}
|
||||
|
||||
BOOL CNekoSettings::IsOpen()
|
||||
{
|
||||
return( m_hKey != NULL );
|
||||
}
|
||||
|
||||
BOOL CNekoSettings::GetString( LPCSTR keyname, LPSTR result, ULONG size )
|
||||
{
|
||||
DWORD dwType;
|
||||
return ( RegQueryValueEx( m_hKey, keyname, NULL, &dwType, (LPBYTE)result, &size ) == ERROR_SUCCESS );
|
||||
}
|
||||
|
||||
BOOL CNekoSettings::GetInt( LPCSTR keyname, DWORD * result )
|
||||
{
|
||||
DWORD dwType;
|
||||
ULONG ulSize = sizeof(DWORD);
|
||||
return ( RegQueryValueEx( m_hKey, keyname, NULL, &dwType, (LPBYTE)result, &ulSize ) == ERROR_SUCCESS );
|
||||
}
|
||||
|
||||
BOOL CNekoSettings::GetBool( LPCSTR keyname, BOOL * result )
|
||||
{
|
||||
DWORD dwType;
|
||||
ULONG ulSize = sizeof(BOOL);
|
||||
return ( RegQueryValueEx( m_hKey, keyname, NULL, &dwType, (LPBYTE)result, &ulSize ) == ERROR_SUCCESS );
|
||||
}
|
||||
|
||||
|
||||
BOOL CNekoSettings::SetString( LPCSTR keyname, LPSTR value )
|
||||
{
|
||||
ULONG ulSize = strlen( value ) + 1;
|
||||
return ( RegSetValueEx( m_hKey, keyname, NULL, REG_SZ, (LPBYTE)value, ulSize) == ERROR_SUCCESS );
|
||||
}
|
||||
|
||||
BOOL CNekoSettings::SetInt( LPCSTR keyname, DWORD value )
|
||||
{
|
||||
ULONG ulSize = sizeof(DWORD);
|
||||
return ( RegSetValueEx( m_hKey, keyname, NULL, REG_DWORD, (LPBYTE)&value, ulSize ) == ERROR_SUCCESS );
|
||||
}
|
||||
|
||||
BOOL CNekoSettings::SetBool( LPCSTR keyname, BOOL value )
|
||||
{
|
||||
ULONG ulSize = sizeof(BOOL);
|
||||
return ( RegSetValueEx( m_hKey, keyname, NULL, REG_BINARY, (LPBYTE)&value, ulSize ) == ERROR_SUCCESS );
|
||||
}
|
||||
28
nkosrc4/Neko98/NekoSettings.h
Executable file
@@ -0,0 +1,28 @@
|
||||
/************************************
|
||||
|
||||
Neko's configuration header file
|
||||
|
||||
*************************************/
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include "NekoCommon.h"
|
||||
|
||||
class CNekoSettings {
|
||||
public:
|
||||
CNekoSettings( LPCSTR key, BOOL fCreate = TRUE );
|
||||
~CNekoSettings();
|
||||
|
||||
BOOL IsOpen();
|
||||
|
||||
BOOL GetString( LPCSTR keyname, LPSTR result, ULONG size );
|
||||
BOOL GetInt( LPCSTR keyname, DWORD * result );
|
||||
BOOL GetBool( LPCSTR keyname, BOOL * result );
|
||||
|
||||
BOOL SetString( LPCSTR keyname, LPSTR value );
|
||||
BOOL SetInt( LPCSTR keyname, DWORD value );
|
||||
BOOL SetBool( LPCSTR keyname, BOOL value );
|
||||
|
||||
private:
|
||||
HKEY m_hKey;
|
||||
};
|
||||
159
nkosrc4/Neko98/Pet.cpp
Executable file
@@ -0,0 +1,159 @@
|
||||
// Pet.cpp: implementation of the CPet class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "Pet.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CPet::CPet()
|
||||
{
|
||||
//prepare empty icon table
|
||||
m_nIcons = 0;
|
||||
m_nLastIcon = -1;
|
||||
m_hIcons = NULL;
|
||||
|
||||
//set initial and old position
|
||||
m_ptPosition.x = 0;
|
||||
m_ptPosition.y = 0;
|
||||
m_ptOldPosition.x = -1;
|
||||
m_ptOldPosition.y = -1;
|
||||
|
||||
//set initial size and scale
|
||||
m_sizeImage.cx = 0;
|
||||
m_sizeImage.cy = 0;
|
||||
m_fScale = 1.0f;
|
||||
|
||||
//set initial bounding box (none)
|
||||
SetRect( &m_rcBounds, -1, -1, -1, -1 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
CPet::~CPet()
|
||||
{
|
||||
//delete the images
|
||||
DestroyImages();
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Member Functions
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
void CPet::SetImages( HICON* hIconTable, int nIcons )
|
||||
{
|
||||
//delete current images
|
||||
DestroyImages();
|
||||
|
||||
//we can't have 0 images
|
||||
if( nIcons <= 0 )
|
||||
{
|
||||
nIcons = 1;
|
||||
#ifdef DEBUG
|
||||
OutputDebugString( "WARNING: CPet::SetImages() passed 0 as nIcons\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
//FIXME: it might be possible to use CopyImage() passing it the *scaled* width and height
|
||||
//in combination with the LR_COPYFROMRESOURCE. This might fix the non-32x32 icon problem
|
||||
|
||||
//allocate icon table and clear all entries
|
||||
m_hIcons = new HICON[nIcons];
|
||||
for( int i = 0; i < nIcons; i++ ) m_hIcons[i] = CopyIcon(hIconTable[i]);
|
||||
|
||||
//store icon table size and set last drawn icon index
|
||||
m_nIcons = nIcons;
|
||||
m_nLastIcon = -1;
|
||||
|
||||
//get size of first icon
|
||||
ICONINFO ii;
|
||||
GetIconInfo( m_hIcons[0], &ii );
|
||||
|
||||
BITMAP bm;
|
||||
GetObject( ii.hbmMask, sizeof(BITMAP), &bm );
|
||||
DeleteObject( ii.hbmMask );
|
||||
DeleteObject( ii.hbmColor );
|
||||
|
||||
//calculate scaled size
|
||||
m_sizeImage.cx = int( bm.bmWidth * m_fScale );
|
||||
m_sizeImage.cy = int( bm.bmHeight * m_fScale );
|
||||
}
|
||||
|
||||
|
||||
|
||||
void CPet::DestroyImages()
|
||||
{
|
||||
//delete all images, if any
|
||||
if( m_nIcons > 0 )
|
||||
{
|
||||
//delete all icons in the table
|
||||
for( int i = 0; i < m_nIcons; i++ ) DestroyIcon( m_hIcons[i] );
|
||||
|
||||
//delete the table
|
||||
delete[] m_hIcons;
|
||||
m_hIcons = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void CPet::SetImage( int nImage )
|
||||
{
|
||||
//only draw if the image has changed
|
||||
if( nImage != m_nLastIcon )
|
||||
{
|
||||
Erase();
|
||||
Draw( nImage );
|
||||
m_nLastIcon = nImage;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void CPet::MoveTo(int nNewX, int nNewY)
|
||||
{
|
||||
if( m_ptOldPosition.x == -1 )
|
||||
{
|
||||
//set old position to the current position as we've not been moved before
|
||||
m_ptOldPosition.x = nNewX;
|
||||
m_ptOldPosition.y = nNewY;
|
||||
}
|
||||
else
|
||||
{
|
||||
//store current position
|
||||
m_ptOldPosition.x = m_ptPosition.x;
|
||||
m_ptOldPosition.y = m_ptPosition.y;
|
||||
}
|
||||
|
||||
//remove current
|
||||
Erase();
|
||||
|
||||
//change current position
|
||||
m_ptPosition.x = nNewX;
|
||||
m_ptPosition.y = nNewY;
|
||||
|
||||
//redraw
|
||||
Draw( m_nLastIcon );
|
||||
}
|
||||
|
||||
void CPet::SetImageAndMoveTo(int nImage, int nNewX, int nNewY)
|
||||
{
|
||||
//change image
|
||||
m_nLastIcon = nImage;
|
||||
|
||||
//move
|
||||
MoveTo( nNewX, nNewY );
|
||||
}
|
||||
|
||||
|
||||
void CPet::SetScale(float fScale)
|
||||
{
|
||||
if( fScale != 0.0f )
|
||||
m_fScale = fScale;
|
||||
else
|
||||
m_fScale = 1.0f;
|
||||
}
|
||||
63
nkosrc4/Neko98/Pet.h
Executable file
@@ -0,0 +1,63 @@
|
||||
// Pet.h: interface for the CPet class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_PET_H__A69EBAA0_385D_11D2_9FF9_00001C192944__INCLUDED_)
|
||||
#define AFX_PET_H__A69EBAA0_385D_11D2_9FF9_00001C192944__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
||||
class CPet {
|
||||
|
||||
public:
|
||||
//constructor/destructor
|
||||
CPet();
|
||||
virtual ~CPet();
|
||||
|
||||
//public configuration functions
|
||||
virtual void SetImages( HICON* hIconTable, int nIcons );
|
||||
virtual void SetScale( float fScale );
|
||||
|
||||
//public interface
|
||||
virtual void SetImageAndMoveTo( int nImage, int nNewX, int nNewY );
|
||||
virtual void MoveTo( int nNewX, int nNewY );
|
||||
virtual void SetImage( int nImage );
|
||||
|
||||
virtual void DrawOnTarget( int x, int y, HICON hIcon ) {}; //no default implementation
|
||||
|
||||
//data member access
|
||||
inline RECT GetBoundsRect() { return m_rcBounds; };
|
||||
inline POINT& GetPosition() { return m_ptPosition; };
|
||||
inline POINT& GetOldPosition() { return m_ptOldPosition; };
|
||||
inline SIZE GetSize() { return m_sizeImage; };
|
||||
|
||||
protected:
|
||||
|
||||
//pure virtual functions
|
||||
virtual void Erase() = 0;
|
||||
virtual void Draw( int nImage ) = 0;
|
||||
|
||||
//image destruction
|
||||
virtual void DestroyImages();
|
||||
|
||||
//icon information
|
||||
HICON* m_hIcons;
|
||||
int m_nIcons;
|
||||
int m_nLastIcon;
|
||||
|
||||
//position & size information
|
||||
POINT m_ptPosition;
|
||||
POINT m_ptOldPosition;
|
||||
SIZE m_sizeImage;
|
||||
float m_fScale;
|
||||
|
||||
//bounding box information
|
||||
RECT m_rcBounds;
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_PET_H__A69EBAA0_385D_11D2_9FF9_00001C192944__INCLUDED_)
|
||||
BIN
nkosrc4/Neko98/Res/Awake.ico
Executable file
|
After Width: | Height: | Size: 766 B |
BIN
nkosrc4/Neko98/Res/Down1.ico
Executable file
|
After Width: | Height: | Size: 766 B |
BIN
nkosrc4/Neko98/Res/Downleft2.ico
Executable file
|
After Width: | Height: | Size: 766 B |
BIN
nkosrc4/Neko98/Res/Downright1.ico
Executable file
|
After Width: | Height: | Size: 766 B |
BIN
nkosrc4/Neko98/Res/Right1.ico
Executable file
|
After Width: | Height: | Size: 766 B |
BIN
nkosrc4/Neko98/Res/Rightclaw2.ico
Executable file
|
After Width: | Height: | Size: 766 B |
BIN
nkosrc4/Neko98/Res/Up1.ico
Executable file
|
After Width: | Height: | Size: 766 B |
BIN
nkosrc4/Neko98/Res/Up2.ico
Executable file
|
After Width: | Height: | Size: 766 B |
BIN
nkosrc4/Neko98/Res/Upleft1.ico
Executable file
|
After Width: | Height: | Size: 766 B |
BIN
nkosrc4/Neko98/Res/Upleft2.ico
Executable file
|
After Width: | Height: | Size: 766 B |
BIN
nkosrc4/Neko98/Res/Upright1.ico
Executable file
|
After Width: | Height: | Size: 766 B |
BIN
nkosrc4/Neko98/Res/Upright2.ico
Executable file
|
After Width: | Height: | Size: 766 B |
BIN
nkosrc4/Neko98/Res/down2.ico
Executable file
|
After Width: | Height: | Size: 766 B |
BIN
nkosrc4/Neko98/Res/downclaw1.ico
Executable file
|
After Width: | Height: | Size: 766 B |
BIN
nkosrc4/Neko98/Res/downclaw2.ico
Executable file
|
After Width: | Height: | Size: 766 B |
BIN
nkosrc4/Neko98/Res/downleft1.ico
Executable file
|
After Width: | Height: | Size: 766 B |
BIN
nkosrc4/Neko98/Res/downright2.ico
Executable file
|
After Width: | Height: | Size: 766 B |
BIN
nkosrc4/Neko98/Res/fp_down.ico
Executable file
|
After Width: | Height: | Size: 766 B |
BIN
nkosrc4/Neko98/Res/fp_downleft.ico
Executable file
|
After Width: | Height: | Size: 766 B |
BIN
nkosrc4/Neko98/Res/fp_downright.ico
Executable file
|
After Width: | Height: | Size: 766 B |
BIN
nkosrc4/Neko98/Res/fp_left.ico
Executable file
|
After Width: | Height: | Size: 766 B |
BIN
nkosrc4/Neko98/Res/fp_right.ico
Executable file
|
After Width: | Height: | Size: 766 B |
BIN
nkosrc4/Neko98/Res/fp_up.ico
Executable file
|
After Width: | Height: | Size: 766 B |
BIN
nkosrc4/Neko98/Res/fp_upleft.ico
Executable file
|
After Width: | Height: | Size: 766 B |
BIN
nkosrc4/Neko98/Res/fp_upright.ico
Executable file
|
After Width: | Height: | Size: 766 B |
BIN
nkosrc4/Neko98/Res/left1.ico
Executable file
|
After Width: | Height: | Size: 766 B |
BIN
nkosrc4/Neko98/Res/left2.ico
Executable file
|
After Width: | Height: | Size: 766 B |
BIN
nkosrc4/Neko98/Res/leftclaw1.ico
Executable file
|
After Width: | Height: | Size: 766 B |
BIN
nkosrc4/Neko98/Res/leftclaw2.ico
Executable file
|
After Width: | Height: | Size: 766 B |
BIN
nkosrc4/Neko98/Res/right2.ico
Executable file
|
After Width: | Height: | Size: 766 B |
BIN
nkosrc4/Neko98/Res/rightclaw1.ico
Executable file
|
After Width: | Height: | Size: 766 B |
BIN
nkosrc4/Neko98/Res/scratch1.ico
Executable file
|
After Width: | Height: | Size: 766 B |
BIN
nkosrc4/Neko98/Res/scratch2.ico
Executable file
|
After Width: | Height: | Size: 766 B |
BIN
nkosrc4/Neko98/Res/sleep1.ico
Executable file
|
After Width: | Height: | Size: 766 B |
BIN
nkosrc4/Neko98/Res/sleep2.ico
Executable file
|
After Width: | Height: | Size: 766 B |
BIN
nkosrc4/Neko98/Res/upclaw1.ico
Executable file
|
After Width: | Height: | Size: 766 B |
BIN
nkosrc4/Neko98/Res/upclaw2.ico
Executable file
|
After Width: | Height: | Size: 766 B |
BIN
nkosrc4/Neko98/Res/wash2.ico
Executable file
|
After Width: | Height: | Size: 766 B |
BIN
nkosrc4/Neko98/Res/yawn2.ico
Executable file
|
After Width: | Height: | Size: 766 B |
BIN
nkosrc4/Neko98/Res/yawn3.ico
Executable file
|
After Width: | Height: | Size: 766 B |
76
nkosrc4/Neko98/Tray.cpp
Executable file
@@ -0,0 +1,76 @@
|
||||
/************************************
|
||||
|
||||
Tray Class: Very simple interface
|
||||
onto the system tray for Neko95
|
||||
|
||||
*************************************/
|
||||
|
||||
#include <windows.h>
|
||||
#include <string.h>
|
||||
#include "tray.h"
|
||||
#include "resource.h"
|
||||
|
||||
BOOL CTray::AddIcon( HWND hWnd, HICON hIcon, UINT uID )
|
||||
{
|
||||
BOOL res;
|
||||
NOTIFYICONDATA tnid;
|
||||
|
||||
//fill in the structure
|
||||
tnid.cbSize = sizeof(NOTIFYICONDATA);
|
||||
tnid.hWnd = hWnd;
|
||||
tnid.uID = uID;
|
||||
tnid.uFlags = NIF_MESSAGE|NIF_ICON|NIF_TIP;
|
||||
tnid.uCallbackMessage = MY_NOTIFYICON;
|
||||
tnid.hIcon = hIcon;
|
||||
strncpy( tnid.szTip, "Neko", sizeof(tnid.szTip) );
|
||||
|
||||
//give the command
|
||||
res = Shell_NotifyIcon( NIM_ADD, &tnid );
|
||||
|
||||
//delete the icon
|
||||
DestroyIcon( tnid.hIcon );
|
||||
|
||||
//increment the counter
|
||||
if( res ) m_uIconCount++;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
BOOL CTray::RemoveIcon( HWND hWnd, UINT uID )
|
||||
{
|
||||
BOOL res;
|
||||
NOTIFYICONDATA tnid;
|
||||
|
||||
//fill in the structure
|
||||
tnid.cbSize = sizeof(NOTIFYICONDATA);
|
||||
tnid.hWnd = hWnd;
|
||||
tnid.uID = uID;
|
||||
|
||||
//give the notify command
|
||||
res = Shell_NotifyIcon( NIM_DELETE, &tnid );
|
||||
|
||||
//decrement the counter
|
||||
if( res ) m_uIconCount--;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
void CTray::ShowPopupMenu( HWND hWnd )
|
||||
{
|
||||
//get the mouse position
|
||||
POINT mouse;
|
||||
GetCursorPos( &mouse );
|
||||
|
||||
//create the popup menu
|
||||
HMENU hMenu = CreatePopupMenu();
|
||||
AppendMenu( hMenu, MF_STRING, ID_SETTINGS,"&Settings" );
|
||||
AppendMenu( hMenu, MF_STRING, ID_EXIT, "E&xit" );
|
||||
SetMenuDefaultItem( hMenu, ID_SETTINGS, FALSE );
|
||||
|
||||
//display the menu
|
||||
TrackPopupMenu( hMenu, TPM_LEFTALIGN | TPM_RIGHTBUTTON, mouse.x, mouse.y, 0, hWnd, NULL );
|
||||
|
||||
//destroy it
|
||||
DestroyMenu(hMenu);
|
||||
}
|
||||
|
||||
35
nkosrc4/Neko98/Tray.h
Executable file
@@ -0,0 +1,35 @@
|
||||
/************************************
|
||||
|
||||
Tray Class: Very simple interface
|
||||
onto the system tray
|
||||
|
||||
*************************************/
|
||||
|
||||
#ifndef _TRAY_HPP
|
||||
#define _TRAY_HPP
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
||||
//taskbar notification message
|
||||
#define MY_NOTIFYICON (WM_USER+32)
|
||||
|
||||
|
||||
class CTray {
|
||||
|
||||
public:
|
||||
CTray( HINSTANCE hInstance ) { m_uIconCount = 0; m_hInstance = hInstance; };
|
||||
|
||||
BOOL AddIcon( HWND hWnd, HICON hIcon, UINT uID );
|
||||
BOOL RemoveIcon( HWND hWnd, UINT uID );
|
||||
|
||||
void ShowPopupMenu( HWND hWnd );
|
||||
|
||||
UINT GetCount() { return m_uIconCount; };
|
||||
|
||||
private:
|
||||
UINT m_uIconCount;
|
||||
HINSTANCE m_hInstance;
|
||||
};
|
||||
|
||||
#endif
|
||||
61
nkosrc4/Neko98/resource.h
Executable file
@@ -0,0 +1,61 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by Neko95.rc
|
||||
//
|
||||
#define IDI_AWAKE 101
|
||||
#define ID_SETTINGS 101
|
||||
#define IDI_UP1 102
|
||||
#define ID_EXIT 102
|
||||
#define IDI_UP2 103
|
||||
#define ID_TIMER_NEKOUPDATE 103
|
||||
#define IDI_UPRIGHT1 104
|
||||
#define ID_TIMER_NEKO 104
|
||||
#define IDI_UPRIGHT2 105
|
||||
#define IDI_RIGHT1 106
|
||||
#define IDI_RIGHT2 107
|
||||
#define IDI_DOWNRIGHT1 108
|
||||
#define IDI_DOWNRIGHT2 109
|
||||
#define IDI_DOWN1 110
|
||||
#define IDI_DOWN2 111
|
||||
#define IDI_DOWNLEFT1 112
|
||||
#define IDI_DOWNLEFT2 113
|
||||
#define IDI_LEFT1 114
|
||||
#define IDI_LEFT2 115
|
||||
#define IDI_UPLEFT1 116
|
||||
#define IDI_UPLEFT2 117
|
||||
#define IDI_UPCLAW1 118
|
||||
#define IDI_UPCLAW2 119
|
||||
#define IDI_RIGHTCLAW1 120
|
||||
#define IDI_RIGHTCLAW2 121
|
||||
#define IDI_LEFTCLAW1 122
|
||||
#define IDI_LEFTCLAW2 123
|
||||
#define IDI_DOWNCLAW1 124
|
||||
#define IDI_DOWNCLAW2 125
|
||||
#define IDI_WASH2 126
|
||||
#define IDI_SCRATCH1 127
|
||||
#define IDI_SCRATCH2 128
|
||||
#define IDI_YAWN2 129
|
||||
#define IDI_YAWN3 130
|
||||
#define IDI_SLEEP1 131
|
||||
#define IDI_SLEEP2 132
|
||||
|
||||
#define IDI_FP_UP 133
|
||||
#define IDI_FP_UPRIGHT 134
|
||||
#define IDI_FP_RIGHT 135
|
||||
#define IDI_FP_DOWNRIGHT 136
|
||||
#define IDI_FP_DOWN 137
|
||||
#define IDI_FP_DOWNLEFT 138
|
||||
#define IDI_FP_LEFT 139
|
||||
#define IDI_FP_UPLEFT 140
|
||||
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 141
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1000
|
||||
#define _APS_NEXT_SYMED_VALUE 105
|
||||
#endif
|
||||
#endif
|
||||
BIN
nkosrc4/classes.doc
Executable file
41
nkosrc4/license.txt
Executable file
@@ -0,0 +1,41 @@
|
||||
Neko 95/98 Source Code License
|
||||
|
||||
Note: Because Neko was originally written by
|
||||
Masayuki Koba, and ported from his X-Windows
|
||||
source code by David Harvey, different portions
|
||||
of the Neko source code carry different licenses.
|
||||
|
||||
|
||||
IF YOU WANT TO CHARGE FOR YOUR SOFTWARE
|
||||
---------------------------------------
|
||||
If you use any of the following files in your software,
|
||||
you MAY NOT charge for it as it is covered by the GNU
|
||||
public license:
|
||||
Neko.h Neko.cpp
|
||||
Neko98.h Neko98.cpp
|
||||
|
||||
|
||||
If you use any of the following files in your software,
|
||||
you MAY charge for it, but must send 20% of the profit or
|
||||
from that software, or $1000 to the author (address at the bottom).
|
||||
Pet.h Pe1t.cpp
|
||||
DesktopHack.h DesktopHack.cpp
|
||||
DesktopPet.h DesktopPet.cpp
|
||||
AlwaysOnTopPet.h AlwaysOnTopPet.cpp
|
||||
|
||||
|
||||
All other files can be used freely as long as credit is given.
|
||||
|
||||
|
||||
IF YOU DO NOT WANT TO CHARGE FOR YOUR SOFTWARE
|
||||
----------------------------------------------
|
||||
You are free to use the source files in any way you wish,
|
||||
as long as credit is given.
|
||||
|
||||
|
||||
AUTHOR'S ADDRESS
|
||||
----------------
|
||||
dharvey@btinternet.com
|
||||
For security reasons, mail me and I'll give out my address.
|
||||
|
||||
|
||||