Friday, February 26, 2010

Flash PLayer 10.1 on the Google Nexus One

Thibault Imbert and Michael Chaize demonstrate the power of the new Flash PLayer 10.1 on the Google Nexus One. http://vimeo.com/9596010 I apologize for my bad battery management shooting the video. For those who wants to see how the battery reacts playing Flash content on the Google Nexus One, please check that blog post: flashmobileblog.com/2010/02/24/battery-performance-with-flash-player-10-1-on-nexus-one/

Thursday, February 18, 2010

Where Microsoft's Profits Come From

http://www.osnews.com/story/22871/Where_Microsoft_s_Profits_Come_From

the evolution of Photoshop

http://ronation.co.uk/photoshop/the-evolution-of-photoshop-1988-2010/

Tuesday, February 09, 2010

Erik Natzke

Erik Natzke’s generative paintings are made using Flash, sometimes from sampled photos and video and other times from scratch. He controls very specifically the environment in which his creations thrive, leaving the artwork’s specificities to the whim of the code.




http://jot.eriknatzke.com/
http://vimeo.com/2090593
http://centripetalnotion.com/2007/11/30/03:35:23/

Wednesday, February 03, 2010

Android

The Applications layer hosts all Android and third-party applications, and several or more third-party applications can execute simultaneously. However, as noted, doing so can shorten battery life.

Beneath the Applications layer is the Android Frameworks layer. This layer consists of Java classes that provide application functions such as window management, window content display, application messaging, and handling phone calls. Obviously the interface Android presents at this level uses the Java programming language, and because the source code is available, you can modify these classes to extend their capabilities or over override their behavior. Note that some of the lower levels in the stack present C++ interfaces.

Next on the software stack comes the Libraries and Runtime layer. The libraries implement 2D and 3D graphics support, along with multimedia content decoding. This layer has engines to support application features, such as a SQLite database engine and WebKit, which handles web content rendering.

Like Java ME, Android strives for hardware independence by using a bytecode interpreter to execute Android applications. However, it doesn't use Sun's JVM, but instead uses its own Dalvik Virtual Machine (DVM). The advantage to Android's use of a different bytecode interpreter is that the DVM was designed so that multiple instances of it can run, each in their own protected memory space, and each executing an application. While this approach offers stability and a robust environment for running multiple applications, it does so at the expense of compatibility with Java ME applications.

The lowest layer of the stack is the Linux kernel. It provides preemptive multitasking and system services such as threads, networking services, and process management. It handles all low-level drivers and manages the device's power




My favorites device right now is the

Samsung Behold II which is now official. It is offered by T-Mobile and run on Android OS. Behold II is also known as SGH-t939 and is quite an impressive phone.

The device has a 3.2″ AMOLED touch-screen, supports 3G networks and T-Mobile promises it will be out before the holidays.

Samsung Behold II will be Samsung’s first Android-powered device with T-Mobile and will have an integrated GPS receiver
so you can take full advantage of Google Maps, and hundreds of others apps that uses location information.

Samsungs Touchwiz 2.0 and Cube Interface is pretty slick and is a great demonstration of what Open GL can deliver on handled handset



Samsung Behold II Feature list

Wednesday, January 27, 2010

How to retrieve XMP Data/Cuepoints using the FLVPlayback

Some users may wonder how they can retrieve the XMP data using the FLVplayback Component.

The best approach is based on the following article

http://www.adobe.com/devnet/flash/articles/flvplayback_fplayer9u3_04.html

and consist of implementing your own Custom callbacks via a custom client class


The FLVPlayback component automatically creates an instance of the class fl.video.VideoPlayerClient, assigns it to the NetStream's client property, and handles all callback messages that come through the NetStream. The default class fl.video.VideoPlayerClient handles only the callbacks onMetaData() and onCuePoint(). Both of these messages generate events (MetadataEvent.METADATE_RECEIVED and MetadataEvent.CUE_POINT) so that you do not need to register a custom class to handle these callbacks.

However, if you do wish to use custom callbacks, you must register a custom client class. You should extend fl.video.VideoPlayerClient to ensure that the onMetaData() and onCuePoint() handling supplied by VideoPlayer and FLVPlayback will continue to work properly.

The requirements for a custom client implementation are as follows:

* The constructor method must take an fl.video.VideoPlayer instance as its only parameter.
* The custom class must include a ready property which should be set to true when all messages expected at the very beginning of the NetStream have been received. This step is necessary because the VideoPlayer class initially hides the video and plays the beginning of the file to access the correct dimensions and duration of the video. It then quickly rewinds the video to the beginning and unhides it. If the rewind occurs before all messages at the very beginning of the file are received by VideoPlayer, there's a chance those messages may never be received.
* It is highly recommended that you declare the custom class as dynamic to avoid encountering runtime errors. Errors may appear if any callbacks are triggered that the class is not set up to handle.
* It is also recommended to extend fl.video.VideoPlayerClient to ensure proper onMetaData() and onCuePoint() handling.

1) Create a new extented Metadata EVENT

Copy IVPEvent.as from the source code of FLVplayback locally under your FLA project under fl\video sub folder

Use the code below to register a new extended event save it in a file ExtendedMetadataEvent.as


package fl.video {

import flash.events.Event;

/**
* Flash® Player dispatches a ExtentedMetadataEvent object when the user
* requests the FLV/F4V/H264 file's metadata information packet (NetStream.onXMPData)
*
* @langversion 3.0
* @playerversion Flash 9.0.28.0
*/
public class ExtendedMetadataEvent extends fl.video.MetadataEvent {


/**
* Defines the value of the
* type property of a xmpDataReceived event object.
*
* @see FLVPlayback#event:xmpDataReceived xmpDataReceived event
* @eventType xmpDataReceived
* @langversion 3.0
* @playerversion Flash 10.0.0.0
*/
public static const XMPDATA_RECEIVED:String = "xmpDataReceived";


/**
* Creates an Event object that contains information about metadata events.
* Event objects are passed as parameters to event listeners.
*
* @param type The type of the event. Event listeners can access this information
* through the inherited type property. Possible values are MetadataEvent.XMPDATA_RECEIVED.
*
* @param bubbles Determines whether the Event object participates in the bubbling
* stage of the event flow. Event listeners can access this information through the
* inherited bubbles property.
*
* @param cancelable Determines whether the Event object can be canceled. Event listeners can
* access this information through the inherited cancelable property.
*
* @param info Determines the dynamic properties to add.
*
* @param vp Determines the index of the VideoPlayer object.
*
* @langversion 3.0
* @playerversion Flash 9.0.28.0
*
*/
public function ExtendedMetadataEvent( type:String, bubbles:Boolean=false, cancelable:Boolean=false,
info:Object=null, vp:uint=0) {
super(type, bubbles, cancelable);
super.info = info;
super.vp = vp;
}


/**
* @private
*/
override public function clone():Event
{
return new ExtendedMetadataEvent(type, bubbles, cancelable, info, vp);
}

} // class ExtendedMetadataEvent

} // package fl.video



2) Use the code below to register the custom client class:


package {

import fl.video.VideoPlayer;
import fl.video.VideoPlayerClient;
import fl.video.ExtendedMetadataEvent;

import flash.events.Event;
import flash.events.EventDispatcher;

import flash.display.Loader;
import flash.display.DisplayObjectContainer;
import flash.utils.ByteArray;


/**
* NetstreamDataVideoClient subclasses VideoPlayerClient, the default
* VideoPlayer.netStreamClientClass value. This way all
* the metadata and cue point handling built in the
* VideoPlayer works properly.
*
* The class is declared dynamic so if any other
* messages are received that we do not support in
* this class (onTextData(), other custom
* messages) no runtime errors will occur.
*/

dynamic public class NetstreamDataVideoClient extends VideoPlayerClient
{

/**
* This variable is set in onImageData and is used to help
* determine when the ready property should be true.
*/

protected var gotXMPData:Boolean;
protected var gotImageData:Boolean;
public var XMPString:String = "";
protected var verbose:Boolean = false;

/**
* The constructor must take a VideoPlayer as its
* only parameter. It needs to pass that argument
* along to the super constructor.
*/

public function NetstreamDataVideoClient(vp:VideoPlayer) {
super(vp);
gotImageData = false;
gotXMPData = false;
}

/**
* Handling for onImageData() message
* Loads the image bytes into a flash.display.Loader
* and adds the image to the
*/

public function onImageData(info:Object):void {
// Only handle onImageData() once. Any time we seek to the
// start of the file, the message will call this function
// again
trace("onImageData");
if (gotImageData)
return;
var loader:Loader = new Loader();
loader.loadBytes(info.data);
var parent:DisplayObjectContainer = _owner.root as DisplayObjectContainer;
if (parent) {
parent.addChildAt(loader, 0);
}
gotImageData = true;
}

public function onTextData(info:Object):void {
trace(info);
recurseTrace(info, "");
}


// FOR LOCAL FILE OR HTTP
public function onXMPData(info:Object):void {
if (gotXMPData)
return;

if (verbose)
trace("NetstreamDataVideoClient onXMPData");

// F4V/H264 uses data to pass raw XMP
if (info.data!= undefined)
{
if (verbose)
trace(info.data);
}
else
{
if (info.liveXML!= undefined)
{
// FLV uses liveXML to pass raw XMP
if (verbose)
trace(info.liveXML);
}
}

gotXMPData = true;

// for (var i in info)
// {
// trace(i + " is " + info[i]);
// }
// trace("####\n");

// XMP came from Adobe Media Encoder for Flash
if (info.data!= undefined)
{
XMPString = info.data;

_owner.dispatchEvent(new ExtendedMetadataEvent(ExtendedMetadataEvent.XMPDATA_RECEIVED, false, false, info));
}
else
{
if (info.liveXML!= undefined)
{
XMPString = info.liveXML;

_owner.dispatchEvent(new ExtendedMetadataEvent(ExtendedMetadataEvent.XMPDATA_RECEIVED, false, false, info));
}
}
}


private function recurseTrace(info:Object, indent:String):void
{
for (var i:* in info) {
if (typeof info[i] == "object") {
trace(indent + i + ":");
recurseTrace(info[i], indent + " ");
} else {
trace(indent + i + " : " + info[i]);
}
}
}

/**
* property that specifies whether early messages have been
* received so it is OK for the player to rewind back to the
* beginning. If we allow the VideoPlayer to rewind before
* all messages at the very beginning of the file are received,
* we may never receive them.
*
* The default class, VideoPlayerClient, only requires
* onMetaData() to be received before rewinding. onImageData()
* also appears at the beginning of the file, so we might miss
* that if we do not override this property and include a check
* for this data.
*/

override public function get ready():Boolean {
return (super.ready && gotImageData);
}

}
}


IMPORTANT: Don't try to parse the XMP data in the callback as it might be causing some timing issue and you want to give the hand back to the Netstream Object ASAP. Instead fire an event back to your client event listener and make sure you will interpret the data when the video will be in a READY to seek state.


3) Receive XMP Data using FLVPlayback

import NetstreamDataVideoClient;
import fl.video.ExtendedMetadataEvent;
import flash.events.*;
import fl.video.*;

VideoPlayer.netStreamClientClass = NetstreamDataVideoClient;

_playback = new FLVPlayback();
_playback.width = 1280;
_playback.height = 720;
_playback.autoRewind = false;
_playback.bufferingBarHidesAndDisablesOthers = true;
_playback.visible = true;
addChild(_playback);
_playback.addEventListener(MetadataEvent.METADATA_RECEIVED, metadataListener);
// the XMP one
_playback.addEventListener(ExtendedMetadataEvent.XMPDATA_RECEIVED,xmpListener);



private function xmpListener(inEvt:fl.video.ExtendedMetadataEvent):void {
var XMPString:String = "";
if (this.verbose)
trace("--- xmpListener ----");
if (this.verbose) {
if (inEvt.info.data!= undefined)
{
XMPString = inEvt.info.data;

trace("RECEIVED XMP DATA = " + XMPString);
// ready to parse
}
else
{
if (inEvt.info.liveXML!= undefined)
{
XMPString = inEvt.info.liveXML;

trace("RECEIVED XMP DATA = " + XMPString);
// ready to parse
}
}
}
}


Hope you enjoy this article !
Time to interpret the data now

http://younsi.blogspot.com/2008/12/interactive-video-in-flash-using-f4v.html

and store some useful XMP Data

http://www.actimus.com/

Free AS3 Interactive Video FLVPlayback component for FLASH CS5

http://shop.actimus.com/product_info.php?products_id=122

Tuesday, January 19, 2010

Urgence Haïti. Internet is finally up

Bill (woody) is an independant internet guru who is highly respected.

On Jan 18, 2010, at 3:46 PM, @…edu.ht wrote:
| > The Teleco Building where ns1.nic.ht and ns2.nic.ht are (were) is completely dust.
| > Thanks a lot for your time to keep .ht up and running well.
|
| Believe me, that's the least we could do.
| And please know that you have our deepest sympathy.
|
| In case you have time to look it over, here are the other things we've been focusing our effort on.
| I'd appreciate a sanity-check, and any help you might be able to give us in prioritizing,
| or letting us know when you know that someone else is already covering something:
|
| - Arranging US military deliveries of diesel to Reynold for the two generators at Boutilliers Hill.
|
| - Coordinating Columbus, Tyco, the Marine Research labs at the University of Puerto Rico, and the US Navy,
| to try to get a festoon cable run from Santo Domingo to Port au Prince, and/or an extension
| from the Columbus branching unit that lies between Port au Prince and Guantanamo.
| We're making sure that people understand that if this comes to fruition, ownership of anything
| that's been aid-funded needs to be divided among Haitian ISPs, not monopolized within Columbus.
|
| - Arranging delivery of SIP VoIP phones (again to Reynold) for the use of the ISPs, emergency responders,
| and Haitian government. Questions here: Are stand-alone phones preferred, or FXS ports on routers,
| with analog phones? How many? Is the local Haitian ISP community prepared to support them with
| an Asterisk or equivalent back-end? Is there anyone there who's prepared to configure each of
| a batch of stand-alone phones?
|
| - Helping coordinate international law enforcement and the technical community to shut down and prosecute
| con-artists who are setting up fake relief donation web sites and spamming to promote them.
|
| What else can we do to help you?
| -Bill


I'm sure other people involved in the relief work can suggest other things, but a few comments from my point of view:

- Communications capability underpins the ability of other relief workers to do their jobs effectively, so although we, as a community, aren't feeding people or tending to their medical needs, we are helping those who are doing those crucial jobs by allowing them to focus on their work.

- In the short-term, the equipment that's been requested by people on the ground has either already been delivered, is onboard a ship that left Jacksonville about twelve hours ago, or is being containerized to load on a ship that's leaving from Port Everglades tomorrow.

- Also in the short-term, keep an eye out for con-artists who are trying to lure people in to fake aid-donation web sites with spam. Law enforcement is coordinating internationally to take those offline as promptly as possible.

- In the mid-term, what our community needs to do is to make sure that backhaul infrastructure gets into place to move traffic in the 1Gbps-10Gbps range from Port au Prince to Miami. There are several cable systems which land in Santo Domingo, and Columbus has a branching unit off Guantanamo, so our main efforts have been focused on getting a festoon cable run around from the Santo Domingo landing (the University of Puerto Rico Marine Research labs have committed their cable-laying ship, crew, and divers, but we're still looking for an appropriate spool of armored singlemode in the 12-24 core range (more certainly wouldn't hurt, as this would be unrepeatered), and on finding funding to get Columbus to run the spur in from their BU. BTC apparently has fiber already existing or in process of turn-up between Port au Prince and the Bahamas, but nobody's been able to get a response from them yet about its status.

- More generally, as a community, we do good when we make sure that places like this, places that may not have large or lucrative markets, are still served by diverse fiber, rather than by a single fragile monopoly, or not at all, as in Haiti's case. There are many countries as vulnerable as Haiti, and many of them have no fiber. Most humanitarian disasters happen in poor countries and these are generally the countries our community currently has the least capacity to serve. We can think a little more broadly than that, looking to a future when people in poor countries have more smartphones, and students and small businesses are getting online. We don't need to wait for markets to develop... we can invest in those markets, and _cause_ them to develop. Then they won't be as vulnerable to disasters like this.

- Thinking to the longer term... The majority of people who die in humanitarian disasters die of second-order effects like starvation and disease that come in the wake of an earthquake or flood or whatever. That's just beginning now in Haiti, and will continue for some time. The people who died in the earthquake itself will be far outnumbered by those who will die as a result of insufficiently prepared emergency response. PCH and Cisco have been trying for _years_ to get donors to support a ready-to-go emergency communications team for disaster response, but it's been impossible to get donors to fund _preparedness_ rather than after-the-fact response. But immediately after an emergency is the _most expensive_ time to acquire generators and fuel and solar panels and wind generators and batteries and satphones and fiber and space-segments and so forth. All of that can be _much more cheaply_ purchased or contracted for beforehand, and delivered on-site weeks earlier. A!
and those weeks are the weeks of effective response that reduce second-order deaths in the wake of an emergency. People who think they're being helpful with a donation now should understand that the donation would have saved ten times as many lives if it had been made a year ago, than if it's made now. If your companies have charitable foundations, please get them to think about that.

-Bill

Monday, January 18, 2010

avatar vs roger dean

Did Prog Rock's Greatest Artist Inspire Avatar? All Signs Point To Yes

James Cameron spent years creating Avatar's floating islands and crazy dragons, and then an army of concept artists brought them to life. But maybe they had some inspiration from somewhere else? Like classic album-cover artist Roger Dean? Behold the evidence.

Chances are, if you've looked at a weirdshistic record cover by Yes, Asia or other bands, you've admired Roger Dean's paintings of surreal landscapes. If you've ever seen all good people turn their heads each day, then you're already a Dean fan.

