Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionCodRet = Shell("C:\Program Files\Outlook Express\msimn.exe", vbNormalFocus)
AppActivate CodRet '<-- ?......Il y en à qui dise de donner le nom du projet ?
Call Pause(3) '<-- J'ai fais une pause de 3 secondes pour les essais
SendKeys "^N" '<-- Afficher la page "Créer" (ctrl + N)
for over 3 hours trying to get that working i end up with nothing thats works..
i cant find how that findwindow api and setforegroundwindow works..
can somebody help me with this ?
*useable example of some kind maby ???*
Thanx Daniel
:)
make a project...add this code
open notepad take the focus off
run program...Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long Private Sub Form_Load() lHandle = FindWindow("Notepad", vbNullString) 'Set this window to the foreground lHandle = SetForegroundWindow(lHandle) End Sub
Explanation of FindWindow...
FindWindow(ClassName,Title Of App)
so this with notepad will work with notepad as classname or "untitled - notepad" which is default title notepad has when first opened... in your case i dont know if "NSVCAP" is the title or classname but prolly is title so instead of
lHandle = FindWindow("Notepad", vbNullString)
use
lHandle = FindWindow(vbNullString, "NSVCAP")
OR use Spy++ to get NSVCAP program classname and put it where i put notepad in example...
hope that helps and i havent confuse you :p
lHandle = FindWindow("Texte exact de la barre de titre de la fenetre à chercher (respecter la casse)", vbNullString) lHandle = SetForegroundWindow(lHandle)