Jump to content

Recommended Posts

Posted (edited)

GoogleChromePortable + Hangouts Chat + Autoit = Web aplication as program

###### update

Found a new way. You have to use GoogleChromePortable (https://portableapps.com/apps/internet/google_chrome_portable) to make it work out of the box as you have to set scecial flag to be able modify title control.

  1. Download https://portableapps.com/apps/internet/google_chrome_portable instal it somewhere
  2. puti folder GoogleChromePortable in yor script folder
  3. make copy of chrome.exe to chat.exe this is for having corect PID
  4. open chat.exe open url chrome://flags/#windows10-custom-titlebar and set to disabled
  5. close chrome
  6. run script 
  7. make it auto instalible with WinRar shortcuts or whatever and you have web application as executable

 

#include <GUIMenu.au3>
#NoTrayIcon
Opt("WinTitleMatchMode", 2)
EnvSet("GOOGLE_API_KEY", "no")
;~ EnvSet("GOOGLE_DEFAULT_CLIENT_ID", "no")
;~ EnvSet("GOOGLE_DEFAULT_CLIENT_SECRET", "no")

$List = ProcessList('chat.exe')
If NOT @error Then
    For $i = 1 To $List[0][0]
        ProcessClose($List[$i][1])
    Next
EndIf

Local $hGui, $sURL = "https://chat.google.com/"
Local $iWidth = 500, $iHeight = 768
$gPID = Run(@ScriptDir & "\GoogleChromePortable\chat.exe –disable-extensions --app=" & $sURL, "", @SW_HIDE)
$gPID = WinWait("Chat")
Local $hMenu = _GUICtrlMenu_GetSystemMenu($gPID)
Local $iMenuItemCount = _GUICtrlMenu_GetItemCount($hMenu)
_GUICtrlMenu_RemoveMenu($hMenu, $iMenuItemCount - 1, $MF_BYPOSITION)
Edited by slaultu
Update
Posted (edited)
#NoTrayIcon
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_UseUpx=y
#AutoIt3Wrapper_UseX64=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <WinAPI.au3>
#include <Constants.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
#include <MsgBoxConstants.au3>
Opt("WinTitleMatchMode", 2)
$GUITitle = "Chat"
Global $T1 = 50 ;this is a x offset
Global $T2 = 0 ;this is a y offset

$iPID = run("chat.exe --app=https://chat.google.com/u/1/")
$hWnd = WinWait($GUITitle)

; Creation
$hider = GUICreate("hHide", 100, 28, 5, 5, $WS_POPUP, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW),$hWnd)
GUISetState(@SW_SHOW, $hider)
WinSetOnTop($hider, "", 1)

While 1
    If NOT ProcessExists("chat.exe") Then
        Exit
    EndIf
    $pos = WinGetPos($GUITitle)
    If @error Then
        Exit
    EndIf
    $iState = WinGetState($GUITitle)

    If NOT WinActive($GUITitle) Then
        WinSetOnTop($hider, "", 0)
        WinSetState($GUITitle, "", @SW_MINIMIZE )
;~      GUISetState(@SW_HIDE)
;~      Sleep(300)
    Else
        WinSetOnTop($hider, "", 1)
;~      Sleep(300)
;~      GUISetState(@SW_SHOWNA)
    EndIf

    WinMove("hHide", "", $pos[0] + $pos[2]-$T1-8, $pos[1] + $T2, $T1)
    Sleep(200)


;~  WinSetState("ToolBar", "",@SW_SHOW )
WEnd

;~     $aArray[0]+ = X position
;~     $aArray[1] = Y position
;~     $aArray[2] = Width
;~     $aArray[3] = Height

Other way flowing with cover graphic. 

Edited by slaultu

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...