/[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 1150 by ossman_, Thu Mar 16 15:42:32 2006 UTC revision 1153 by ossman_, Fri Mar 17 09:55:35 2006 UTC
# Line 33  Line 33 
33    
34  #define APP_NAME "SeamlessRDP Shell"  #define APP_NAME "SeamlessRDP Shell"
35    
36    #define FOCUS_MSG_NAME "WM_SEAMLESS_FOCUS"
37    static UINT g_wm_seamless_focus;
38    
39  #ifndef WM_WTSSESSION_CHANGE  #ifndef WM_WTSSESSION_CHANGE
40  #define WM_WTSSESSION_CHANGE 0x02B1  #define WM_WTSSESSION_CHANGE 0x02B1
41  #endif  #endif
# Line 170  do_zchange(HWND hwnd, HWND behind) Line 173  do_zchange(HWND hwnd, HWND behind)
173  }  }
174    
175  static void  static void
176    do_focus(HWND hwnd)
177    {
178    /*      if (!AttachThreadInput(GetCurrentThreadId(), GetWindowThreadProcessId(hwnd, NULL), TRUE))
179            {
180                    debug("Failed to attach");
181                    return;
182            }
183            SetFocus(hwnd);
184            AttachThreadInput(GetCurrentThreadId(), GetWindowThreadProcessId(hwnd, NULL), FALSE)*/
185            SendMessage(hwnd, g_wm_seamless_focus, 0, 0);
186    }
187    
188    static void
189  process_cmds(void)  process_cmds(void)
190  {  {
191          char line[VCHANNEL_MAX_LINE];          char line[VCHANNEL_MAX_LINE];
# Line 200  process_cmds(void) Line 216  process_cmds(void)
216                                                                                           0));                                                                                           0));
217                  else if (strcmp(tok1, "ZCHANGE") == 0)                  else if (strcmp(tok1, "ZCHANGE") == 0)
218                          do_zchange((HWND) strtoul(tok2, NULL, 0), (HWND) strtoul(tok3, NULL, 0));                          do_zchange((HWND) strtoul(tok2, NULL, 0), (HWND) strtoul(tok3, NULL, 0));
219                    else if (strcmp(tok1, "FOCUS") == 0)
220                            do_focus((HWND) strtoul(tok2, NULL, 0));
221          }          }
222  }  }
223    
# Line 300  WinMain(HINSTANCE instance, HINSTANCE pr Line 318  WinMain(HINSTANCE instance, HINSTANCE pr
318                  return -1;                  return -1;
319          }          }
320    
321            g_wm_seamless_focus = RegisterWindowMessage(FOCUS_MSG_NAME);
322    
323          WTSRegisterSessionNotification(g_hwnd, NOTIFY_FOR_THIS_SESSION);          WTSRegisterSessionNotification(g_hwnd, NOTIFY_FOR_THIS_SESSION);
324    
325          vchannel_open();          vchannel_open();

Legend:
Removed from v.1150  
changed lines
  Added in v.1153

  ViewVC Help
Powered by ViewVC 1.1.26