AutoWin UserLibrary

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
Little John
Addict
Addict
Posts: 4519
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: AutoWin UserLibrary

Post by Little John »

ts-soft wrote:Thx for bugreport. Download the fixed version in first post!
Thanks.
ts-soft wrote:PS: AW_FindWindow is not a public function :mrgreen:
I had a program that called the following public procedures:

Code: Select all

AW_ChangeMatchMode(#AW_MatchParaIsHwnd)
AW_WinWaitClose(Str(hWnd))
The program never ended, because AW_WinWaitClose() never ended, even when the respective window was closed. The cause of the problem was the bug in AW_FindWindow(), which is called by AW_WinWaitClose().
I only called AW_FindWindow() directly in my example code here in order to clearly demonstrate the bug.

Regards, LJ
nicolaus
Enthusiast
Enthusiast
Posts: 456
Joined: Tue Aug 05, 2003 11:30 pm
Contact:

Re: AutoWin UserLibrary

Post by nicolaus »

Is there a version of this lib for actual PB version?
If i use the lib with PB 5.31 i receive many error message and i can't compile the code. what includes Au3Wrap.pbi.

Thanks,
Nico
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: AutoWin UserLibrary

Post by ts-soft »

The code compiles fine with 5.31, as include. I can't find any error.
To compile as tailbites userlib (not recommend), you have to use a compatible
version of tailbite.
There is no Au3Wrap.pbi in download, have you the right package?
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
ly47
User
User
Posts: 23
Joined: Mon May 05, 2014 6:51 pm

Re: AutoWin UserLibrary

Post by ly47 »

ts-soft wrote:The code compiles fine with 5.31, as include. I can't find any error.
Hi
I have copied AutoWin (Version 1.4.1) lib to C:\PureBasic\PureLibraries\UserLibraries
I tried to compile and get this error: "Library missing: Misc (needed by 'AutoWin' library)."
please help
thanks
ly

Code: Select all

EnableExplicit

Define.s Title
RunProgram("notepad")

Select GetUserDefaultLCID_()
  Case 1031; german
    Title = "Unbenannt"
  Default
    Title = "Untitled"
EndSelect
If AW_WinWait(Title, 10)
  AW_WinActivate(Title)
  AW_SendKeys("Feel the ..Pure.. Power{ENTER}{ENTER}of PureBasic.")
  Delay(3000)
  AW_WinActivate(Title)
  AW_SendKeys("{ALTDOWN}{F4}{ALTUP}")
  Delay(3000)
  If AW_WinExists(Title)
    AW_WinKill(Title)
  EndIf
EndIf
/code]
Little John
Addict
Addict
Posts: 4519
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: AutoWin UserLibrary

Post by Little John »

Your code does not contain (X)IncludeFile for including the AutoWin library.
ts-soft wrote:To compile as tailbites userlib (not recommend), you have to use a compatible
version of tailbite.
( And improving the readability by putting the code in proper [ code ] tags will help others to help you. )
Last edited by Little John on Sat Apr 18, 2015 1:59 pm, edited 1 time in total.
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: AutoWin UserLibrary

Post by IdeasVacuum »

Well, the error message says it can't find the Misc lib, which suggests that the AutoWin lib includes a procedure found in Misc?
Is that an issue caused by using TailBite? I seem to recall that from way back when.

ly47, if you are using TailBite, try an XIncludeFile of AutoWin_Include.pbi instead.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
ly47
User
User
Posts: 23
Joined: Mon May 05, 2014 6:51 pm

Re: AutoWin UserLibrary

Post by ly47 »

IdeasVacuum wrote:Well, the error message says it can't find the Misc lib, which suggests that the AutoWin lib includes a procedure found in Misc?
Is that an issue caused by using TailBite? I seem to recall that from way back when.

ly47, if you are using TailBite, try an XIncludeFile of AutoWin_Include.pbi instead.
Hi IdeasVacuum
Thanks
I have delete AutoWin (Version 1.4.1) lib (from C:\PureBasic\PureLibraries\UserLibraries), and used XIncludeFile of AutoWin_Include.pbi instead, and it works.
But not all procedures are working.
(ie: AW_WinMove, AW_WinActivate, AW_WinWait)
I have modified the code so only SendKeys works.
Thanks
ly

Code: Select all

Define.s Title, myTitle
Define.i dly = 1111

RunProgram("notepad")

Define.i lcid

; lcid = GetUserDefaultLCID_()
; Debug Str(lcid)

Select GetUserDefaultLCID_()
  Case 1031; german
    Title = "Unbenannt"
  Default
    Title = "Untitled - Notepad"
EndSelect

; If AW_WinWait(Title,10)
; 	AW_WinActivate(Title)
; 	myTitle = AW_WinGetTitle2(Title) 
; 	Debug myTitle
	 Delay(dly)
; 	AW_WinMove(Title, 10, 10) 

    Delay(dly)
	AW_SendKeys("Feel the ..Pure.. Power{ENTER}{ENTER}of PureBasic.")
	Delay(dly)
; 	AW_WinActivate(Title)
; 	Delay(dly)
	AW_SendKeys("{ALTDOWN}{F4}{ALTUP}")
	Delay(dly)
	AW_SendKeys("{TAB}")
	Delay(dly)
	AW_SendKeys("{ENTER}")
