Hotkeys and Screenshot Topic is solved

If you are using wxDev-C++ for your wxWidgets design, please ask your questions here instead of in IDE Related.
Post Reply
haroldjpa
Knows some wx things
Knows some wx things
Posts: 25
Joined: Mon Oct 16, 2006 11:43 pm

Hotkeys and Screenshot

Post by haroldjpa » Thu Apr 29, 2010 3:03 pm

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
Si sabes espa

efriend
In need of some credit
In need of some credit
Posts: 1
Joined: Thu Jul 26, 2012 3:55 pm

Re: Hotkeys and Screenshot

Post by efriend » Mon Nov 19, 2012 1:44 pm

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

DavidHart
Site Admin
Site Admin
Posts: 4006
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Hotkeys and Screenshot

Post by DavidHart » Mon Nov 19, 2012 2:58 pm

Hi,

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

Regards,

David

jgrzybowski
Earned some good credits
Earned some good credits
Posts: 113
Joined: Sat Sep 24, 2011 9:32 pm
Location: Poland

Re: Hotkeys and Screenshot

Post by jgrzybowski » Wed Nov 21, 2012 9:12 pm

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

makfromkz
In need of some credit
In need of some credit
Posts: 1
Joined: Fri Dec 14, 2012 9:51 am

Re: Hotkeys and Screenshot

Post by makfromkz » Fri Dec 14, 2012 10:06 am

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) ;
..........

Post Reply