Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-02-2009, 12:32 PM
Junior Member
 
Join Date: Aug 2007
Posts: 15
Default Hotkey

Is there a way to make your application show/hide when pressing a hotkey (like, CTRL + SPACE)?
Reply With Quote
  #2 (permalink)  
Old 02-03-2009, 03:36 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default

Yes, it's possible in swfkit pro.

The following is the code
Code:
dllimport "user32.dll" stdcall Boolean RegisterHotKey(pointer, int, unsigned int, unsigned int);
dllimport "user32.dll" stdcall Boolean UnregisterHotKey(pointer, int);
dllimport "kernel32.dll" stdcall int GlobalAddAtomA(String);

var id = GlobalAddAtomA("My hot key identifier1");
// registers hot key 'CTRL+SPACE"
RegisterHotKey(getMainWnd().handle, id, /*MOD_CONTROL | MOD_ALT*/2, /*VK_SPACE*/0x20);

getMainWnd().onClose = function () {
	UnregisterHotKey(this.handle, id);
}

// handles the hot key message
getMainWnd().onMessage = function (msg, wparam, lparam) {
	if (msg == /*WM_HOTKEY*/0x312 && wparam == id) {
		var wnd = getMainWnd();
		if (wnd.visible) wnd.hide();
		else wnd.show();
	}
}
Reply With Quote
  #3 (permalink)  
Old 02-04-2009, 10:20 PM
Junior Member
 
Join Date: Jan 2009
Posts: 7
Smile Alt-F4

It's very usable, thnx Swfkit.
I use for capture Alt-F4, and it's works.

Quote:
RegisterHotKey(getMainWnd().handle, id, 1, 0x73);
Reply With Quote
Reply

Was this information helpful?    Yes No



Tags
hotkey, key

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 05:36 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.