Fix bad signed/unsigned comparisons

Either by casting, or switching to a more appropriate type
for the variable.
diff --git a/win/rfb_win32/CleanDesktop.cxx b/win/rfb_win32/CleanDesktop.cxx
index 52dc6bd..bad95f0 100644
--- a/win/rfb_win32/CleanDesktop.cxx
+++ b/win/rfb_win32/CleanDesktop.cxx
@@ -129,7 +129,7 @@
         vlog.error("failed to get desktop item count: %ld", hr);
         return false;
       }
-      for (unsigned int i=0; i<itemCount; i++) {
+      for (int i=0; i<itemCount; i++) {
         if (enableItem(i, false))
           restoreItems.insert(i);
       }
diff --git a/win/rfb_win32/TsSessions.cxx b/win/rfb_win32/TsSessions.cxx
index efe7564..a4fac2f 100644
--- a/win/rfb_win32/TsSessions.cxx
+++ b/win/rfb_win32/TsSessions.cxx
@@ -48,7 +48,7 @@
     id = 0;
     if (!_ProcessIdToSessionId.isValid())
       return;
-    if (processId == -1)
+    if (processId == (DWORD)-1)
       processId = GetCurrentProcessId();
     if (!(*_ProcessIdToSessionId)(GetCurrentProcessId(), &id))
       throw rdr::SystemException("ProcessIdToSessionId", GetLastError());
@@ -72,7 +72,7 @@
 #ifdef RFB_HAVE_WINSTATION_CONNECT
     if (!_WinStationConnect.isValid())
       throw rdr::Exception("WinSta APIs missing");
-    if (sessionId == -1)
+    if (sessionId == (DWORD)-1)
       sessionId = mySessionId.id;
 
     // Try to reconnect our session to the console
diff --git a/win/vncconfig/Connections.h b/win/vncconfig/Connections.h
index 209e4fd..6176f3d 100644
--- a/win/vncconfig/Connections.h
+++ b/win/vncconfig/Connections.h
@@ -117,11 +117,11 @@
         case IDC_HOSTS:
           {
             DWORD selected = SendMessage(GetDlgItem(handle, IDC_HOSTS), LB_GETCURSEL, 0, 0);
-            int count = SendMessage(GetDlgItem(handle, IDC_HOSTS), LB_GETCOUNT, 0, 0);
-            bool enable = selected != LB_ERR;
+            DWORD count = SendMessage(GetDlgItem(handle, IDC_HOSTS), LB_GETCOUNT, 0, 0);
+            bool enable = selected != (DWORD)LB_ERR;
             enableItem(IDC_HOST_REMOVE, enable);
             enableItem(IDC_HOST_UP, enable && (selected > 0));
-            enableItem(IDC_HOST_DOWN, enable && (selected < count-1));
+            enableItem(IDC_HOST_DOWN, enable && (selected+1 < count));
             enableItem(IDC_HOST_EDIT, enable);
             setChanged(isChanged());
           }