Connor Freff Cochran, founder of Conlan Press (which is busy putting out a bunch of Peter S. Beagle books, hosting Beagle's 52/50 poetry subscription service, and putting out art books) contacted us and suggested that Avatar's lush moon might have gained some inspiration from Dean. And when you look at Dean's artwork and compare it to the concept art we posted the other day, it's hard not to see the resemblance.

All of this makes me want to rent Avatar (when it's released on DVD) and see if I can sync it up with YesSongs.

Original Post

http://io9.com/5426120/did-prog-rocks-greatest-artist-inspire-avatar-all-signs-point-to-yes/

Other post

http://blog.signalnoise.com/2010/01/06/avatar-vs-roger-dean/
http://www.yannicklejeune.com/2010/01/avatar-roger-dean.html

Wednesday, December 02, 2009

Web Analytics

With the recent news on Yahoo Finance regarding Omniture-Adobe acquisition, I was curious to know a bit more about Web Analytics and provide pointers to anyone reading my blog. I posted an article some time ago on how to add Google Web Analytics to a SWF. Anyhow, here is a very great blog that I found at Tealium.com for those interested in Web Analytics. The blog is really well written by web Analytics Experts. Former Web Side Story, Visual Science and Omniture folks...


http://www.tealium.com/blog/

Thursday, October 08, 2009

Virtual-Key Codes Windows Platform

The following table shows
the symbolic constant names, decimal values, and mouse or keyboard equivalents
for the virtual-key codes used by the system. The codes are listed in numeric
order.



Virtual-Key Codes

The following table shows the symbolic constant names, hexadecimal values, and mouse or keyboard equivalents for the virtual-key codes used by the system. The codes are listed in numeric order.

Constants

VK_LBUTTON (0x01)
Left mouse button
VK_RBUTTON (0x02)
Right mouse button
VK_CANCEL (0x03)
Control-break processing
VK_MBUTTON (0x04)
Middle mouse button (three-button mouse)
VK_XBUTTON1 (0x05)
Windows 2000/XP: X1 mouse button
VK_XBUTTON2 (0x06)
Windows 2000/XP: X2 mouse button
- (0x07)
Undefined
VK_BACK (0x08)
BACKSPACE key
VK_TAB (0x09)
TAB key
- (0x0A-0B)
Reserved
VK_CLEAR (0x0C)
CLEAR key
VK_RETURN (0x0D)
ENTER key
- (0x0E-0F)
Undefined
VK_SHIFT (0x10)
SHIFT key
VK_CONTROL (0x11)
CTRL key
VK_MENU (0x12)
ALT key
VK_PAUSE (0x13)
PAUSE key
VK_CAPITAL (0x14)
CAPS LOCK key
VK_KANA (0x15)
Input Method Editor (IME) Kana mode
VK_HANGUEL (0x15)
IME Hanguel mode (maintained for compatibility; use VK_HANGUL)
VK_HANGUL (0x15)
IME Hangul mode
- (0x16)
Undefined
VK_JUNJA (0x17)
IME Junja mode
VK_FINAL (0x18)
IME final mode
VK_HANJA (0x19)
IME Hanja mode
VK_KANJI (0x19)
IME Kanji mode
- (0x1A)
Undefined
VK_ESCAPE (0x1B)
ESC key
VK_CONVERT (0x1C)
IME convert
VK_NONCONVERT (0x1D)
IME nonconvert
VK_ACCEPT (0x1E)
IME accept
VK_MODECHANGE (0x1F)
IME mode change request
VK_SPACE (0x20)
SPACEBAR
VK_PRIOR (0x21)
PAGE UP key
VK_NEXT (0x22)
PAGE DOWN key
VK_END (0x23)
END key
VK_HOME (0x24)
HOME key
VK_LEFT (0x25)
LEFT ARROW key
VK_UP (0x26)
UP ARROW key
VK_RIGHT (0x27)
RIGHT ARROW key
VK_DOWN (0x28)
DOWN ARROW key
VK_SELECT (0x29)
SELECT key
VK_PRINT (0x2A)
PRINT key
VK_EXECUTE (0x2B)
EXECUTE key
VK_SNAPSHOT (0x2C)
PRINT SCREEN key
VK_INSERT (0x2D)
INS key
VK_DELETE (0x2E)
DEL key
VK_HELP (0x2F)
HELP key
(0x30)
0 key
(0x31)
1 key
(0x32)
2 key
(0x33)
3 key
(0x34)
4 key
(0x35)
5 key
(0x36)
6 key
(0x37)
7 key
(0x38)
8 key
(0x39)
9 key
- (0x3A-40)
Undefined
(0x41)
A key
(0x42)
B key
(0x43)
C key
(0x44)
D key
(0x45)
E key
(0x46)
F key
(0x47)
G key
(0x48)
H key
(0x49)
I key
(0x4A)
J key
(0x4B)
K key
(0x4C)
L key
(0x4D)
M key
(0x4E)
N key
(0x4F)
O key
(0x50)
P key
(0x51)
Q key
(0x52)
R key
(0x53)
S key
(0x54)
T key
(0x55)
U key
(0x56)
V key
(0x57)
W key
(0x58)
X key
(0x59)
Y key
(0x5A)
Z key
VK_LWIN (0x5B)
Left Windows key (Microsoft Natural keyboard)
VK_RWIN (0x5C)
Right Windows key (Natural keyboard)
VK_APPS (0x5D)
Applications key (Natural keyboard)
- (0x5E)
Reserved
VK_SLEEP (0x5F)
Computer Sleep key
VK_NUMPAD0 (0x60)
Numeric keypad 0 key
VK_NUMPAD1 (0x61)
Numeric keypad 1 key
VK_NUMPAD2 (0x62)
Numeric keypad 2 key
VK_NUMPAD3 (0x63)
Numeric keypad 3 key
VK_NUMPAD4 (0x64)
Numeric keypad 4 key
VK_NUMPAD5 (0x65)
Numeric keypad 5 key
VK_NUMPAD6 (0x66)
Numeric keypad 6 key
VK_NUMPAD7 (0x67)
Numeric keypad 7 key
VK_NUMPAD8 (0x68)
Numeric keypad 8 key
VK_NUMPAD9 (0x69)
Numeric keypad 9 key
VK_MULTIPLY (0x6A)
Multiply key
VK_ADD (0x6B)
Add key
VK_SEPARATOR (0x6C)
Separator key
VK_SUBTRACT (0x6D)
Subtract key
VK_DECIMAL (0x6E)
Decimal key
VK_DIVIDE (0x6F)
Divide key
VK_F1 (0x70)
F1 key
VK_F2 (0x71)
F2 key
VK_F3 (0x72)
F3 key
VK_F4 (0x73)
F4 key
VK_F5 (0x74)
F5 key
VK_F6 (0x75)
F6 key
VK_F7 (0x76)
F7 key
VK_F8 (0x77)
F8 key
VK_F9 (0x78)
F9 key
VK_F10 (0x79)
F10 key
VK_F11 (0x7A)
F11 key
VK_F12 (0x7B)
F12 key
VK_F13 (0x7C)
F13 key
VK_F14 (0x7D)
F14 key
VK_F15 (0x7E)
F15 key
VK_F16 (0x7F)
F16 key
VK_F17 (0x80H)
F17 key
VK_F18 (0x81H)
F18 key
VK_F19 (0x82H)
F19 key
VK_F20 (0x83H)
F20 key
VK_F21 (0x84H)
F21 key
VK_F22 (0x85H)
F22 key
VK_F23 (0x86H)
F23 key
VK_F24 (0x87H)
F24 key
- (0x88-8F)
Unassigned
VK_NUMLOCK (0x90)
NUM LOCK key
VK_SCROLL (0x91)
SCROLL LOCK key
(0x92-96)
OEM specific
- (0x97-9F)
Unassigned
VK_LSHIFT (0xA0)
Left SHIFT key
VK_RSHIFT (0xA1)
Right SHIFT key
VK_LCONTROL (0xA2)
Left CONTROL key
VK_RCONTROL (0xA3)
Right CONTROL key
VK_LMENU (0xA4)
Left MENU key
VK_RMENU (0xA5)
Right MENU key
VK_BROWSER_BACK (0xA6)
Windows 2000/XP: Browser Back key
VK_BROWSER_FORWARD (0xA7)
Windows 2000/XP: Browser Forward key
VK_BROWSER_REFRESH (0xA8)
Windows 2000/XP: Browser Refresh key
VK_BROWSER_STOP (0xA9)
Windows 2000/XP: Browser Stop key
VK_BROWSER_SEARCH (0xAA)
Windows 2000/XP: Browser Search key
VK_BROWSER_FAVORITES (0xAB)
Windows 2000/XP: Browser Favorites key
VK_BROWSER_HOME (0xAC)
Windows 2000/XP: Browser Start and Home key
VK_VOLUME_MUTE (0xAD)
Windows 2000/XP: Volume Mute key
VK_VOLUME_DOWN (0xAE)
Windows 2000/XP: Volume Down key
VK_VOLUME_UP (0xAF)
Windows 2000/XP: Volume Up key
VK_MEDIA_NEXT_TRACK (0xB0)
Windows 2000/XP: Next Track key
VK_MEDIA_PREV_TRACK (0xB1)
Windows 2000/XP: Previous Track key
VK_MEDIA_STOP (0xB2)
Windows 2000/XP: Stop Media key
VK_MEDIA_PLAY_PAUSE (0xB3)
Windows 2000/XP: Play/Pause Media key
VK_LAUNCH_MAIL (0xB4)
Windows 2000/XP: Start Mail key
VK_LAUNCH_MEDIA_SELECT (0xB5)
Windows 2000/XP: Select Media key
VK_LAUNCH_APP1 (0xB6)
Windows 2000/XP: Start Application 1 key
VK_LAUNCH_APP2 (0xB7)
Windows 2000/XP: Start Application 2 key
- (0xB8-B9)
Reserved
VK_OEM_1 (0xBA)
Used for miscellaneous characters; it can vary by keyboard.

Windows 2000/XP: For the US standard keyboard, the ';:' key
VK_OEM_PLUS (0xBB)
Windows 2000/XP: For any country/region, the '+' key
VK_OEM_COMMA (0xBC)
Windows 2000/XP: For any country/region, the ',' key
VK_OEM_MINUS (0xBD)
Windows 2000/XP: For any country/region, the '-' key
VK_OEM_PERIOD (0xBE)
Windows 2000/XP: For any country/region, the '.' key
VK_OEM_2 (0xBF)
Used for miscellaneous characters; it can vary by keyboard.

Windows 2000/XP: For the US standard keyboard, the '/?' key
VK_OEM_3 (0xC0)
Used for miscellaneous characters; it can vary by keyboard.

Windows 2000/XP: For the US standard keyboard, the '`~' key
- (0xC1-D7)
Reserved
- (0xD8-DA)
Unassigned
VK_OEM_4 (0xDB)
Used for miscellaneous characters; it can vary by keyboard.

Windows 2000/XP: For the US standard keyboard, the '[{' key
VK_OEM_5 (0xDC)
Used for miscellaneous characters; it can vary by keyboard.

Windows 2000/XP: For the US standard keyboard, the '\|' key
VK_OEM_6 (0xDD)
Used for miscellaneous characters; it can vary by keyboard.

Windows 2000/XP: For the US standard keyboard, the ']}' key
VK_OEM_7 (0xDE)
Used for miscellaneous characters; it can vary by keyboard.

Windows 2000/XP: For the US standard keyboard, the 'single-quote/double-quote' key
VK_OEM_8 (0xDF)
Used for miscellaneous characters; it can vary by keyboard.
- (0xE0)
Reserved
(0xE1)
OEM specific
VK_OEM_102 (0xE2)
Windows 2000/XP: Either the angle bracket key or the backslash key on the RT 102-key keyboard
(0xE3-E4)
OEM specific
VK_PROCESSKEY (0xE5)
Windows 95/98/Me, Windows NT 4.0, Windows 2000/XP: IME PROCESS key
(0xE6)
OEM specific
VK_PACKET (0xE7)
Windows 2000/XP: Used to pass Unicode characters as if they were keystrokes. The VK_PACKET key is the low word of a 32-bit Virtual Key value used for non-keyboard input methods. For more information, see Remark in KEYBDINPUT, SendInput, WM_KEYDOWN, and WM_KEYUP
- (0xE8)
Unassigned
(0xE9-F5)
OEM specific
VK_ATTN (0xF6)
Attn key
VK_CRSEL (0xF7)
CrSel key
VK_EXSEL (0xF8)
ExSel key
VK_EREOF (0xF9)
Erase EOF key
VK_PLAY (0xFA)
Play key
VK_ZOOM (0xFB)
Zoom key
VK_NONAME (0xFC)
Reserved
VK_PA1 (0xFD)
PA1 key
VK_OEM_CLEAR (0xFE)
Clear key

Monday, October 05, 2009

Applications for the iPhone made using Adobe Software

Annonced today at MAX. Flash Professional CS5 will enable you to build applications for iPhone and iPod touch using ActionScript 3. These applications can be delivered to iPhone and iPod touch users through the Apple App Store.

http://labs.adobe.com/technologies/flashcs5/appsfor_iphone/

Tuesday, September 29, 2009

Flash and Video Games PS3 and XNA ???

Civilisation, Mass Effect and Crysis used Scaleform GFx for their Flash graphics.

https://www.scaleform.com/products_gfx.php
https://www.scaleform.com/products/clik

Scaleform® GFx™ 3.0 introduces the Common Lightweight Interface Kit (CLIK™) to help accelerate the design and development of user interfaces on multiple platforms including PCs, Consoles, and Mobiles. The CLIK component architecture and workflow enhancement tools enable users to rapidly create user interfaces from prototype to final design.

Adobe Flash contains a variety of premade and preconfigured interface components to enable easy interface creation. The Scaleform CLIK components are similar to the components found in Flash, but have been custom-designed specifically for creating games using Scaleform GFx 3.0.

Monday, September 28, 2009

Watch Flash Web Site on your HDTV with your PS3

The beautiful part of the PS3 is that the new browser in the PS3 has Flash Player 9 installed. What’s even more beautiful is that it is at least version 9.0.115 because all of my tutorials can be watched from the comfort of your couch. Connecting the PS3 with an HDMI cable makes the tutorials look amazing.

I also recommend the Logitech PS3 keyboard which makes cruising the web a joy.

Thursday, September 24, 2009

Window subclassing is tricky




Window subclassing is tricky, and as a general rule one should not attempt to dynamically sub-class and unsubclass an HWDN multiple times
during its lifetime. Instead subclass once at the HWND creation time, and then un-subclass at the HWND destruction time.
ONLY un-subclass if the value of GWLP_WNDPROC matches your window proc.
In general, you do not know if other subclasses will unsubclass at WM_DESTROY or WM_NCDESTROY time, so it is safest if it attempt to unsubclass
rst in WM_DESTROY time, and then (if that does not succeed) at WM_NCDESTROY time. You willnot get a WM_NCDESTROY
message if you were able to unsubclass in response to the WM_DESTROY message.

Tuesday, September 15, 2009

Tealium Web analytics Blog

With the recent news on Yahoo Finance regarding Omniture-Adobe acquisition, I was curious to know a bit more about Web Analytics and provide pointers to anyone reading my blog. I posted an article some time ago on how to add Google Web Analytics to a SWF. Anyhow, here is a very great blog that I found at Tealium.com for those interested in Web Analytics. The blog is really well written by web Analytics Experts. Former Web Side Story, Visual Science and Omniture folks...


http://www.tealium.com/blog/

Wednesday, September 09, 2009

Papervision3D Essentials Book

Papervision3D Essentials (Paperback)
by Jeff Winder (Author), Paul Tondeur (Author)


http://www.amazon.com/Papervision3D-Essentials-Paul-Tondeur/dp/1847195725/ref=sr_1_12?ie=UTF8&s=books&qid=1248878573&sr=8-1
2

Quoting Paul Tondeur :

Both web pages provide information about the content and the level of the book.
Chapter 8 is available online as a free sample, and covers working with models and animated models that have been created in external programs. Among other things, the chapter discusses how to export models from Autodesk 3ds Max, SketchUp and Blender.
http://www.packtpub.com/files/5722-papervision-3d-sample-chapter-8-external-models.pdf

Those who are interested can also find some more information in our blog posts:
http://www.paultondeur.com/2009/09/03/papervision3d-essentials-out-now/
http://jeffwinder.blogspot.com/2009/09/papervision3d-essentials-book-out-now.html

Monday, August 17, 2009

Useful WM_Messages Define WIN32 Platform

using System;
///
/// Summary description for WM_Messages.
///

public enum WM_Messages
{
WM_NULL = 0x0000, //0
WM_CREATE = 0x0001, //1
WM_DESTROY = 0x0002, //2
WM_MOVE = 0x0003, //3
WM_SIZE = 0x0005, //5
WM_ACTIVATE = 0x0006, //6
WM_SETFOCUS = 0x0007, //7
WM_KILLFOCUS = 0x0008, //8
WM_ENABLE = 0x000A, //10
WM_SETREDRAW = 0x000B, //11
WM_SETTEXT = 0x000C, //12
WM_GETTEXT = 0x000D, //13
WM_GETTEXTLENGTH = 0x000E, //14
WM_PAINT = 0x000F, //15
WM_CLOSE = 0x0010, //16
WM_QUERYENDSESSION = 0x0011, //17
WM_QUERYOPEN = 0x0013, //19
WM_ENDSESSION = 0x0016, //22
WM_QUIT = 0x0012, //18
WM_ERASEBKGND = 0x0014, //20
WM_SYSCOLORCHANGE = 0x0015, //21
WM_SHOWWINDOW = 0x0018, //24
WM_WININICHANGE = 0x001A, //26
WM_DEVMODECHANGE = 0x001B, //27
WM_ACTIVATEAPP = 0x001C, //28
WM_FONTCHANGE = 0x001D, //29
WM_TIMECHANGE = 0x001E, //30
WM_CANCELMODE = 0x001F, //31
WM_SETCURSOR = 0x0020, //32
WM_MOUSEACTIVATE = 0x0021, //33
WM_CHILDACTIVATE = 0x0022, //34
WM_QUEUESYNC = 0x0023, //35
WM_GETMINMAXINFO = 0x0024, //36
WM_PAINTICON = 0x0026, //38
WM_ICONERASEBKGND = 0x0027, //39
WM_NEXTDLGCTL = 0x0028, //40
WM_SPOOLERSTATUS = 0x002A, //42
WM_DRAWITEM = 0x002B, //43
WM_MEASUREITEM = 0x002C, //44
WM_DELETEITEM = 0x002D, //45
WM_VKEYTOITEM = 0x002E, //46
WM_CHARTOITEM = 0x002F, //47
WM_SETFONT = 0x0030, //48
WM_GETFONT = 0x0031, //49
WM_SETHOTKEY = 0x0032, //50
WM_GETHOTKEY = 0x0033, //51
WM_QUERYDRAGICON = 0x0037, //55
WM_COMPAREITEM = 0x0039, //57
WM_GETOBJECT = 0x003D, //61
WM_COMPACTING = 0x0041, //65
WM_COMMNOTIFY = 0x0044, //68 /* no longer suported */
WM_WINDOWPOSCHANGING = 0x0046, //70
WM_WINDOWPOSCHANGED = 0x0047, //71
WM_POWER = 0x0048, //72
WM_COPYDATA = 0x004A, //74
WM_CANCELJOURNAL = 0x004B, //75
WM_NOTIFY = 0x004E, //78
WM_INPUTLANGCHANGEREQUEST = 0x0050, //80
WM_INPUTLANGCHANGE = 0x0051, //81
WM_TCARD = 0x0052, //82
WM_HELP = 0x0053, //83
WM_USERCHANGED = 0x0054, //84
WM_NOTIFYFORMAT = 0x0055, //85
WM_CONTEXTMENU = 0x007B, //123
WM_STYLECHANGING = 0x007C, //124
WM_STYLECHANGED = 0x007D, //125
WM_DISPLAYCHANGE = 0x007E, //126
WM_GETICON = 0x007F, //127
WM_SETICON = 0x0080, //128
WM_NCCREATE = 0x0081, //129
WM_NCDESTROY = 0x0082, //130
WM_NCCALCSIZE = 0x0083, //131
WM_NCHITTEST = 0x0084, //132
WM_NCPAINT = 0x0085, //133
WM_NCACTIVATE = 0x0086, //134
WM_GETDLGCODE = 0x0087, //135
WM_SYNCPAINT = 0x0088, //136
WM_NCMOUSEMOVE = 0x00A0, //160
WM_NCLBUTTONDOWN = 0x00A1, //161
WM_NCLBUTTONUP = 0x00A2, //162
WM_NCLBUTTONDBLCLK = 0x00A3, //163
WM_NCRBUTTONDOWN = 0x00A4, //164
WM_NCRBUTTONUP = 0x00A5, //165
WM_NCRBUTTONDBLCLK = 0x00A6, //166
WM_NCMBUTTONDOWN = 0x00A7, //167
WM_NCMBUTTONUP = 0x00A8, //168
WM_NCMBUTTONDBLCLK = 0x00A9, //169
WM_NCXBUTTONDOWN = 0x00AB, //171
WM_NCXBUTTONUP = 0x00AC, //172
WM_NCXBUTTONDBLCLK = 0x00AD, //173
WM_INPUT = 0x00FF, //255
WM_KEYFIRST = 0x0100, //256
WM_KEYDOWN = 0x0100, //256
WM_KEYUP = 0x0101, //257
WM_CHAR = 0x0102, //258
WM_DEADCHAR = 0x0103, //259
WM_SYSKEYDOWN = 0x0104, //260
WM_SYSKEYUP = 0x0105, //261
WM_SYSCHAR = 0x0106, //262
WM_SYSDEADCHAR = 0x0107, //263
WM_UNICHAR = 0x0109, //265
WM_KEYLAST = 0x0109, //265
WM_KEYLASTBefore0x0501 = 0x0108, //264
WM_IME_STARTCOMPOSITION = 0x010D, //269
WM_IME_ENDCOMPOSITION = 0x010E, //270
WM_IME_COMPOSITION = 0x010F, //271
WM_IME_KEYLAST = 0x010F, //271
WM_INITDIALOG = 0x0110, //272
WM_COMMAND = 0x0111, //273
WM_SYSCOMMAND = 0x0112, //274
WM_TIMER = 0x0113, //275
WM_HSCROLL = 0x0114, //276
WM_VSCROLL = 0x0115, //277
WM_INITMENU = 0x0116, //278
WM_INITMENUPOPUP = 0x0117, //279
WM_MENUSELECT = 0x011F, //287
WM_MENUCHAR = 0x0120, //288
WM_ENTERIDLE = 0x0121, //289
WM_MENURBUTTONUP = 0x0122, //290
WM_MENUDRAG = 0x0123, //291
WM_MENUGETOBJECT = 0x0124, //292
WM_UNINITMENUPOPUP = 0x0125, //293
WM_MENUCOMMAND = 0x0126, //294
WM_CHANGEUISTATE = 0x0127, //295
WM_UPDATEUISTATE = 0x0128, //296
WM_QUERYUISTATE = 0x0129, //297
WM_CTLCOLORMSGBOX = 0x0132, //306
WM_CTLCOLOREDIT = 0x0133, //307
WM_CTLCOLORLISTBOX = 0x0134, //308
WM_CTLCOLORBTN = 0x0135, //309
WM_CTLCOLORDLG = 0x0136, //310
WM_CTLCOLORSCROLLBAR = 0x0137, //311
WM_CTLCOLORSTATIC = 0x0138, //312
WM_MOUSEFIRST = 0x0200, //512
WM_MOUSEMOVE = 0x0200, //512
WM_LBUTTONDOWN = 0x0201, //513
WM_LBUTTONUP = 0x0202, //514
WM_LBUTTONDBLCLK = 0x0203, //515
WM_RBUTTONDOWN = 0x0204, //516
WM_RBUTTONUP = 0x0205, //517
WM_RBUTTONDBLCLK = 0x0206, //518
WM_MBUTTONDOWN = 0x0207, //519
WM_MBUTTONUP = 0x0208, //520
WM_MBUTTONDBLCLK = 0x0209, //521
WM_MOUSEWHEEL = 0x020A, //522
WM_XBUTTONDOWN = 0x020B, //523
WM_XBUTTONUP = 0x020C, //524
WM_XBUTTONDBLCLK = 0x020D, //525
WM_MOUSELAST = 0x020D, //525
WM_MOUSELASTBefore0x0500 = 0x020A, //522
WM_MOUSELASTBefore0x0400 = 0x0209, //521
WM_PARENTNOTIFY = 0x0210, //528
WM_ENTERMENULOOP = 0x0211, //529
WM_EXITMENULOOP = 0x0212, //530
WM_NEXTMENU = 0x0213, //531
WM_SIZING = 0x0214, //532
WM_CAPTURECHANGED = 0x0215, //533
WM_MOVING = 0x0216, //534
WM_POWERBROADCAST = 0x0218, //536
WM_DEVICECHANGE = 0x0219, //537
WM_MDICREATE = 0x0220, //544
WM_MDIDESTROY = 0x0221, //545
WM_MDIACTIVATE = 0x0222, //546
WM_MDIRESTORE = 0x0223, //547
WM_MDINEXT = 0x0224, //548
WM_MDIMAXIMIZE = 0x0225, //549
WM_MDITILE = 0x0226, //550
WM_MDICASCADE = 0x0227, //551
WM_MDIICONARRANGE = 0x0228, //552
WM_MDIGETACTIVE = 0x0229, //553
WM_MDISETMENU = 0x0230, //560
WM_ENTERSIZEMOVE = 0x0231, //561
WM_EXITSIZEMOVE = 0x0232, //562
WM_DROPFILES = 0x0233, //563
WM_MDIREFRESHMENU = 0x0234, //564
WM_IME_SETCONTEXT = 0x0281, //641
WM_IME_NOTIFY = 0x0282, //642
WM_IME_CONTROL = 0x0283, //643
WM_IME_COMPOSITIONFULL = 0x0284, //644
WM_IME_SELECT = 0x0285, //645
WM_IME_CHAR = 0x0286, //646
WM_IME_REQUEST = 0x0288, //648
WM_IME_KEYDOWN = 0x0290, //656
WM_IME_KEYUP = 0x0291, //657
WM_MOUSEHOVER = 0x02A1, //673
WM_MOUSELEAVE = 0x02A3, //675
WM_NCMOUSEHOVER = 0x02A0, //672
WM_NCMOUSELEAVE = 0x02A2, //674
WM_WTSSESSION_CHANGE = 0x02B1, //689
WM_TABLET_FIRST = 0x02c0, //704
WM_TABLET_LAST = 0x02df, //735
WM_CUT = 0x0300, //768
WM_COPY = 0x0301, //769
WM_PASTE = 0x0302, //770
WM_CLEAR = 0x0303, //771
WM_UNDO = 0x0304, //772
WM_RENDERFORMAT = 0x0305, //773
WM_RENDERALLFORMATS = 0x0306, //774
WM_DESTROYCLIPBOARD = 0x0307, //775
WM_DRAWCLIPBOARD = 0x0308, //776
WM_PAINTCLIPBOARD = 0x0309, //777
WM_VSCROLLCLIPBOARD = 0x030A, //778
WM_SIZECLIPBOARD = 0x030B, //779
WM_ASKCBFORMATNAME = 0x030C, //780
WM_CHANGECBCHAIN = 0x030D, //781
WM_HSCROLLCLIPBOARD = 0x030E, //782
WM_QUERYNEWPALETTE = 0x030F, //783
WM_PALETTEISCHANGING = 0x0310, //784
WM_PALETTECHANGED = 0x0311, //785
WM_HOTKEY = 0x0312, //786
WM_PRINT = 0x0317, //791
WM_PRINTCLIENT = 0x0318, //792
WM_APPCOMMAND = 0x0319, //793
WM_THEMECHANGED = 0x031A, //794
WM_HANDHELDFIRST = 0x0358, //856
WM_HANDHELDLAST = 0x035F, //863
WM_AFXFIRST = 0x0360, //864
WM_AFXLAST = 0x037F, //895
WM_PENWINFIRST = 0x0380, //896
WM_PENWINLAST = 0x038F, //911
WM_APP = 0x8000, //32768
WM_USER = 0x0400, //1024
WM_HELP_Before0x0400 = 0x000c, //12
}

1. // ShowMSG.cpp : Defines the entry point for the application.
2. //
3.
4. #include "stdafx.h"
5. #include "ShowMSG.h"
6. #define MAX_LOADSTRING 100
7.
8. // Global Variables:
9. HINSTANCE hInst; // current instance
10. TCHAR szTitle[MAX_LOADSTRING]; // The title bar text
11. TCHAR szWindowClass[MAX_LOADSTRING]; // the main window class name
12.
13. // Forward declarations of functions included in this code module:
14. ATOM MyRegisterClass(HINSTANCE hInstance);
15. BOOL InitInstance(HINSTANCE, int);
16. LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
17. LRESULT CALLBACK About(HWND, UINT, WPARAM, LPARAM);
18.
19. //define Windows all message struct
20. typedef struct _MSGList
21. {
22. UINT MSGNum;
23. char MSG[50];
24. }MSGList,*PMSGList;
25.
26. HWND hSubOfNOTEPADWND = NULL;
27.
28. //Windows message List
29.
30. MSGList msglist[] = {
31. {0x0000, "WM_NULL"},
32. {0x0001, "WM_CREATE"},
33. {0x0002, "WM_DESTROY"},
34. {0x0003, "WM_MOVE"},
35. {0x0004, "WM_SIZEWAIT"},
36. {0x0005, "WM_SIZE"},
37. {0x0006, "WM_ACTIVATE"},
38. {0x0007, "WM_SETFOCUS"},
39. {0x0008, "WM_KILLFOCUS"},
40. {0x0009, "WM_SETVISIBLE"},
41. {0x000A, "WM_ENABLE"},
42. {0x000B, "WM_SETREDRAW"},
43. {0x000C, "WM_SETTEXT"},
44. {0x000D, "WM_GETTEXT"},
45. {0x000E, "WM_GETTEXTLENGTH"},
46. {0x000F, "WM_PAINT"},
47. {0x0010, "WM_CLOSE"},
48. {0x0011, "WM_QUERYENDSESSION"},
49. {0x0012, "WM_QUIT"},
50. {0x0013, "WM_QUERYOPEN"},
51. {0x0014, "WM_ERASEBKGND"},
52. {0x0015, "WM_SYSCOLORCHANGE"},
53. {0x0016, "WM_ENDSESSION"},
54. {0x0017, "WM_SYSTEMERROR"},
55. {0x0018, "WM_SHOWWINDOW"},
56. {0x0019, "WM_CTLCOLOR"},
57. {0x001A, "WM_WININICHANGE"},
58. {0x001B, "WM_DEVMODECHANGE"},
59. {0x001C, "WM_ACTIVATEAPP"},
60. {0x001D, "WM_FONTCHANGE"},
61. {0x001E, "WM_TIMECHANGE"},
62. {0x001F, "WM_CANCELMODE"},
63. {0x0020, "WM_SETCURSOR"},
64. {0x0021, "WM_MOUSEACTIVATE"},
65. {0x0022, "WM_CHILDACTIVATE"},
66. {0x0023, "WM_QUEUESYNC"},
67. {0x0024, "WM_GETMINMAXINFO"},
68. {0x0026, "WM_PAINTICON"},
69. {0x0027, "WM_ICONERASEBKGND"},
70. {0x0028, "WM_NEXTDLGCTL"},
71. {0x0029, "WM_ALTTABACTIVE"},
72. {0x002A, "WM_SPOOLERSTATUS"},
73. {0x002B, "WM_DRAWITEM"},
74. {0x002C, "WM_MEASUREITEM"},
75. {0x002D, "WM_DELETEITEM"},
76. {0x002E, "WM_VKEYTOITEM"},
77. {0x002F, "WM_CHARTOITEM"},
78. {0x0030, "WM_SETFONT"},
79. {0x0031, "WM_GETFONT"},
80. {0x0032, "WM_SETHOTKEY"},
81. {0x0033, "WM_GETHOTKEY"},
82. {0x0034, "WM_FILESYSCHANGE"},
83. {0x0035, "WM_ISACTIVEICON"},
84. {0x0036, "WM_QUERYPARKICON"},
85. {0x0037, "WM_QUERYDRAGICON"},
86. {0x0038, "WM_QUERYSAVESTATE"},
87. {0x0039, "WM_COMPAREITEM"},
88. {0x0040, "WM_TESTING"},
89. {0x0041, "WM_COMPACTING"},
90. {0x0044, "WM_COMMNOTIFY"},
91. {0x0046, "WM_WINDOWPOSCHANGING"},
92. {0x0047, "WM_WINDOWPOSCHANGED"},
93. {0x0048, "WM_POWER"},
94. {0x004A, "WM_COPYDATA"},
95. {0x004B, "WM_CANCELJOURNAL"},
96. {0x004E, "WM_NOTIFY"},
97. {0x0050, "WM_KBDCHANGEREQUEST"},
98. {0x0051, "WM_KBDLAYOUTCHANGE"},
99. {0x0052, "WM_TCARD"},
100. {0x0053, "WM_HELP"},
101. {0x0054, "WM_USERCHANGED"},
102. {0x0055, "WM_NOTIFYFORMAT"},
103. {0x007B, "WM_CONTEXTMENU"},
104. {0x007C, "WM_STYLECHANGING"},
105. {0x007D, "WM_STYLECHANGED"},
106. {0x007E, "WM_DISPLAYCHANGE"},
107. {0x007F, "WM_GETICON"},
108. {0x0080, "WM_SETICON"},
109. {0x0081, "WM_NCCREATE"},
110. {0x0082, "WM_NCDESTROY"},
111. {0x0083, "WM_NCCALCSIZE"},
112. {0x0084, "WM_NCHITTEST"},
113. {0x0085, "WM_NCPAINT"},
114. {0x0086, "WM_NCACTIVATE"},
115. {0x0087, "WM_GETDLGCODE"},
116. {0x0088, "WM_SYNCPAINT"},
117. {0x0089, "WM_SYNCTASK"},
118. {0x00A0, "WM_NCMOUSEMOVE"},
119. {0x00A1, "WM_NCLBUTTONDOWN"},
120. {0x00A2, "WM_NCLBUTTONUP"},
121. {0x00A3, "WM_NCLBUTTONDBLCLK"},
122. {0x00A4, "WM_NCRBUTTONDOWN"},
123. {0x00A5, "WM_NCRBUTTONUP"},
124. {0x00A6, "WM_NCRBUTTONDBLCLK"},
125. {0x00A7, "WM_NCMBUTTONDOWN"},
126. {0x00A8, "WM_NCMBUTTONUP"},
127. {0x00A9, "WM_NCMBUTTONDBLCLK"},
128. {0x00B0, "EM_GETSEL"},
129. {0x00B1, "EM_SETSEL"},
130. {0x00B2, "EM_GETRECT"},
131. {0x00B3, "EM_SETRECT"},
132. {0x00B4, "EM_SETRECTNP"},
133. {0x00B5, "EM_SCROLL"},
134. {0x00B6, "EM_LINESCROLL"},
135. {0x00B7, "EM_SCROLLCARET"},
136. {0x00B8, "EM_GETMODIFY"},
137. {0x00B9, "EM_SETMODIFY"},
138. {0x00BA, "EM_GETLINECOUNT"},
139. {0x00BB, "EM_LINEINDEX"},
140. {0x00BC, "EM_SETHANDLE"},
141. {0x00BD, "EM_GETHANDLE"},
142. {0x00BE, "EM_GETTHUMB"},
143. {0x00C1, "EM_LINELENGTH"},
144. {0x00C2, "EM_REPLACESEL"},
145. {0x00C4, "EM_GETLINE"},
146. {0x00C5, "EM_LIMITTEXT"},
147. {0x00C6, "EM_CANUNDO"},
148. {0x00C7, "EM_UNDO"},
149. {0x00C8, "EM_FMTLINES"},
150. {0x00C9, "EM_LINEFROMCHAR"},
151. {0x00CB, "EM_SETTABSTOPS"},
152. {0x00CC, "EM_SETPASSWORDCHAR"},
153. {0x00CD, "EM_EMPTYUNDOBUFFER"},
154. {0x00CE, "EM_GETFIRSTVISIBLELINE"},
155. {0x00CF, "EM_SETREADONLY"},
156. {0x00D0, "EM_SETWORDBREAKPROC"},
157. {0x00D1, "EM_GETWORDBREAKPROC"},
158. {0x00D2, "EM_GETPASSWORDCHAR"},
159. {0x00D3, "EM_SETMARGINS"},
160. {0x00D4, "EM_GETMARGINS"},
161. {0x00D5, "EM_GETLIMITTEXT"},
162. {0x00D6, "EM_POSFROMCHAR"},
163. {0x00D7, "EM_CHARFROMPOS"},
164. {0x00E0, "SBM_SETPOS"},
165. {0x00E1, "SBM_GETPOS"},
166. {0x00E2, "SBM_SETRANGE"},
167. {0x00E3, "SBM_GETRANGE"},
168. {0x00E4, "SBM_ENABLE_ARROWS"},
169. {0x00E6, "SBM_SETRANGEREDRAW"},
170. {0x00E9, "SBM_SETSCROLLINFO"},
171. {0x00EA, "SBM_GETSCROLLINFO"},
172. {0x0100, "WM_KEYFIRST"},
173. {0x0100, "WM_KEYDOWN"},
174. {0x0101, "WM_KEYUP"},
175. {0x0102, "WM_CHAR"},
176. {0x0103, "WM_DEADCHAR"},
177. {0x0104, "WM_SYSKEYDOWN"},
178. {0x0105, "WM_SYSKEYUP"},
179. {0x0106, "WM_SYSCHAR"},
180. {0x0107, "WM_SYSDEADCHAR"},
181. {0x0108, "WM_KEYLAST"},
182. {0x010A, "WM_CONVERTREQUEST"},
183. {0x010B, "WM_CONVERTRESULT"},
184. {0x010C, "WM_INTERIM"},
185. {0x0110, "WM_INITDIALOG"},
186. {0x0111, "WM_COMMAND"},
187. {0x0112, "WM_SYSCOMMAND"},
188. {0x0113, "WM_TIMER"},
189. {0x0114, "WM_HSCROLL"},
190. {0x0115, "WM_VSCROLL"},
191. {0x0116, "WM_INITMENU"},
192. {0x0117, "WM_INITMENUPOPUP"},
193. {0x0118, "WM_SYSTIMER"},
194. {0x011F, "WM_MENUSELECT"},
195. {0x0120, "WM_MENUCHAR"},
196. {0x0121, "WM_ENTERIDLE"},
197. {0x0131, "WM_LBTRACKPOINT"},
198. {0x0132, "WM_CTLCOLORMSGBOX"},
199. {0x0133, "WM_CTLCOLOREDIT"},
200. {0x0134, "WM_CTLCOLORLISTBOX"},
201. {0x0135, "WM_CTLCOLORBTN"},
202. {0x0136, "WM_CTLCOLORDLG"},
203. {0x0137, "WM_CTLCOLORSCROLLBAR"},
204. {0x0138, "WM_CTLCOLORSTATIC"},
205. {0x0140, "CB_GETEDITSEL"},
206. {0x0141, "CB_LIMITTEXT"},
207. {0x0142, "CB_SETEDITSEL"},
208. {0x0143, "CB_ADDSTRING"},
209. {0x0144, "CB_DELETESTRING"},
210. {0x0145, "CB_DIR"},
211. {0x0146, "CB_GETCOUNT"},
212. {0x0147, "CB_GETCURSEL"},
213. {0x0148, "CB_GETLBTEXT"},
214. {0x0149, "CB_GETLBTEXTLEN"},
215. {0x014A, "CB_INSERTSTRING"},
216. {0x014B, "CB_RESETCONTENT"},
217. {0x014C, "CB_FINDSTRING"},
218. {0x014D, "CB_SELECTSTRING"},
219. {0x014E, "CB_SETCURSEL"},
220. {0x014F, "CB_SHOWDROPDOWN"},
221. {0x0150, "CB_GETITEMDATA"},
222. {0x0151, "CB_SETITEMDATA"},
223. {0x0152, "CB_GETDROPPEDCONTROLRECT"},
224. {0x0153, "CB_SETITEMHEIGHT"},
225. {0x0154, "CB_GETITEMHEIGHT"},
226. {0x0155, "CB_SETEXTENDEDUI"},
227. {0x0156, "CB_GETEXTENDEDUI"},
228. {0x0157, "CB_GETDROPPEDSTATE"},
229. {0x0158, "CB_FINDSTRINGEXACT"},
230. {0x0159, "CB_SETLOCALE"},
231. {0x015A, "CB_GETLOCALE"},
232. {0x015B, "CB_GETTOPINDEX"},
233. {0x015C, "CB_SETTOPINDEX"},
234. {0x015D, "CB_GETHORIZONTALEXTENT"},
235. {0x015E, "CB_SETHORIZONTALEXTENT"},
236. {0x015F, "CB_GETDROPPEDWIDTH"},
237. {0x0160, "CB_SETDROPPEDWIDTH"},
238. {0x0161, "CB_INITSTORAGE"},
239. {0x0170, "STM_SETICON"},
240. {0x0171, "STM_GETICON"},
241. {0x0172, "STM_SETIMAGE"},
242. {0x0173, "STM_GETIMAGE"},
243. {0x0180, "LB_ADDSTRING"},
244. {0x0181, "LB_INSERTSTRING"},
245. {0x0182, "LB_DELETESTRING"},
246. {0x0183, "LB_SELITEMRANGEEX"},
247. {0x0184, "LB_RESETCONTENT"},
248. {0x0185, "LB_SETSEL"},
249. {0x0186, "LB_SETCURSEL"},
250. {0x0187, "LB_GETSEL"},
251. {0x0188, "LB_GETCURSEL"},
252. {0x0189, "LB_GETTEXT"},
253. {0x018A, "LB_GETTEXTLEN"},
254. {0x018B, "LB_GETCOUNT"},
255. {0x018C, "LB_SELECTSTRING"},
256. {0x018D, "LB_DIR"},
257. {0x018E, "LB_GETTOPINDEX"},
258. {0x018F, "LB_FINDSTRING"},
259. {0x0190, "LB_GETSELCOUNT"},
260. {0x0191, "LB_GETSELITEMS"},
261. {0x0192, "LB_SETTABSTOPS"},
262. {0x0193, "LB_GETHORIZONTALEXTENT"},
263. {0x0194, "LB_SETHORIZONTALEXTENT"},
264. {0x0195, "LB_SETCOLUMNWIDTH"},
265. {0x0196, "LB_ADDFILE"},
266. {0x0197, "LB_SETTOPINDEX"},
267. {0x0198, "LB_GETITEMRECT"},
268. {0x0199, "LB_GETITEMDATA"},
269. {0x019A, "LB_SETITEMDATA"},
270. {0x019B, "LB_SELITEMRANGE"},
271. {0x019C, "LB_SETANCHORINDEX"},
272. {0x019D, "LB_GETANCHORINDEX"},
273. {0x019E, "LB_SETCARETINDEX"},
274. {0x019F, "LB_GETCARETINDEX"},
275. {0x01A0, "LB_SETITEMHEIGHT"},
276. {0x01A1, "LB_GETITEMHEIGHT"},
277. {0x01A2, "LB_FINDSTRINGEXACT"},
278. {0x01A5, "LB_SETLOCALE"},
279. {0x01A6, "LB_GETLOCALE"},
280. {0x01A7, "LB_SETCOUNT"},
281. {0x01A8, "LB_INITSTORAGE"},
282. {0x01A9, "LB_ITEMFROMPOINT"},
283. {0x01E0, "MN_SETHMENU"},
284. {0x01E1, "MN_GETHMENU"},
285. {0x01E2, "MN_SIZEWINDOW"},
286. {0x01E3, "MN_OPENHIERARCHY"},
287. {0x01E4, "MN_CLOSEHIERARCHY"},
288. {0x01E5, "MN_SELECTITEM"},
289. {0x01E6, "MN_CANCELMENUS"},
290. {0x01E7, "MN_SELECTFIRSTVALIDITEM"},
291. {0x0200, "WM_MOUSEFIRST"},
292. {0x0200, "WM_MOUSEMOVE"},
293. {0x0201, "WM_LBUTTONDOWN"},
294. {0x0202, "WM_LBUTTONUP"},
295. {0x0203, "WM_LBUTTONDBLCLK"},
296. {0x0204, "WM_RBUTTONDOWN"},
297. {0x0205, "WM_RBUTTONUP"},
298. {0x0206, "WM_RBUTTONDBLCLK"},
299. {0x0207, "WM_MBUTTONDOWN"},
300. {0x0208, "WM_MBUTTONUP"},
301. {0x0209, "WM_MOUSELAST"},
302. {0x0209, "WM_MBUTTONDBLCLK"},
303. {0x0210, "WM_PARENTNOTIFY"},
304. {0x0211, "WM_ENTERMENULOOP"},
305. {0x0212, "WM_EXITMENULOOP"},
306. {0x0213, "WM_NEXTMENU"},
307. {0x0214, "WM_SIZING"},
308. {0x0215, "WM_CAPTURECHANGED"},
309. {0x0216, "WM_MOVING"},
310. {0x0217, "WM_DEVICEBROADCAST"},
311. {0x0218, "WM_POWERBROADCAST"},
312. {0x0219, "WM_DEVICECHANGE"},
313. {0x0220, "WM_MDICREATE"},
314. {0x0221, "WM_MDIDESTROY"},
315. {0x0222, "WM_MDIACTIVATE"},
316. {0x0223, "WM_MDIRESTORE"},
317. {0x0224, "WM_MDINEXT"},
318. {0x0225, "WM_MDIMAXIMIZE"},
319. {0x0226, "WM_MDITILE"},
320. {0x0227, "WM_MDICASCADE"},
321. {0x0228, "WM_MDIICONARRANGE"},
322. {0x0229, "WM_MDIGETACTIVE"},
323. {0x022A, "WM_DROPOBJECT"},
324. {0x022B, "WM_QUERYDROPOBJECT"},
325. {0x022C, "WM_BEGINDRAG"},
326. {0x022D, "WM_DRAGLOOP"},
327. {0x022E, "WM_DRAGSELECT"},
328. {0x022F, "WM_DRAGMOVE"},
329. {0x0230, "WM_MDISETMENU"},
330. {0x0231, "WM_ENTERSIZEMOVE"},
331. {0x0232, "WM_EXITSIZEMOVE"},
332. {0x0233, "WM_DROPFILES"},
333. {0x0234, "WM_MDIREFRESHMENU"},
334. {0x0281, "WM_IME_SETCONTEXT"},
335. {0x0282, "WM_IME_NOTIFY"},
336. {0x0283, "WM_IME_CONTROL"},
337. {0x0284, "WM_IME_COMPOSITIONFULL"},
338. {0x0285, "WM_IME_SELECT"},
339. {0x0286, "WM_IME_CHAR"},
340. {0x0290, "WM_IME_KEYDOWN"},
341. {0x0291, "WM_IME_KEYUP"},
342. {0x0300, "WM_CUT"},
343. {0x0301, "WM_COPY"},
344. {0x0302, "WM_PASTE"},
345. {0x0303, "WM_CLEAR"},
346. {0x0304, "WM_UNDO"},
347. {0x0305, "WM_RENDERFORMAT"},
348. {0x0306, "WM_RENDERALLFORMATS"},
349. {0x0307, "WM_DESTROYCLIPBOARD"},
350. {0x0308, "WM_DRAWCLIPBOARD"},
351. {0x0309, "WM_PAINTCLIPBOARD"},
352. {0x030A, "WM_VSCROLLCLIPBOARD"},
353. {0x030B, "WM_SIZECLIPBOARD"},
354. {0x030C, "WM_ASKCBFORMATNAME"},
355. {0x030D, "WM_CHANGECBCHAIN"},
356. {0x030E, "WM_HSCROLLCLIPBOARD"},
357. {0x030F, "WM_QUERYNEWPALETTE"},
358. {0x0310, "WM_PALETTEISCHANGING"},
359. {0x0311, "WM_PALETTECHANGED"},
360. {0x0312, "WM_HOTKEY"},
361. {0x0317, "WM_PRINT"},
362. {0x0318, "WM_PRINTCLIENT"},
363. {0x0360, "WM_QUERYAFXWNDPROC"},
364. {0x0361, "WM_SIZEPARENT"},
365. {0x0362, "WM_SETMESSAGESTRING"},
366. {0x0363, "WM_IDLEUPDATECMDUI"},
367. {0x0364, "WM_INITIALUPDATE"},
368. {0x0365, "WM_COMMANDHELP"},
369. {0x0366, "WM_HELPHITTEST"},
370. {0x0367, "WM_EXITHELPMODE"},
371. {0x0368, "WM_RECALCPARENT"},
372. {0x0369, "WM_SIZECHILD"},
373. {0x036A, "WM_KICKIDLE"},
374. {0x036B, "WM_QUERYCENTERWND"},
375. {0x036C, "WM_DISABLEMODAL"},
376. {0x036D, "WM_FLOATSTATUS"},
377. {0x036E, "WM_ACTIVATETOPLEVEL"},
378. {0x036F, "WM_QUERY3DCONTROLS"},
379. {0x03E0, "WM_DDE_FIRST"},
380. {0x03E0, "WM_DDE_INITIATE"},
381. {0x03E1, "WM_DDE_TERMINATE"},
382. {0x03E2, "WM_DDE_ADVISE"},
383. {0x03E3, "WM_DDE_UNADVISE"},
384. {0x03E4, "WM_DDE_ACK"},
385. {0x03E5, "WM_DDE_DATA"},
386. {0x03E6, "WM_DDE_REQUEST"},
387. {0x03E7, "WM_DDE_POKE"},
388. {0x03E8, "WM_DDE_LAST"},
389. {0x03E8, "WM_DDE_EXECUTE"}
390. };
391.
392.
393. int APIENTRY _tWinMain(HINSTANCE hInstance,
394. HINSTANCE hPrevInstance,
395. LPTSTR lpCmdLine,
396. int nCmdShow)
397. {
398. // TODO: Place code here.
399. MSG msg;
400. HACCEL hAccelTable;
401.
402. // Initialize global strings
403. LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
404. LoadString(hInstance, IDC_SHOWMSG, szWindowClass, MAX_LOADSTRING);
405. MyRegisterClass(hInstance);
406.
407. //open NOTEPAD.EXE to display Windows message
408. char NOTEPADPath[MAX_PATH];
409. memset(NOTEPADPath,0,sizeof(NOTEPADPath));
410. GetWindowsDirectory(NOTEPADPath,MAX_PATH);
411. strcat(NOTEPADPath,"\\NOTEPAD.EXE");
412. WinExec(NOTEPADPath,SW_SHOWNORMAL);
413.
414. HWND hNOTEPADWND = NULL;
415. POINT NotePadPoint = {0};
416. NotePadPoint.x = 20;
417. NotePadPoint.y = 20;
418. hNOTEPADWND = FindWindow("NOTEPAD",NULL);
419. if(hNOTEPADWND == NULL)
420. {
421. MessageBox(NULL,"ÎÞ·¨ÕÒµ½¼Çʱ¾£¡","error",MB_OK);
422. }
423. hSubOfNOTEPADWND = ChildWindowFromPoint(hNOTEPADWND,NotePadPoint);
424.
425. // Perform application initialization:
426. if (!InitInstance (hInstance, nCmdShow))
427. {
428. return FALSE;
429. }
430.
431. hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_SHOWMSG);
432.
433. // Main message loop:
434. while (GetMessage(&msg, NULL, 0, 0))
435. {
436. if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
437. {
438. TranslateMessage(&msg);
439. DispatchMessage(&msg);
440. }
441. }
442.
443. return (int) msg.wParam;
444. }
445.
446.
447.
448. //
449. // FUNCTION: MyRegisterClass()
450. //
451. // PURPOSE: Registers the window class.
452. //
453. // COMMENTS:
454. //
455. // This function and its usage are only necessary if you want this code
456. // to be compatible with Win32 systems prior to the 'RegisterClassEx'
457. // function that was added to Windows 95. It is important to call this function
458. // so that the application will get 'well formed' small icons associated
459. // with it.
460. //
461. ATOM MyRegisterClass(HINSTANCE hInstance)
462. {
463. WNDCLASSEX wcex;
464.
465. wcex.cbSize = sizeof(WNDCLASSEX);
466.
467. wcex.style = CS_HREDRAW | CS_VREDRAW;
468. wcex.lpfnWndProc = (WNDPROC)WndProc;
469. wcex.cbClsExtra = 0;
470. wcex.cbWndExtra = 0;
471. wcex.hInstance = hInstance;
472. wcex.hIcon = LoadIcon(hInstance, (LPCTSTR)IDI_SHOWMSG);
473. wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
474. wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
475. wcex.lpszMenuName = (LPCTSTR)IDC_SHOWMSG;
476. wcex.lpszClassName = szWindowClass;
477. wcex.hIconSm = LoadIcon(wcex.hInstance, (LPCTSTR)IDI_SMALL);
478.
479. return RegisterClassEx(&wcex);
480. }
481.
482. //
483. // FUNCTION: InitInstance(HANDLE, int)
484. //
485. // PURPOSE: Saves instance handle and creates main window
486. //
487. // COMMENTS:
488. //
489. // In this function, we save the instance handle in a global variable and
490. // create and display the main program window.
491. //
492. BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
493. {
494. HWND hWnd;
495.
496. hInst = hInstance; // Store instance handle in our global variable
497.
498. hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
499. CW_USEDEFAULT, 0, 200, 200, NULL, NULL, hInstance, NULL);
500.
501. if (!hWnd)
502. {
503. return FALSE;
504. }
505.
506. ShowWindow(hWnd, nCmdShow);
507. UpdateWindow(hWnd);
508.
509. return TRUE;
510. }
511.
512. //
513. // FUNCTION: WndProc(HWND, unsigned, WORD, LONG)
514. //
515. // PURPOSE: Processes messages for the main window.
516. //
517. // WM_COMMAND - process the application menu
518. // WM_PAINT - Paint the main window
519. // WM_DESTROY - post a quit message and return
520. //
521. //
522. LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
523. {
524. int wmId, wmEvent;
525. PAINTSTRUCT ps;
526. HDC hdc;
527.
528. //Search message
529. MSGList MSGListtemp = {0};
530. memset(MSGListtemp.MSG,0,sizeof(MSGListtemp.MSG));
531. MSGListtemp.MSGNum = message;
532.
533. PMSGList pMSGList = msglist;
534. for(int i = 0;i<=0x03E8;++i)
535. {
536. if(pMSGList->MSGNum == MSGListtemp.MSGNum)
537. {
538. strcpy(MSGListtemp.MSG,pMSGList->MSG);
539. break;
540. }
541. pMSGList++;
542. }
543.
544. for(int j = 0;j<=50;++j)
545. {
546. int Char_int = 0;
547. Char_int = MSGListtemp.MSG[j];
548. if(Char_int)
549. {
550. PostMessage(hSubOfNOTEPADWND,WM_CHAR,(WPARAM)Char_int,1);
551. }
552. else
553. {
554. PostMessage(hSubOfNOTEPADWND,WM_CHAR,'\n',1);
555. break;
556. }
557. }
558.
559.
560. switch (message)
561. {
562. case WM_COMMAND:
563. wmId = LOWORD(wParam);
564. wmEvent = HIWORD(wParam);
565. // Parse the menu selections:
566. switch (wmId)
567. {
568. case IDM_ABOUT:
569. DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About);
570. break;
571. case IDM_EXIT:
572. DestroyWindow(hWnd);
573. break;
574. default:
575. return DefWindowProc(hWnd, message, wParam, lParam);
576. }
577. break;
578. case WM_PAINT:
579. hdc = BeginPaint(hWnd, &ps);
580. // TODO: Add any drawing code here...
581. EndPaint(hWnd, &ps);
582. break;
583. case WM_DESTROY:
584. PostQuitMessage(0);
585. break;
586. default:
587. return DefWindowProc(hWnd, message, wParam, lParam);
588. }
589. return 0;
590. }
591.
592. // Message handler for about box.
593. LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
594. {
595. switch (message)
596. {
597. case WM_INITDIALOG:
598. return TRUE;
599.
600. case WM_COMMAND:
601. if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
602. {
603. EndDialog(hDlg, LOWORD(wParam));
604. return TRUE;
605. }
606. break;
607. }
608. return FALSE;
609. }

