Initial commit

This commit is contained in:
Cesar Gimenes
2021-09-18 14:10:47 -03:00
parent 46f2228e15
commit e2607a94c0
131 changed files with 5312 additions and 0 deletions

View 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;
}

View 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

View 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
View 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 © 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

View 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;
}

View 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

View 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B