/[rdesktop]/sourceforge.net/trunk/seamlessrdp/ServerExe/main.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/trunk/seamlessrdp/ServerExe/main.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1077 by ossman_, Thu Mar 9 15:26:35 2006 UTC revision 1097 by ossman_, Fri Mar 10 12:38:00 2006 UTC
# Line 67  get_token(char **s) Line 67  get_token(char **s)
67          return head;          return head;
68  }  }
69    
70  static BOOL CALLBACK enum_cb(HWND hwnd, LPARAM lparam)  static BOOL CALLBACK
71    enum_cb(HWND hwnd, LPARAM lparam)
72  {  {
73          RECT rect;          RECT rect;
74          char title[150];          char title[150];
75          LONG styles;          LONG styles;
76          int state;          int state;
77            HWND parent;
78    
79          styles = GetWindowLong(hwnd, GWL_STYLE);          styles = GetWindowLong(hwnd, GWL_STYLE);
80    
81          if (!(styles & WS_VISIBLE))          if (!(styles & WS_VISIBLE))
82                  return TRUE;                  return TRUE;
83    
84          vchannel_write("CREATE1,0x%p,0x%x", hwnd, 0);          if (styles & WS_POPUP)
85                    parent = (HWND) GetWindowLong(hwnd, GWL_HWNDPARENT);
86            else
87                    parent = NULL;
88    
89            vchannel_write("CREATE,0x%p,0x%p,0x%x", hwnd, parent, 0);
90    
91          if (!GetWindowRect(hwnd, &rect)) {          if (!GetWindowRect(hwnd, &rect))
92            {
93                  debug("GetWindowRect failed!");                  debug("GetWindowRect failed!");
94                  return TRUE;                  return TRUE;
95          }          }
96    
97          vchannel_write("POSITION1,0x%p,%d,%d,%d,%d,0x%x",          vchannel_write("POSITION,0x%p,%d,%d,%d,%d,0x%x",
98                         hwnd,                         hwnd,
99                         rect.left, rect.top,                         rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, 0);
                        rect.right - rect.left,  
                        rect.bottom - rect.top,  
                        0);  
100    
101          GetWindowText(hwnd, title, sizeof(title));          GetWindowText(hwnd, title, sizeof(title));
102    
103          /* FIXME: Strip title of dangerous characters */          /* FIXME: Strip title of dangerous characters */
104    
105            vchannel_write("TITLE,0x%x,%s,0x%x", hwnd, title, 0);
106    
107          if (styles & WS_MAXIMIZE)          if (styles & WS_MAXIMIZE)
108                  state = 2;                  state = 2;
109          else if (styles & WS_MINIMIZE)          else if (styles & WS_MINIMIZE)
# Line 104  static BOOL CALLBACK enum_cb(HWND hwnd, Line 111  static BOOL CALLBACK enum_cb(HWND hwnd,
111          else          else
112                  state = 0;                  state = 0;
113    
114          vchannel_write("SETSTATE1,0x%p,%s,0x%x,0x%x",          vchannel_write("STATE,0x%p,0x%x,0x%x", hwnd, state, 0);
                        hwnd, title, state, 0);  
115    
116          return TRUE;          return TRUE;
117  }  }
# Line 132  process_cmds(void) Line 138  process_cmds(void)
138    
139          char *p, *tok1, *tok2, *tok3, *tok4, *tok5, *tok6, *tok7, *tok8;          char *p, *tok1, *tok2, *tok3, *tok4, *tok5, *tok6, *tok7, *tok8;
140    
141          while ((size = vchannel_read(line, sizeof(line))) >= 0) {          while ((size = vchannel_read(line, sizeof(line))) >= 0)
142            {
143                  debug("Got: %s", line);                  debug("Got: %s", line);
144    
145                  p = line;                  p = line;
# Line 162  WinMain(HINSTANCE instance, HINSTANCE pr Line 169  WinMain(HINSTANCE instance, HINSTANCE pr
169    
170          g_instance = instance;          g_instance = instance;
171    
172          hookdll = LoadLibrary("hookdll.dll");          hookdll = LoadLibrary("seamlessrdp.dll");
173          if (!hookdll)          if (!hookdll)
174          {          {
175                  message("Could not load hook DLL. Unable to continue.");                  message("Could not load hook DLL. Unable to continue.");
# Line 196  WinMain(HINSTANCE instance, HINSTANCE pr Line 203  WinMain(HINSTANCE instance, HINSTANCE pr
203             immediatly. */             immediatly. */
204          SystemParametersInfo(SPI_SETDRAGFULLWINDOWS, TRUE, NULL, 0);          SystemParametersInfo(SPI_SETDRAGFULLWINDOWS, TRUE, NULL, 0);
205    
206            /* Disable screen saver since we cannot catch its windows. */
207            SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, FALSE, NULL, 0);
208    
209          if (strlen(cmdline) == 0)          if (strlen(cmdline) == 0)
210          {          {
211                  message("No command line specified.");                  message("No command line specified.");

Legend:
Removed from v.1077  
changed lines
  Added in v.1097

  ViewVC Help
Powered by ViewVC 1.1.26