Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need to write to some window
Message
De
14/06/2004 17:23:56
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00912412
Message ID:
00913647
Vues:
16
Sergey,

Thank you for your help.

It works like a charm. Had a hard time getting the CLEAR on the mainframe to work, no documentation available, but in the end got it right.

For anybody else with a similar problem, here's a snippet of the code.
* Assumes declaration of ShowWindow is in place
* Windows are found by oFindWizard, code courtesy of George Tasker,
* and placed in an array. 

SET CONSOLE OFF   && Don't want any VFP Windows on Wait command
TRY
        * Otherwise it's visible but not active 
	ShowWindow(aWizards(lnArraySize,1),WIN_NORMAL) 
	
	oShell.AppActivate(aWizards(lnArraySize,2))
	WAIT TIMEOUT 0.005
	
	llResult = oShell.SendKeys("%{END}")   && VB <Clear>
	WAIT TIMEOUT 0.005

	llResult = oShell.SendKeys("/for wzttrc." + "{ENTER}") 
	WAIT TIMEOUT 0.005

	lcString = '10tr' + lcMvaNo + lcDate
	llResult = oShell.SendKeys(lcString + "{ENTER}")
	WAIT TIMEOUT 0.005
CATCH TO oException
	SET CONSOLE ON
	=MESSAGEBOX("Sorry, No Mainframe Wizard was found",64,"No open Mainframe Session") 
ENDTRY
SET CONSOLE ON
oShell 	    = NULL
oFindWizard = NULL
>Peter,
>
>Would WSH SendKeys work for you SendInput Function Message #814854 ?
>
>>I need to find a window (solved courtesy of George Tasker), let it get the focus, ShowWindow() sometimes does an sometimes does not, and finally pass keystrokes to it.
>>
>>Have tried KEYBOARD... but that really doesn't do much of anything, which is pretty much what I expected.
>>
>>This is all related to some mainframe screen...
>>
Peter Pirker


Whosoever shall not fall by the sword or by famine, shall fall by pestilence, so why bother shaving?

(Woody Allen)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform