Authorware UCD Development Big Secret (4)

xiaoxiao2021-03-06  18

I have encountered this situation with a very cool VCL component that I can only run in the IDE development environment, and I can't use it, and occasionally "once compiled into an EXE file. "Conscience" will also pop up a dialog in this time, you want you to spend xx dollar registration and buy this component (this is the hateful, feeling the same, the same, please, we have developed an Authorware plugin and want to use It makes a few Money, it is necessary to learn that this requires our program to discriminate the user's use of plug-ins. It is in the development environment or the operation environment. By getting current, but in Authorware, I tried it: Authorware is developing The window names of the window running separately after packaging! In fact, MarcoMedia has provided a structural parameter after Authorware3.0, which can get the running state by this parameter, which is originally C language description. Now I am converting it to the Object Pascal statement as follows:

Type

AWPARAM = Record

Size: Word; // The length of this structure

HWND: hwnd; // authorware handle

Authoring: bool; // Is it in the development status, is it returned? No False

RESERVED1: longint; //

RESERVED2: longint; //

End {awparam};

FAR = awparam;

AWPARAM_PTR = ^ awparam // Declaration as a far node pin

Ok, add this parameter structure to the project document (after the Uses statement), let us use this parameter to implement a commercial software, or the above input box function is used as an example, asking the user in the Athorware development environment Everything is normal when using it, when the user is packaged

The post-recorded mode dialog box is popped up when the EXE file is started.

First change the above function to:

......

Function DisplayInputBox (WinHandle: awparam_ptr; action, tiptxt, defaulttxt: pchar): thandle; stdcall;

......

Begin // Insert the following code from here

IF WinHandle.Authoring = false kil

MessageBox (WinHandle.hwnd, 'This is an unregistered authorware plugin', 'Please register', MB_OK;

......

However, the problem now is: If the user does not call the AWPARAM parameter, will it be wrong?

In fact, MarcoMedia has long thought of this. This parameter is only provided to programmers, and this parameter is for users.

It is hidden, opaque, is a "virtual parameter" is also the user does not add this parameter at all when using this function, but is added by Authorware itself, it seems that this parameter does not exist at all.

In order to let AuthorWare identify this parameter, you need to make a modification in the string resource file:

......

"ASSS / 0", (first "A" means that Authorware is sent to an awprplay parameter, remember!)

......

Now you can sit at home waiting for money.

转载请注明原文地址:https://www.9cbs.com/read-58413.html

New Post(0)