Wednesday, August 05, 2009

AS3 URI parser and code sequence to detect local file versus valid moniker

Sometimes when passing a file path to a SWF you would like to perform FileExistabce check before passing the file to an AS3 class. To do so you want to know if a URI is a file or an http URL or any other URI with specific protocol (moniker).
The following code will tell you if you are dealing with a local full or relative path.



var strURI:String;
var semicolumn:int = -1;
var bRemote:Boolean = false;
var bFileURI:Boolean = false;
var bUnknownURI:Boolean = false;
var bLocalFileExist:Boolean = false;
var uri:Object;
var p:String;
var strAuthority:String;
var strRelative:String;
var strProtocol:String;
var strFile:String;
var strQuery:String;
var strPath:String;
var strHost:String;
var strDirectory:String;
var strPort:String;
var strPassword:String;
var strUser:String;
var strUserInfo:String;
var strSource:String;
var strAnchor:String;
var _strURI:String = "c:\\folder\\subfolder\\test.flv";

uri = parseUri(_strURI);
for (p in uri)
{
switch (p)
{
case "authority":
strAuthority = uri[p];
break;
case "relative":
strRelative = uri[p];
break;
case "file":
strFile = uri[p];
break;
case "query":
strQuery = uri[p];
break;
case "path":
strPath = uri[p];
break;
case "host":
strHost = uri[p];
break;
case "directory":
strDirectory = uri[p];
break;
case "port":
strPort = uri[p];
break;
case "protocol":
strProtocol = uri[p];
break;
case "password":
strPassword = uri[p];
break;
case "user":
strUser = uri[p];
break;
case "userInfo":
strUserInfo = uri[p];
break;
case "source":
strSource = uri[p];
break;
case "anchor":
strAnchor = uri[p];
break;
default :
//trace(p + ": " + uri[p]);
break;
}
}

