/[winpt]/trunk/Src/wptCurrWnd.cpp
ViewVC logotype

Diff of /trunk/Src/wptCurrWnd.cpp

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

revision 36 by werner, Thu Oct 27 15:25:13 2005 UTC revision 225 by twoaday, Tue Jun 6 13:37:59 2006 UTC
# Line 23  Line 23 
23  #endif  #endif
24    
25  #include <windows.h>  #include <windows.h>
 #include <windows.h>  
26    
27  #include "wptW32API.h"  #include "wptW32API.h"
28  #include "wptErrors.h"  #include "wptErrors.h"
29    #include "wptVersion.h"
30    
31  #define KEYDOWN( vcode, scode ) keybd_event( (vcode), (scode), 0, 0 )  #define KEYDOWN( vcode, scode ) keybd_event( (vcode), (scode), 0, 0 )
32  #define KEYUP( vcode, scode)    keybd_event( (vcode), (scode), KEYEVENTF_KEYUP, 0 )  #define KEYUP( vcode, scode)    keybd_event( (vcode), (scode), KEYEVENTF_KEYUP, 0 )
33    
34            
35  extern HWND PTD_get_curr_hwnd( void );  extern "C" HWND PTD_get_curr_hwnd( void );
36  extern BOOL PTD_keyb_send( UINT *keys, UINT n_keys );  extern "C" BOOL PTD_keyb_send( UINT *keys, UINT n_keys );
37  int PTD_is_used( void );  extern "C" int PTD_is_used( void );
38    
39  static void  static void
40  clip_clear (void)  clip_clear (void)
# Line 65  clip_check( void ) Line 65  clip_check( void )
65      return 0;      return 0;
66  } /* clip_check */  } /* clip_check */
67    
68    
69  static void  static void
70  wnd_msg_markall( HWND hwnd )  wnd_msg_markall (void)
71  {  {
72      unsigned keys[4] = {0};      unsigned keys[4] = {0};
73    
# Line 84  wnd_msg_markall( HWND hwnd ) Line 85  wnd_msg_markall( HWND hwnd )
85          KEYUP( (BYTE)'A', 0x1e );          KEYUP( (BYTE)'A', 0x1e );
86          KEYUP( VK_CONTROL, 0x1d );                KEYUP( VK_CONTROL, 0x1d );      
87      }      }
88  } /* msg_wm_markall */  }
89    
90    
91  static void  static void
92  wnd_msg_paste( HWND hwnd )  wnd_msg_paste (void)
93  {  {
94      unsigned keys[4] = {0};      unsigned keys[4] = {0};
95    
# Line 105  wnd_msg_paste( HWND hwnd ) Line 106  wnd_msg_paste( HWND hwnd )
106          KEYUP( (BYTE)'V', 0x2f );                KEYUP( (BYTE)'V', 0x2f );      
107          KEYUP( VK_CONTROL, 0x1d );                KEYUP( VK_CONTROL, 0x1d );      
108      }      }
109  } /* msg_wm_paste */  }
110    
111    
112  static void  static void
113  wnd_msg_copy( HWND hwnd )  wnd_msg_copy (void)
114  {  {
115      unsigned keys[4] = {0};      unsigned keys[4] = {0};
116    
117      if( PTD_is_used() ) {      if (PTD_is_used ()) {
118          keys[0] = VK_CONTROL | 0x8000;          keys[0] = VK_CONTROL | 0x8000;
119          keys[1] = 'C' | 0x8000;          keys[1] = 'C' | 0x8000;
120          keys[2] = 'C';          keys[2] = 'C';
# Line 202  get_window_contents( HWND old_hwnd, curr Line 203  get_window_contents( HWND old_hwnd, curr
203      }      }
204                    
205      /* The last try is to send a mark all and copy to clipboard command */      /* The last try is to send a mark all and copy to clipboard command */
206      wnd_msg_markall( hwnd );      wnd_msg_markall ();
207      wnd_msg_copy( hwnd );      wnd_msg_copy ();
208      if( !clip_check( ) )      if( !clip_check( ) )
209          rc = 0;          rc = 0;
210    
# Line 235  set_window_contents( HWND old_hwnd, curr Line 236  set_window_contents( HWND old_hwnd, curr
236      lost = SetFocus( hwnd );      lost = SetFocus( hwnd );
237    
238      wnd_msg_em_set_pos( hwnd, 0 );      wnd_msg_em_set_pos( hwnd, 0 );
239      wnd_msg_paste( hwnd );      wnd_msg_paste ();
240      wnd_msg_em_set_pos( hwnd, 1 );      wnd_msg_em_set_pos( hwnd, 1 );
241                    
242      AttachThreadInput( GetCurrentThreadId(),      AttachThreadInput( GetCurrentThreadId(),

Legend:
Removed from v.36  
changed lines
  Added in v.225

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26