Autohotkey code into PureBasic code?

Just starting out? Need help? Post your questions and find answers here.
stmdbe2019
User
User
Posts: 89
Joined: Mon Aug 31, 2009 2:11 pm

Autohotkey code into PureBasic code?

Post by stmdbe2019 »

How do you convert this AutoHotkey code into PureBasic code?

- My following code is used for. When user is busy with outlook or other application and there is an incoming call to my Google chrome , tab number 20, how to bring the user quickly to that TAB.

to find Google chrome where and from the tab search for a specific TAB which is having a static title. Where my web-site apps were running.

Code: Select all

;
; Declare Title
;
chrome := "- Google Chrome"
found := "false"
tabSearch := "My webservice app"
curWinNum := 0

;
; Activate Application
; 
SetTitleMatchMode, 2
WinGet, numOfChrome, Count, %chrome% ; Get the number of chrome windows
WinActivateBottom, %chrome% ; Activate the least recent window
WinWaitActive %chrome% ; Wait until the window is active
ControlFocus, Chrome_RenderWidgetHostHWND1 ; Set the focus to tab control ???

;
; Loop Application 
;
while (curWinNum < numOfChrome and found = "false") { 
	WinGetTitle, firstTabTitle, A ; The initial tab title
	title := firstTabTitle
	Loop {
		if(InStr(title, tabSearch)>0){
		  found := "true"
		  break
		}
		Send {Ctrl down}{Tab}{Ctrl up}
		Sleep, 50
		WinGetTitle, title, A  ;get active window title
		if(title = firstTabTitle){
		  break
		}
	}
	WinActivateBottom, %chrome%
	curWinNum := curWinNum + 1
}

; If we did not find it, start it
if(found = "false"){
	Run "https://www.my-web-service-app.com/login"
}

return
-----
Registered PureBasic Coder.