summaryrefslogtreecommitdiff
path: root/plugins/!NotAdopted/NotesAndReminders/src/miscutils.h
blob: 104de5313c6e39004208aff3d5e0ebea3e702df3 (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
void WriteSettingInt(HANDLE hContact,char *ModuleName,
					 char *SettingName,int Value);
int ReadSettingInt(HANDLE hContact,char *ModuleName,
				   char *SettingName,int Default);
void ReadSettingBlob(HANDLE hContact, char *ModuleName,
					 char *SettingName, WORD *pSize, void **pbBlob);
void WriteSettingBlob(HANDLE hContact,char *ModuleName,
					  char *SettingName,WORD pSize,void *pbBlob);
void FreeSettingBlob(WORD pSize,void * pbBlob);
BOOL ReadSettingBool(HANDLE hContact,char *ModuleName,
					 char *SettingName,BOOL Default);
void WriteSettingBool(HANDLE hContact,char *ModuleName,
					  char *SettingName,BOOL Value);
void DeleteSetting(HANDLE hContact,char *ModuleName,
				   char *SettingName);
void WriteSettingIntArray(HANDLE hContact,char *ModuleName,
					 char *SettingName,const int *Value, int Size);
BOOL ReadSettingIntArray(HANDLE hContact,char *ModuleName,
				   char *SettingName,int *Value, int Size);

extern BOOL (WINAPI *MySetLayeredWindowAttributes)(HWND,COLORREF,BYTE,DWORD);
extern HANDLE (WINAPI *MyMonitorFromWindow)(HWND,DWORD);
extern BOOL (WINAPI *MyTzSpecificLocalTimeToSystemTime)(LPTIME_ZONE_INFORMATION,LPSYSTEMTIME,LPSYSTEMTIME);
extern BOOL (WINAPI *MySystemTimeToTzSpecificLocalTime)(LPTIME_ZONE_INFORMATION,LPSYSTEMTIME,LPSYSTEMTIME);

WORD ConvertHotKeyToControl(WORD HK);
WORD ConvertControlToHotKey(WORD HK);

typedef struct {
	void *ptrdata;
	void *next;
} TREEELEMENT;

void TreeAdd(TREEELEMENT **root,void *Data);
void TreeAddSorted(TREEELEMENT **root,void *Data,int (*CompareCb)(TREEELEMENT*,TREEELEMENT*));
void TreeDelete(TREEELEMENT **root,void *Item);
void *TreeGetAt(TREEELEMENT *root,int Item);
int TreeGetCount(TREEELEMENT *root);

static void __inline SAFE_FREE(void** p)
{
	if (*p)
	{
		free(*p);
		*p = NULL;
	}
}