summaryrefslogtreecommitdiff
path: root/plugins/TooltipNotify/src/Utils.cpp
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2012-05-17 17:37:22 +0000
committerKirill Volinsky <mataes2007@gmail.com>2012-05-17 17:37:22 +0000
commit78d71d2cad6f243c6ff31d41380b8c5b58407de5 (patch)
treed0c05983b315352c5e66d23420da4b8fd8b5aff4 /plugins/TooltipNotify/src/Utils.cpp
parenta9e8daee448c229aa3f8ded0c5f5c0fe7aa42529 (diff)
added some plugins
git-svn-id: http://svn.miranda-ng.org/main/trunk@20 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TooltipNotify/src/Utils.cpp')
-rw-r--r--plugins/TooltipNotify/src/Utils.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/plugins/TooltipNotify/src/Utils.cpp b/plugins/TooltipNotify/src/Utils.cpp
new file mode 100644
index 0000000000..ce73dbc59b
--- /dev/null
+++ b/plugins/TooltipNotify/src/Utils.cpp
@@ -0,0 +1,32 @@
+//
+// Utils.cpp
+//
+
+#include "stdafx.h"
+#include "Utils.h"
+
+BOOL IsNt50()
+{
+ WORD wOsVersion = LOWORD(GetVersion());
+ BYTE bMajorVer = LOBYTE(wOsVersion);
+ BYTE bMinorVer = HIBYTE(wOsVersion);
+
+ return (bMajorVer>=5 && bMinorVer>=0);
+}
+
+void TruncateWithDots(TCHAR* szString, int iNewLen)
+{
+ assert(iNewLen >= 0);
+
+ int iOrigLen = _tcslen(szString);
+ if (iNewLen < iOrigLen)
+ {
+ TCHAR* p = szString+iNewLen;
+ *p = _T('\0');
+ for(int i=0; --p>=szString && i<3; i++)
+ {
+ *p = _T('.');
+ }
+ }
+}
+