Alteração nas variáveis de retorno

master
Leonardo Domingues 2021-12-02 18:35:00 -03:00
parent 6c981f4196
commit c03689b9fc
1 changed files with 12 additions and 12 deletions

View File

@ -304,14 +304,14 @@ func (c *Cli) NotifyBeep(msg, title string) error {
/***************** Window Functions *****************/
func (c *Cli) WindowList(s string) error {
err := c.HttpCli().JsonGet("/ipc/window/list?s="+s, nil)
return err
func (c *Cli) WindowList(s string) (ret []map[string]interface{}, err error) {
err = c.HttpCli().JsonGet("/ipc/window/list?s="+s, &ret)
return ret, err
}
func (c *Cli) WindowHwnd(s string) error {
err := c.HttpCli().JsonGet("/ipc/window/hwnd?s="+s, nil)
return err
func (c *Cli) WindowHwnd(s string) (ret []int, err error) {
err = c.HttpCli().JsonGet("/ipc/window/hwnd?s="+s, &ret)
return ret, err
}
func (c *Cli) WindowActivate(Hwnd string) error {
@ -334,23 +334,23 @@ func (c *Cli) WindowMin(Hwnd string) error {
return err
}
func (c *Cli) WindowActiveHwnd() (ret interface{}, err error) {
func (c *Cli) WindowActiveHwnd() (ret int, err error) {
err = c.HttpCli().JsonGet("/ipc/window/activehwnd", &ret)
return ret, err
}
func (c *Cli) WindowWaitActiveTitle(t string, m int) (ret interface{}, err error) {
func (c *Cli) WindowWaitActiveTitle(t string, m int) (ret map[string]interface{}, err error) {
err = c.HttpCli().JsonGet(fmt.Sprintf("/ipc/window/waitactivetitle?t=%s&m=%d", t, m), &ret)
return ret, err
}
func (c *Cli) WindowActiveTitle() (ret interface{}, err error) {
func (c *Cli) WindowActiveTitle() (ret string, err error) {
err = c.HttpCli().JsonGet("/ipc/window/activetitle", &ret)
return ret, err
}
func (c *Cli) WindowWinfo(w string) (ret interface{}, err error) {
err = c.HttpCli().JsonGet("/ipc/window/winfo?w="+w, &ret)
/*func (c *Cli) WindowWinfo(w int) (ret interface{}, err error) {
err = c.HttpCli().JsonGet(fmt.Sprintf("/ipc/window/winfo?w=%d", w), &ret)
return ret, err
}
@ -362,7 +362,7 @@ func (c *Cli) WindowSendMsg(w, m string) error {
func (c *Cli) WindowPostMsg(w, m string) error {
err := c.HttpCli().JsonGet(fmt.Sprintf("/ipc/window/postmsg?w=%s&m=%s", w, m), nil)
return err
}
}*/
func NewCli() *Cli {
ret := &Cli{ApiCli: api.NewApiCli()}