Jump to content

BennyB

Members
  • Posts

    9
  • Joined

  • Last visited

BennyB's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. OK. I solve a part of my problem, but.. At the moment I can get the position of the mouse and the controlname of the item under it. But I can't verify if the mouse was clicked. I would not have the name of the controls I mouseover. I hope you understand me. A part of my code below (c++): mousepos.x = AU3_MouseGetPosX(); mousepos.y = AU3_MouseGetPosY(); window = WindowFromPoint(mousepos); GetWindowText(window, pcWinTitle, 255);
  2. I'm not a specialist in programming whit windows components. I've tried following .vbs code: Option Explicit Dim oShell Dim oAutoIt Dim temp Dim temp2 Set oShell = WScript.CreateObject("WScript.Shell") Set oAutoIt = WScript.CreateObject("AutoItX3.Control") Set oTemp = WScript.CreateObject("user32.dll") oAutoIt.Run "c:\windows\notepad.exe" oAutoIt.WinWait "Unbenannt","" oAutoIt.ControlSend "Unbenannt ", "", 15, "{ENTER}" temp2 = MouseGetPos() temp = oTemp.WindowFromPoint(temp2) oAutoTi.ControlSend "Unbenannt ", "", 15, temp WScript.Quit Error: "An automaticclass with the name user32.dll wasn't found" My aim is, that i would like to have the ID of an Button in a variable. Thanks for helping me
  3. First excuse my english, it isn't my foreign language. I woult like to get the ID of an object when the mouse button was pressed. Or when a keystroke was done. Have anybody an idea? Thanks for help
  4. Thank you it work, I thought I have the newest version, but it wasn't so. Topic can be closed
  5. OK, I've found something that seems to be the right thing, but if i compiled the script and would like to start following error accured: $aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey) $aR = ^ERROR a part of my code looks like: Func _IsPressed($hexKey) Local $aR, $bRv $hexKey = '0x' & $hexKey $aR = DllCall($user32", "int", "GetAsyncKeyState", "int", $hexKey) If $aR[0] <> 0 Then $bRv = 1 Else $bRv = 0 EndIf Opt("OnExitFunc","Terminate") $user32 = DllOpen ( "user32" ) Has anybody an idea?
  6. First of all excuse my english I'm writing, because it's not my foren language. I have written some vbscript to install programs. It is very hard to script this files for each program. Because of this I would like to make myself an install-recorder which records the keys and window titles while i install the program. If i can get this information i can generate the vbscript file. Example vbscript file: '1129795714 Option Explicit Dim oShell Dim oAutoIt Dim Pfad Set oShell = WScript.CreateObject("WScript.Shell") Set oAutoIt = WScript.CreateObject("AutoItX3.Control") Pfad = WSCript.Arguments(0) oAutoIt.WinWait "IrfanView Setup","Willkommen zur IrfanView Installation!" oAutoIt.WinActivate "IrfanView Setup","Willkommen zur IrfanView Installation!" oAutoIt.Sleep(50) oAutoIt.Send Pfad oAutoIt.Send "{ENTER}" oAutoIt.WinWait "IrfanView Setup","Was ist neu in dieser Version?" oAutoIt.WinActivate "IrfanView Setup","Was ist neu in dieser Version?" oAutoIt.Send "{ENTER}" oAutoIt.WinWait "IrfanView Setup","Alle markieren" oAutoIt.WinActivate "IrfanView Setup","Alle markieren" oAutoIt.Send "{ENTER}" oAutoIt.Send "{TAB}" oAutoIt.Send "{TAB}" oAutoIt.Send "{TAB}" oAutoIt.Send "{TAB}" oAutoIt.Send "{TAB}" oAutoIt.Send "{ENTER}" oAutoIt.WinWait "IrfanView Setup","Google Toolbar und Google Desktop" oAutoIt.WinActivate "IrfanView Setup","Google Toolbar und Google Desktop" oAutoIt.Send "{SPACE}" oAutoIt.Send "{TAB}" oAutoIt.Send "{SPACE}" oAutoIt.Send "{ENTER}" oAutoIt.WinWait "IrfanView Setup","Bereit zum Installieren!" oAutoIt.WinActivate "IrfanView Setup","Bereit zum Installieren!" oAutoIt.Send "{ENTER}" oAutoIt.WinWait "IrfanView Installation","Sie möchten die aktuellen Verknüpfungen ändern" oAutoIt.WinActivate "IrfanView Installation","Sie möchten die aktuellen Verknüpfungen ändern" oAutoIt.Send "{TAB}" oAutoIt.Send "{ENTER}" oAutoIt.WinWait "IrfanView Setup","Einrichtung abgeschlossen!" oAutoIt.WinActivate "IrfanView Setup","Einrichtung abgeschlossen!" oAutoIt.Send "{SPACE}" oAutoIt.Send "{DOWN}" oAutoIt.Send "{SPACE}" oAutoIt.Send "{ENTER}" WScript.Quit I hope anybody understood my problem and can give me some hints and tips. thank you for your interest Benny
  7. If I work with a sleep it can cause faults? isn't it? I'd like to make a macro-recorder for installation routine.
  8. OK, I testet but one problem still having. script shows like: $pid = run("calc.exe","","") $file = FileOpen("test.txt", 2) While (ProcessExists($pid) <> 0) If _IsPressed('2A') = 1 Then FileWriteLine($file, "DRUCK"); If _IsPressed('0D') = 1 Then $file = FileOpen("test.txt", 1) FileWriteLine($file, "ENTER") FileClose($file) ElseIf _IsPressed('09') = 1 Then $file = FileOpen("test.txt", 1) FileWriteLine($file, "TAB") FileClose($file) EndIf WEnd FileWriteLine($file, "Line1") FileClose($file) Func _IsPressed($hexKey) ; $hexKey must be the value of one of the keys. ; _IsPressed will return 0 if the key is not pressed, 1 if it is. Local $aR $hexKey = '0x' & $hexKey $aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey) If Not @error And BitAND($aR[0],0x8000) = 0x8000 Then Return 1 Return 0 EndFunc;==>_IsPressed If I press ENTER or TAB the script write nearly 18 times TAB to the file, is that normal, can I fix this problem?
  9. I'd like to write a script which logs my actions include the window title and the window text. My idea was: start process while (process is running) do while (no key was hit) compare windowtitle.old with windowtitle if the title is different then write the title and the window text to a file else do nothing wend write the key, which was pressed to a file wend i can't find a function which is similar to "register if a key is pressed" i'm not very good in english, I hope you understand me
×
×
  • Create New...