diff options
author | mataes2007 <mataes2007@e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb> | 2011-11-26 15:41:10 +0000 |
---|---|---|
committer | mataes2007 <mataes2007@e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb> | 2011-11-26 15:41:10 +0000 |
commit | f04d64869f3b1de54fb343f28f955584780001b8 (patch) | |
tree | 5453dc10de3d980de79ffe019fa0b5fcb692a27d /TooltipNotify/src/Utils.cpp | |
parent | 7aff1e4cb053394db57c2814d5fe1e6493e0cc75 (diff) |
Project folders rename part 3
git-svn-id: http://miranda-plugins.googlecode.com/svn/trunk@215 e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb
Diffstat (limited to 'TooltipNotify/src/Utils.cpp')
-rw-r--r-- | TooltipNotify/src/Utils.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/TooltipNotify/src/Utils.cpp b/TooltipNotify/src/Utils.cpp new file mode 100644 index 0000000..ce73dbc --- /dev/null +++ b/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('.');
+ }
+ }
+}
+
|