/[winpt]/trunk/PTD/PTD.cpp
ViewVC logotype

Diff of /trunk/PTD/PTD.cpp

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

revision 304 by twoaday, Fri Dec 8 10:22:17 2006 UTC revision 305 by twoaday, Fri Mar 23 11:32:28 2007 UTC
# Line 1  Line 1 
1  /* PTD.cpp - Privacy Tray Dynamic  /* PTD.cpp - Privacy Tray Dynamic
2   *      Copyright (C) 2002-2006 Timo Schulz   *      Copyright (C) 2002-2007 Timo Schulz
3   *   *
4   * This file is part of WinPT.   * This file is part of WinPT.
5   *   *
# Line 12  Line 12 
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   * GNU General Public License for more details.   * GNU General Public License for more details.
  *  
  * You should have received a copy of the GNU General Public License  
  * along with WinPT; if not, write to the Free Software Foundation,  
  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
15   */   */
   
16  #ifdef HAVE_CONFIG_H  #ifdef HAVE_CONFIG_H
17  #include <config.h>  #include <config.h>
18  #endif  #endif
# Line 55  static HWND  systab_c32    ATTR_SEC = NU Line 50  static HWND  systab_c32    ATTR_SEC = NU
50  #undef ATTR_SEC  #undef ATTR_SEC
51    
52  static unsigned *journ_keys = 0;  static unsigned *journ_keys = 0;
53  static unsigned key_idx = 0;  static unsigned keyidx = 0;
54  static unsigned nkeys = 0;  static unsigned nkeys = 0;
55  static HHOOK journ_hook = NULL;  /* Journaling hook  handle. */  static HHOOK journ_hook = NULL;  /* Journaling hook  handle. */
56    
# Line 131  PTD_initialize (void) Line 126  PTD_initialize (void)
126      mstask_swc = FindWindowEx (rebar_w32, NULL, "MSTaskSwWClass", NULL);      mstask_swc = FindWindowEx (rebar_w32, NULL, "MSTaskSwWClass", NULL);
127      systab_c32 = FindWindowEx (mstask_swc, NULL, "SysTabControl32", NULL);      systab_c32 = FindWindowEx (mstask_swc, NULL, "SysTabControl32", NULL);
128            
129      /*log_foo ("tray_proc_id=%u cbt_hook=%p shell_traywnd=%p rebar_w32=%p "      /*debug ("tray_proc_id=%u cbt_hook=%p shell_traywnd=%p rebar_w32=%p "
130                 "mstask_swc=%p systab_c32=%p",               "mstask_swc=%p systab_c32=%p",
131                 tray_proc_id, cbt_hook, shell_traywnd, rebar_w32,               tray_proc_id, cbt_hook, shell_traywnd, rebar_w32,
132                 mstask_swc, systab_c32);*/               mstask_swc, systab_c32);*/
133            
134      return TRUE;      return TRUE;
135  }  }
# Line 168  PTD_playback_proc (int code, WPARAM wpar Line 163  PTD_playback_proc (int code, WPARAM wpar
163      LPEVENTMSG em;      LPEVENTMSG em;
164            
165      if (code == HC_SKIP) {      if (code == HC_SKIP) {
166          key_idx++;          keyidx++;
167          if (key_idx == nkeys) {          if (keyidx == nkeys) {
168              UnhookWindowsHookEx (journ_hook);              UnhookWindowsHookEx (journ_hook);
169              journ_hook = NULL;              journ_hook = NULL;
170          }          }
# Line 182  PTD_playback_proc (int code, WPARAM wpar Line 177  PTD_playback_proc (int code, WPARAM wpar
177           * paramH - specifies the scan code.                                       * paramH - specifies the scan code.                            
178           */           */
179          em = (LPEVENTMSG )lparam;          em = (LPEVENTMSG )lparam;
180          if (journ_keys[key_idx] & 0x8000)          if (journ_keys[keyidx] & 0x8000)
181              em->message = journ_keys[key_idx] & 0x4000 ? WM_SYSKEYDOWN : WM_KEYDOWN;              em->message = journ_keys[keyidx] & 0x4000 ? WM_SYSKEYDOWN : WM_KEYDOWN;
182          else          else
183              em->message = journ_keys[key_idx] & 0x4000 ? WM_SYSKEYUP : WM_KEYUP;              em->message = journ_keys[keyidx] & 0x4000 ? WM_SYSKEYUP : WM_KEYUP;
184          em->paramL = LOBYTE( journ_keys[key_idx] )          em->paramL = LOBYTE( journ_keys[keyidx] )
185              | (MapVirtualKey (LOBYTE (journ_keys[key_idx]), 0) << 8);              | (MapVirtualKey (LOBYTE (journ_keys[keyidx]), 0) << 8);
186          em->paramH = 1;          em->paramH = 1;
187          em->time = GetTickCount ();          em->time = GetTickCount ();
188          return 0;          return 0;
# Line 203  PTD_keyb_send (UINT *keys, UINT n_keys) Line 198  PTD_keyb_send (UINT *keys, UINT n_keys)
198  {  {
199      MSG msg;      MSG msg;
200      journ_keys = keys;      journ_keys = keys;
201      key_idx = 0;      keyidx = 0;
202      nkeys =  n_keys;          nkeys =  n_keys;    
203            
204      if (journ_hook)      if (journ_hook)

Legend:
Removed from v.304  
changed lines
  Added in v.305

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26