; 	If AW_WinExists(Title)
; 		AW_WinKill(Title)
; 	EndIf
; EndIf
JCV
Enthusiast
Enthusiast
Posts: 579
Joined: Fri Jun 30, 2006 4:30 pm
Location: Middle East

Re: AutoWin UserLibrary

Post by JCV »

Thanks for this nice library ts-soft

I modified the AW_ControlClick to support custom coordinates like Autoit ControlClick

Code: Select all


Macro AW_ControlClick(title, controlID, Button = #PB_Button_Left, clicks = 1, x = -1, y = -1)
  AW_ControlClick3(title, controlID, Button, clicks, x, y)
EndMacro

Macro MAKELPARAM(x, y)
  (y<<16) | x
EndMacro 

ProcedureDLL AW_ControlClick3(title.s, controlID.s, Button, clicks, x, y)
  Protected i
  Protected *param.AW_WinParameter

  *param = AW_FindWindow(title)
  If *param\hWnd
    *param = AW_FindControl(*param\hWnd, controlID.s)
    If *param\hWnd
      Select Button
        Case #PB_Button_Left
          For i = 1 To clicks
            If x > -1 And y > -1
              PostMessage_(*param\hWnd, #WM_LBUTTONDOWN, 0, MAKELPARAM(x, y))
      				PostMessage_(*param\hWnd, #WM_LBUTTONUP, 0, MAKELPARAM(x, y))
      			Else
      				PostMessage_(*param\hWnd, #WM_LBUTTONDOWN, 0, 0)
      				PostMessage_(*param\hWnd, #WM_LBUTTONUP, 0, 0)
      			EndIf
            If i < clicks
              Delay(GetDoubleClickTime_())
            EndIf
          Next
          ProcedureReturn #True
        Case #PB_Button_Right
          For i = 1 To clicks
            If x > -1 And y > -1
              PostMessage_(*param\hWnd, #WM_RBUTTONDOWN, 0, MAKELPARAM(x, y))
              PostMessage_(*param\hWnd, #WM_RBUTTONUP, 0, MAKELPARAM(x, y))
      			Else
              PostMessage_(*param\hWnd, #WM_RBUTTONDOWN, 0, 0)
              PostMessage_(*param\hWnd, #WM_RBUTTONUP, 0, 0)
            EndIf
            If i < clicks
              Delay(GetDoubleClickTime_())
            EndIf
          Next
          ProcedureReturn #True
      EndSelect
    EndIf
  EndIf
EndProcedure

[Registered PB User since 2006]
[PureBasic 5.7][SpiderBasic 2.2] [Win 10 64bit]
[Intel i7 990x 4.20 Ghz] [18GB DDR3]
Aleks_Longard
User
User
Posts: 59
Joined: Mon Dec 24, 2012 9:07 am
Location: Germany, Munich

Re: AutoWin UserLibrary

Post by Aleks_Longard »

Hello all!
Help me please,
what activate mouseclick with global hotkeys?
I automation vst synth, and can't control the mouse with keyboard.
Sory my bad english
loulou2522
Enthusiast
Enthusiast
Posts: 495
Joined: Tue Oct 14, 2014 12:09 pm

Re: AutoWin UserLibrary

Post by loulou2522 »

Hi Ts_soft
Can you help meon how to do an obj file with autoitx.dll to and tailbite. I want to adapt your library to PB 5.40
Thanks in advance
Pasch3
New User
New User
Posts: 2
Joined: Fri Aug 11, 2017 5:54 pm

Re: AutoWin UserLibrary

Post by Pasch3 »

Hallo Thomas alias TS-Soft,

besteht die Möglichkeit, dass Du für AutoWin eine UserLibrary erstellst, die mit der aktuellen Purebasic -Version arbeitet?

Nette Grüße
Christian
User avatar
RSBasic
Moderator
Moderator
Posts: 1218
Joined: Thu Dec 31, 2009 11:05 pm
Location: Gernsbach (Germany)
Contact:

Re: AutoWin UserLibrary

Post by RSBasic »

@Pasch3
Am besten stellt er den Quellcode als Include zur Verfügung. Das wäre am besten. Dann kannst auch du den Code auf die neuste PB-Version anpassen, falls sich die Syntax einer Funktion o.ä. ändern sollte.
Image
Image
Little John
Addict
Addict
Posts: 4519
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: AutoWin UserLibrary

Post by Little John »

Pasch3 wrote:Hallo Thomas alias TS-Soft,

besteht die Möglichkeit, dass Du für AutoWin eine UserLibrary erstellst, die mit der aktuellen Purebasic -Version arbeitet?
(asking ts-soft for creating an AutoWin userlib that is compatible with the current PB version)
ts-soft wrote:compile as tailbites userlib (not recommend)
Not recommending this is a good advice.
highend
Enthusiast
Enthusiast
Posts: 123
Joined: Tue Jun 17, 2014 4:49 pm

Re: AutoWin UserLibrary

Post by highend »

Where is the download link for this library?

The link in the very first posting leads to: http://realsource.de/?page_id=9999999
Little John
Addict
Addict
Posts: 4519
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: AutoWin UserLibrary

Post by Little John »

Hi,

maybe RSBasic has it in his archive ... I don't know.
Anyway, you can now download the original AutoWin_1.4.1.zip file (including source code) from my Dropbox.
Post Reply