Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-29-2008, 06:29 AM
Senior Member
 
Join Date: Nov 2007
Posts: 128
Default 2 Questions

1.) I have a keyListerner in flash. I noticed it doesn't work when the window is hidden or when the window isn't focused on. Is there a way to have the keyListener work even if the window is hidden or not focused on? I have a tray icon, should it run the script?

2.) I noticed that shadows (under menus, and the right-click menu on the desktop, etc.) freeze when a window is hidden, meaning that they stay there after the menu is gone. Why is this?

Thank you in advance.
Reply With Quote
  #2 (permalink)  
Old 03-05-2008, 08:21 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: 2 Questions

1. Yes, the window can only receive keyboard input when it has focus, i.e. the keystrokes are for the window has keystroke focus. If your window is hidden, you can only define some hot key combinations for it.

2. Can you post a screen shot. Thanks.
Reply With Quote
  #3 (permalink)  
Old 03-06-2008, 04:08 AM
Senior Member
 
Join Date: Nov 2007
Posts: 128
Default Re: 2 Questions

1.) How can I do that?

2.) Screenshot attached.

New questions:

3.) Can you make the balloon tip appear in other places instead of on the tray icon?

4.) How to keep the getWindowsName() method constantly updated.

5.) How to use the code here(to get battery charge) and here (to uninstall a device) with the ScriptHost? I tried to play around with it, but no luck...

6.) How to rename the extention of an ico file? Not convert it, but just change the end ".ico" part to jpeg
Reply With Quote
  #4 (permalink)  
Old 03-08-2008, 05:12 PM
js js is offline
Senior Member
 
Join Date: Jun 2007
Posts: 110
Default Re: 2 Questions

I have noticed that it takes a long time to get responses around here. Maybe we should just email them instead... :-*

HAHAHA 8)
Reply With Quote
  #5 (permalink)  
Old 03-10-2008, 11:24 PM
Senior Member
 
Join Date: Nov 2007
Posts: 128
Default Re: 2 Questions

Usually I have much more patience, but it has been almost a week. Can I please get a reply?
Reply With Quote
  #6 (permalink)  
Old 03-11-2008, 09:40 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: 2 Questions

1.
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 identifier");
// registers hot key 'CTRL+ALT+Z"
RegisterHotKey(getMainWnd().handle, id, /*MOD_CONTROL | MOD_ALT*/2 | 1, /*VK_Z*/0x5A);

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) {
		Dialogs.msgBox("The hot key combination has been pressed!");
	}
}
2. Can you send us the exe file? We need further testing. Thank you.

3. yes, but too complicated to do that in ffish script

4. calling it constantly.

5. 1) PowerStatus: that's a .NET 2 property, which cannot be called in ffish script. You will have to use Win32 API instead
Code:
struct {
 unsigned char  ACLineStatus;     
 unsigned char  BatteryFlag;     
 unsigned char  BatteryLifePercent;  
 unsigned char  Reserved1;      
 unsigned long BatteryLifeTime;   
 unsigned long BatteryFullLifeTime; 
} SYSTEM_POWER_STATUS;

dllimport "kernel32.dll" stdcall Boolean GetSystemPowerStatus(SYSTEM_POWER_STATUS*);
var output = new Object;
output.value = new Struct(SYSTEM_POWER_STATUS);

GetSystemPowerStatus(output);
trace(output.value.BatteryLifePercent);
2) devcon is a command line tool, you can call it by using the "Shell.run" method.

6.
Code:
// rename a file
function changeExt(fileName, newExt) {
	var f = new File(fileName);
	var pp = f.parentPath;
	var name = f.name;
	
	var index = name.lastIndexOf(".");
	if (index >= 0) {
		var newname = name.substring(0, index + 1);
		newname += newExt;
		f.move(pp + "\\" + newname);
		
	} else {
		name += "." + newExt;
		f.move(pp + "\\" + name);
	}
}

changeExt("c:\\url.txt", "jpg");
Reply With Quote
  #7 (permalink)  
Old 03-26-2008, 11:43 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: 2 Questions

In flash
Code:
import flash.external.*;

function onHotKey() {
  text = flash;
  myfakewindow._alpha = 0;
}
ExternalInterface.addCallback("flash_onHotKey", null, onHotKey);
In the "initialize" script of swfkit
Code:
Application.registerASMethods("flash_onHotKey");

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 identifier");
// registers hot key 'CTRL+ALT+Z"
RegisterHotKey(getMainWnd().handle, id, /*MOD_CONTROL | MOD_ALT*/2 | 1, /*VK_Z*/0x5A);

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) {
		flash_onHotKey();
	}
}
Reply With Quote
  #8 (permalink)  
Old 03-30-2008, 11:32 PM
Senior Member
 
Join Date: Nov 2007
Posts: 128
Default Re: 2 Questions

My source files are to big! Even when ziipped! What do I do?

And...How can I make it so that the user only has to press one key instead of three?

Thanks!,
Motionman95
Reply With Quote
  #9 (permalink)  
Old 03-31-2008, 04:48 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: 2 Questions

It is hard for only pressing one key. A hook dll might be necessary.
Reply With Quote
  #10 (permalink)  
Old 04-01-2008, 12:47 AM
Senior Member
 
Join Date: Nov 2007
Posts: 128
Default Re: 2 Questions

So you'll get back to me later?? ???
Reply With Quote
Reply

Was this information helpful?    Yes No



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:03 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.