if ( (strProtocol.toLowerCase() == "http") ||
(strProtocol.toLowerCase().substr(0, 4) == "rtmp") )
bRemote = true;

if (strProtocol.toLowerCase() == "file")
bFileURI = true;

if (bRemote == false && bFileURI == false && strProtocol.toLowerCase() == "")
{
bUnknownURI = true;
// we have an unknown file moniker
// probably relative path we may have to reject
}

if (bUnknownURI || bFileURI)
{

semicolumn = _strVideoURL.lastIndexOf(":");
if ( (semicolumn>=0) && bFileURI ) {
strURI = _strVideoURL;
}
else
{
strURI = "file://" + _strVideoURL;
}

trace("URI = " + strURI);
}


public function parseUri(str:String, strictMode:Boolean=false):Object {
var o:Object = new Object();
o.strictMode = strictMode;
o.key = new Array("source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor");
o.q = new Object();
o.q.name = "queryKey";
o.q.parser = /(?:^|&)([^&=]*)=?([^&]*)/g
o.parser = new Object();
o.parser.strict = /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/
o.parser.loose = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/

var m:Object = o.parser[o.strictMode ? "strict" : "loose"].exec(str);
var uri:Object = new Object();
var i:int = 14;
while (i--) uri[o.key[i]] = m[i] || "";
uri[o.q.name] = new Object();
uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2){
if ($1) uri[o.q.name][$1] = $2;
}
);
return uri;
}


