robotgo/window/goWindow.h

75 lines
1.5 KiB
C
Raw Permalink Normal View History

2017-02-09 16:19:10 +00:00
// Copyright 2016-2017 The go-vgo Project Developers. See the COPYRIGHT
2016-11-10 06:34:13 +00:00
// file at the top-level directory of this distribution and at
2016-12-10 18:41:08 +00:00
// https://github.com/go-vgo/robotgo/blob/master/LICENSE
2016-11-10 06:34:13 +00:00
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
2016-11-05 08:16:26 +00:00
#include "alert_c.h"
2016-11-10 10:59:37 +00:00
#include "window.h"
2016-11-05 08:16:26 +00:00
int aShowAlert(const char *title, const char *msg, const char *defaultButton,
const char *cancelButton){
2016-11-07 10:34:21 +00:00
int alert=showAlert(title,msg,defaultButton,cancelButton);
2016-11-05 08:16:26 +00:00
2016-11-07 10:34:21 +00:00
return alert;
2016-11-07 14:36:28 +00:00
}
2016-11-10 10:59:37 +00:00
bool aIsValid(){
bool abool=IsValid();
return abool;
}
2016-11-10 11:03:11 +00:00
// int aFindwindow(char* name){
// int z=findwindow(name);
// return z;
// }
2016-11-10 10:59:37 +00:00
void aCloseWindow(void){
CloseWin();
}
2016-11-28 12:41:15 +00:00
bool aSetHandle (uintptr handle){
bool hwnd=setHandle(handle);
return hwnd;
}
2016-11-10 10:59:37 +00:00
uintptr aGetHandle(){
uintptr hwnd=getHandle();
return hwnd;
}
2017-02-06 11:10:10 +00:00
uintptr bGetHandle(){
MData mData=GetActive();
#if defined(IS_MACOSX)
return (uintptr)mData.CgID;
#elif defined(USE_X11)
return (uintptr)mData.XWin;
#elif defined(IS_WINDOWS)
return (uintptr)mData.HWnd;
#endif
}
2016-11-23 12:40:28 +00:00
void aSetActive(const MData win){
SetActive(win);
}
2016-11-10 10:59:37 +00:00
MData aGetActive(){
MData mdata=GetActive();
return mdata;
}
char* aGetTitle(){
char* title=GetTitle();
// printf("title::::%s\n",title );
return title;
}
2017-01-18 12:34:35 +00:00
int32 aGetPID(void){
int pid=WGetPID();
return pid;
}