Home » Developing U++ » UppHub » New functions to SysInfo
| New functions to SysInfo [message #19427] |
Wed, 03 December 2008 09:57  |
 |
koldo
Messages: 3458 Registered: August 2008
|
Senior Veteran |
|
|
Hello all
After this first group of functions I want to include in January functions to handle with:
- Change or retrieve window size and position
- Screen capture: Certain window or all the screen
--- Image
--- Video
- Simulate user input
--- Mouse move and click without a mouse
--- Keyboard clicking without a keyboard
Best regards
Koldo
Best regards
Iñaki
|
|
|
|
|
|
|
|
|
|
| Re: New functions to SysInfo [message #20575 is a reply to message #19427] |
Tue, 24 March 2009 09:19   |
|
|
| koldo wrote on Wed, 03 December 2008 10:57 | Hello all
After this first group of functions I want to include in January functions to handle with:
- Change or retrieve window size and position
- Screen capture: Certain window or all the screen
--- Image
--- Video
- Simulate user input
--- Mouse move and click without a mouse
--- Keyboard clicking without a keyboard
Best regards
Koldo
|
NICE FUNCTION! I'LL BE GLAD TO TEST IT!
|
|
|
|
| Re: New functions to SysInfo [message #20731 is a reply to message #19427] |
Thu, 02 April 2009 12:01   |
 |
koldo
Messages: 3458 Registered: August 2008
|
Senior Veteran |
|
|
Hello all
I will insert these functions in Bazaar this afternoon
void Mouse_LeftClick();
void Mouse_MiddleClick();
void Mouse_RightClick();
void Mouse_LeftDblClick();
void Mouse_MiddleDblClick();
void Mouse_RightDblClick();
void Mouse_SetPos(long x, long y, long windowId);
void Mouse_GetPos(long &x, long &y);
void Keyb_SendKeys(String text, long finalDelay = 100, long delayBetweenKeys = 50);
void Window_GetRect(long windowId, long &left, long &top, long &right, long &bottom);
void Window_SetRect(long windowId, long left, long top, long right, long bottom);
bool Window_SaveCapture(long windowId, const char *fileName);
Usually I prefer to wait an release things for Linux and Windows but this time I have few time so I have only done them for Windows.
Tested in MinGW and MSC9 in XP.
All feedback is acknowledged.
Best regards
Koldo
Best regards
Iñaki
|
|
|
|
| Re: New functions to SysInfo [message #21193 is a reply to message #20731] |
Fri, 08 May 2009 16:03   |
|
|
Hello Koldo!
Do you know how can I handle global shortcut in U++?
I want to realized global shortcut for Google Translation!
Somebody know how can I handle a global shortcut for win32 and Linux?
Thanks in advance!
|
|
|
|
|
|
| Re: New functions to SysInfo [message #21203 is a reply to message #21202] |
Sat, 09 May 2009 11:09   |
|
|
| koldo wrote on Sat, 09 May 2009 10:15 | Hello tojocky
As I did not know about that I have taken this definition from Gnome, but seems to be useful everywhere:
| Quote: | Global shortcut keys enable you to use the keyboard to perform tasks related to your desktop, rather than tasks on the currently selected window or application
|
It seems to be related to the desktop system (gnome, kde)
Best regards
Koldo
|
I need this handle in windows too!
|
|
|
|
|
|
|
|
| Re: New functions to SysInfo [message #21212 is a reply to message #21205] |
Sat, 09 May 2009 22:01   |
|
|
Hello Koldo!
Yes, You understand me correct!
I want to handle the shortcut key when the GoogleTranslator is running (is in tray or opened main window).
For the first I would like to handle the shortcut [Ctrl]+[C]+[C] or [Ctrl]+[Ins]+[Ins] . With this handle I can read from buffer the copied text and translate this.
If I'm wrong, please correct me.
If you can give me a simple example about this, i will be glad!
Thank you Koldo!
|
|
|
|
|
|
|
|
|
|
|
|
| Re: New functions to SysInfo [message #21282 is a reply to message #21252] |
Mon, 11 May 2009 15:53   |
|
|
| Mindtraveller wrote on Sun, 10 May 2009 23:50 | Koldo, if you know better solution for POSIX - please tell. IMO xbindkeys is better than local cycle at least because it will make ONE cycle for ALL executed programs, and even if you run a number of programs based on U++/xbindkeys, you`ll get only ONE cycle. But I`m not really shure if it is portable solution. So one needs to investigate which window managers / distributives have this utility and which are not.
|
Someone knows what uses native Linux and MacOS.
Is possible to add this in U++?
|
|
|
|
| Re: New functions to SysInfo [message #21333 is a reply to message #21219] |
Wed, 13 May 2009 17:12   |
|
|
| koldo wrote on Sun, 10 May 2009 09:50 |
| tojocky wrote on Sat, 09 May 2009 22:01 | Hello Koldo!
Yes, You understand me correct!
I want to handle the shortcut key when the GoogleTranslator is running (is in tray or opened main window).
For the first I would like to handle the shortcut [Ctrl]+[C]+[C] or [Ctrl]+[Ins]+[Ins] . With this handle I can read from buffer the copied text and translate this.
If I'm wrong, please correct me.
If you can give me a simple example about this, i will be glad!
Thank you Koldo!
|
Hello tojocky
You can use this
CONSOLE_APP_MAIN
{
TimeStop t;
int t_ctrl_l, t_ctrl_r;
t_ctrl_r = t_ctrl_l = 0;
while (true) {
char ctrl_l = (char)GetKeyState(VK_LCONTROL);
if (ctrl_l & 128) // Left Ctrl pressed
t_ctrl_l = t.Elapsed();
char ctrl_r = (char)GetKeyState(VK_RCONTROL);
if (ctrl_r & 128) // Right Ctrl pressed
t_ctrl_r = t.Elapsed();
if (t_ctrl_r - t_ctrl_l < 300 && t_ctrl_r - t_ctrl_l > 0) {
puts("Voila");
t_ctrl_r = t_ctrl_l = 0;
}
Sleep(100);
}
This will out a "Voila" when a Ctrl left and a Ctrl right are pressed.
For a Gui application remove the while loop and the Sleep() and put this in a Timer function.
Best regards
Koldo
|
Hello Koldo,
Can you emulate shortcut event [Ctrl]+[C]+[C] in your example?
Sorry for incompetence, but in this event I'm new!
|
|
|
|
|
|
|
|
| Re: New functions to SysInfo [message #22447 is a reply to message #21816] |
Wed, 15 July 2009 23:37   |
 |
koldo
Messages: 3458 Registered: August 2008
|
Senior Veteran |
|
|
Hello all
I have included a new SysInfo_demo_console package to demonstrate many SysInfo functions in a gui program for Linux and Windows.
Some screenshots are included in a single image below.
There are also included in SysInfo new functions (only Windows by now) to:
- Record the desktop or window activity in a video file. If defined it includes real mouse movement
- Get the list of installed programs
- Get the list of video cards
Internally WMIC has been substituted by WMI, so the program has better access to the internal system including in Vista.
This advantage however requires only for MinGW to copy the next files:
- Rpcsal.h, DispEx.h, WbemCli.h, WbemDisp.h, Wbemidl.h, WbemProv.h and WbemTran.h
from \Microsoft SDKs\Windows\v6.1\Include
to \Upp\MinGW/include
- wbemuuid.lib
from \Microsoft SDKs\Windows\v6.1\Lib
to \Upp\MinGW\lib
Best regards
Koldo
-
Attachment: SysInfo.png
(Size: 134.66KB, Downloaded 793 times)
Best regards
Iñaki
[Updated on: Wed, 15 July 2009 23:45] Report message to a moderator
|
|
|
|
|
|
| Re: New functions to SysInfo [message #25333 is a reply to message #22450] |
Wed, 17 February 2010 14:42   |
|
|
Hello Koldo!
Can I ask you about get screenshot from linux.
Why you use xwd shell command but not directly from x11 lib function
XImage *XGetImage(display, d, x, y, width, height, plane_mask, format)
Display *display;
Drawable d;
int x, y;
unsigned int width, height;
unsigned long plane_mask;
int format;
Here is full description:
http://tronche.com/gui/x/xlib/graphics/XGetImage.html
In the end you made a great job!
Regards, Ion Lupascu (tojocky)
|
|
|
|
| Re: New functions to SysInfo [message #25335 is a reply to message #25333] |
Wed, 17 February 2010 15:50   |
 |
koldo
Messages: 3458 Registered: August 2008
|
Senior Veteran |
|
|
| tojocky wrote on Wed, 17 February 2010 14:42 | Hello Koldo!
Can I ask you about get screenshot from linux.
Why you use xwd shell command but not directly from x11 lib function
XImage *XGetImage(display, d, x, y, width, height, plane_mask, format)
Display *display;
Drawable d;
int x, y;
unsigned int width, height;
unsigned long plane_mask;
int format;
Here is full description:
http://tronche.com/gui/x/xlib/graphics/XGetImage.html
In the end you made a great job!
Regards, Ion Lupascu (tojocky)
|
Thank you tojocky 
I recognize I was lazy when using xwd.
Now your proposal is in the todo list
Best regards
Iñaki
|
|
|
|
| Re: New functions to SysInfo [message #25340 is a reply to message #25335] |
Wed, 17 February 2010 18:20  |
|
|
You are welcome!
I'm glad that my proposal help you!
Thank you for add this in the todo list!
| koldo wrote on Wed, 17 February 2010 16:50 |
Thank you tojocky 
I recognize I was lazy when using xwd.
Now your proposal is in the todo list 
|
|
|
|
|
Goto Forum:
Current Time: Tue May 05 00:38:09 GMT+2 2026
Total time taken to generate the page: 0.01294 seconds
|