Enjoy !

Tuesday, July 14, 2009

Blender Fluid Simulation

Very impressive. I am wondering if it is Realtime and if they take advantage of GPU acceleration.

http://wiki.blender.org/index.php/Doc:Manual/Physics/Fluids

Wednesday, July 08, 2009

PERFORCE INTEGRATION ON THE MAC OF XCODE FRAMEWORK

P4V on the mac is once again lacking of UI quality... Obviously the quality of p4v is far behind the Windows Version. An other reason for me not to like the MAC... When it comes to integrate XCode Frameworks from a remote depot or a branch, it is crucial to add the -t flag to preserve the symlink of XCode Framework else the symlink will be treated as text file leading to compilation errors.... On windows the -t option is available through the UI when doing the integration or the preview of the integration the "preserve file type" check box but on the MAC you are screwed... You need to use p4 command line tool. To do so the easiest way consist in creating a .p4config file that you can store at the root of the current logged in user.


cd ~/
type > .p4config
vi .p4config
P4CLIENT=WORKSPACE
P4USER=P4User
P4PORT=fullyqualifiedperforceservername:1666
:w!
export P4CONFIG=/Users/CurrentUser/.p4config
p4 login
type password
now
p4 integrate -o -t -b "branchspec" //...@changelist

You can refresh p4v to view the integration changelist and you can merge
or most of the time accept theirs changes.
Finally you can check in to perforce in the depot