Page 1 of 1

Hotkeys and Screenshot

Posted: Thu Apr 29, 2010 3:03 pm
by haroldjpa
Hello how are you?

Well, All the following in Wxwidgets...
1) i need know how to create a hotkey in my Wxapp, my Wxapp will must run in background and activate when i press hotkey on windows, but i don't know how to do it.¿ Do you know it?

2) How to do Screenshot with wxwidgets in .jpg format.


Thank a lot

Español

Hola como estan?
Bueno, Todo lo siguiente en WxWidgets
1) Necesito saber como crear un hotkey usando wxwidgets, la idea es que la wxapp se ejecute en segundo plano y se active al presionar esta hotkey.

2) como puedo capturar la pantalla en formato .jpg

Muchas gracias

Re: Hotkeys and Screenshot

Posted: Mon Nov 19, 2012 1:44 pm
by efriend
Hi comunity, i need the same about :
2) How to do Screenshot with wxwidgets in .jpg format.

Any idea of how resolve this in wxWidgets 2.8.7 ??

Regards.
haroldjpa wrote:Hello how are you?

Well, All the following in Wxwidgets...
1) i need know how to create a hotkey in my Wxapp, my Wxapp will must run in background and activate when i press hotkey on windows, but i don't know how to do it.¿ Do you know it?

2) How to do Screenshot with wxwidgets in .jpg format.


Thank a lot

Español

Hola como estan?
Bueno, Todo lo siguiente en WxWidgets
1) Necesito saber como crear un hotkey usando wxwidgets, la idea es que la wxapp se ejecute en segundo plano y se active al presionar esta hotkey.

2) como puedo capturar la pantalla en formato .jpg

Muchas gracias

Re: Hotkeys and Screenshot

Posted: Mon Nov 19, 2012 2:58 pm
by DavidHart
Hi,

You need to use wxScreenDC. A search of the forum will find various posts e.g. this one.

Regards,

David

Re: Hotkeys and Screenshot

Posted: Wed Nov 21, 2012 9:12 pm
by jgrzybowski
According to “hot key” subject:

Hot keys can be defined in simply way (Menu Item Editor) or manually (wxAcceleratorEntry, SetAcceleratorTable), but I am afraid that it works only if Wxapp is already activated. May be you should search hot keys on Windows side?

Regards
Jarek

Re: Hotkeys and Screenshot

Posted: Fri Dec 14, 2012 10:06 am
by makfromkz
DavidHart wrote:Hi,

You need to use wxScreenDC. A search of the forum will find various posts e.g. this one.

Regards,

David
from this one have too many errors for compilation :
15 E:\wxdevcpp\Dev-Cpp\include\common\wx\defs.h:3369:0, from E:\wxdevcpp\Dev-Cpp\include\common\wx\dcscreen.h In file included from E:/wxdevcpp/Dev-Cpp/include/common/wx/defs.h:3369:0, from E:/wxdevcpp/Dev-Cpp/include/common/wx/dcscreen.h
15 E:\wxdevcpp\Dev-Cpp\include\common\wx\dcscreen.h:15, from E:\wxdevcpp\Dev-Cpp\include\common\wx\msw\dcscreen.h from E:/wxdevcpp/Dev-Cpp/include/common/wx/dcscreen.h:15, from E:/wxdevcpp/Dev-Cpp/include/common/wx/msw/dcscreen.h
2 E:\Dev-Cpp\проекты\Скриншот\main.cpp from main.cpp
E:\wxdevcpp\Dev-Cpp\include\common\wx\msw\winundef.h In function 'HWND__* CreateDialog(HINSTANCE, LPCTSTR, HWND, DLGPROC)'::
20 E:\wxdevcpp\Dev-Cpp\include\common\wx\msw\winundef.h:39 cannot convert 'LPCTSTR {aka const char*}' to 'LPCWSTR {aka const wchar_t*}' for argument '2' to 'HWND__* CreateDialogParamW(HINSTANCE, LPCWSTR, HWND, DLGPROC, LPARAM)'

and many many errors
piece of code:

Code: Select all

#include <windows.h>
#include <wx/msw/dcscreen.h>
/*  Declare Windows procedure  */
LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);

/*  Make the class name into a global variable  */
char szClassName[ ] = "WindowsApp";
// makfromkz {
/*
void MakeScreenShot() 
{ 
wxScreenDC dcScreen; 

int height = GetSystemMetrics(SM_CYVIRTUALSCREEN ) ; 
int width = GetSystemMetrics(SM_CXVIRTUALSCREEN) ;
..........