summaryrefslogtreecommitdiff
path: root/Info_Src.txt
blob: 6f0c1f4786d461544bab1478a96b5a5c5c4edd7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
 
Spam Filter 2.5.2.3 for Miranda IM 0.4.3+
------------------------------------------------------------------------
				Source Code

Reminder:
"Spam Filter" is released under the terms of the GNU General Public License.
See "Spam Filter-License.txt" for more details.
"Spam Filter" is copyright 2003-2005 by Heiko Herkenrath.


Please notify me of any changes that improve 
"Spam Filter" or add new features.
If you have any questions on the code, feel free
to contact me at my email address.
						
	H. Herkenrath (hrathh at users.sourceforge.net)


Notes
------------------------------------------------------------------------

## Version ###############################

The following files need to be changed to bump the version number:

Info_Src.txt (1 place)
version.h (1 place)
version.rc (5 places)
m_spamfilter.h (1 place)
m_spamfilter.inc (1 place)
Extensions\InstallScript.xml (1 place)
Docs\SpamFilter-Readme.txt (3 places)
Docs\SpamFilter-Translation.txt (2 or 3 places)
Docs\SpamFilter-Developer.txt (1 place)


## Unicode ##############################
TCHAR is a generic type for strings that maps to a WCHAR if compiled as Unicode
or to a regular char when compiled as ANSI.

All WinAPI functions arre mapped automatically to Unicode/ANSI.
iIf not called directly via their A or W prefixes.

C-Runtime functions need to be used in their _wcs* form to be mapped (ANSI/Unicode)

UnicoWS function overriding example:
static UINT __stdcall MyOleUIInsertObjectW (LPOLEUIINSERTOBJECTW lpouiiow)
{
   UINT result = OLEUI_CANCEL;
   OLEUIINSERTOBJECTA ouiioa;
   memcpy(&ouiioa, lpouiiow, sizeof (OLEUIINSERTOBJECTA));
   ouiioa.lpszFile = (char *)alloca (ouiioa.cchFile + 1);
   ouiioa.lpszFile [0] = '\0';
   result = OleUIInsertObjectA(&ouiioa);

   if (result == OLEUI_SUCCESS)
      {
      memcpy(lpouiiow,
      &ouiioa,
      sizeof(OLEUIINSERTOBJECTW));
      MultiByteToWideChar(CP_ACP,
      0,
      ouiioa.lpSzFile,
      ouiioa.cchFile,
      lpowiiow->lpszFile,
      lpowiiow->cchFile);
      }
   return result;
}
extern "C" FARPROC Unicows_OleUIInsertObjectW = (FARPROC)&MyOleUIInsertObjectW;


## Dialogs #############################
Use always for dialogs:
type:    DIALOGEX
font:    MS Shell Dlg
styles : DS_SHELLFONT | WS_VISIBLE | ...

NO use of: DS_3DLOOK or DISCARDABLE (deprecated)
DS_SYSMODAL -> WS_EX_TOPMOST
DS_FIXEDSYS -> DS_SHELLFONT

Warning: WS_EX_RTLREADING works also on non-arabic systems (Win 2000/XP)

No use of SetFocus(), instead:
PostMessage(hwndDlg, WM_NEXTDLGCTL, (WPARAM)hwndCtrl, (LPARAM)TRUE);

For dialogs use DWLP_USER instead of GWLP_USERDATA.

WM_USER+n messages are defined by the owner of the class (RegisterClass); 0<=n<=31000
WM_APP+n messages are defined by the owner of the window (CreateWindow);  0<=n<=16000

WM_CLOSE msg is transformed into an IDCANCEL of WM_COMMAND


## Sounds ##############################

Sound files should be converted into a
WAV-file, PCM format, 22,050Hz, 16bit, Stereo.


## Other ################################

Compiler Warnings at level 4 are sometimes too restrictive:
C4100: http://msdn2.microsoft.com/en-us/library/26kb9fy0

Random stuff a always tend to forget ;-)

o No use of static variables in DlgProcs/WindowProcs
o ^= operator is the  inverted operator |=