Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sending keystrokes to window
Message
De
11/05/2006 09:08:35
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
Sending keystrokes to window
Divers
Thread ID:
01120957
Message ID:
01120957
Vues:
60
The code below successfully finds the window I want it to and sets focus to it but the keyboard command does not work. The same code worked with an open Notepad instance though. I was able to sent '{CTRL-O}' to notepad which brought up the open dialog box. any ideas?
DECLARE INTEGER FindWindow IN user32;
        STRING lpClassName, STRING lpWindowName  
   
  hwnd = FindWindow(.NULL.,[Program Error])
  
  
  DECLARE INTEGER SendMessage IN user32;
    INTEGER hWnd,;
    INTEGER Msg,;
    INTEGER wParam,;
    INTEGER lParam 
    
 DECLARE INTEGER SetForegroundWindow IN user32 INTEGER hwnd
    
    
 if hwnd > 0
	SetForegroundWindow(hwnd)
	keyboard '{ALT-C}'	
 endif    
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform