How to make the program when starting with the copyright screen

xiaoxiao2021-03-06  119

We generally have the following few types of design for forms:

1. Start the form of the picture. Such as the startup screen of VFP or Word, there are users, use units, copyright information, etc., as shown below:

For such a form, we can do the following: (1) Add the following code during the LOAD event of the form, call the Win32API function. public username, usercomp, titletimedeclare integer RegOpenKeyEx in Win32API; integer nkey, string @ csubkey, integer nreserved,; integer naccessmask, integer @nresultdeclare integer RegQueryValueEx in Win32API; integer nkey, string cvaluename, integer nresered,; integer @ ntype, string @cbuffer , integer @nbuffersizedeclare integer RegCloseKey in Win32API; integer nkeyusername = usercomp = lnresult = 0buffer = space (128) buffersize = len (buffer) lnerror = regopenkeyex (-2147483646, Software / microsoft / windows / currentversion, 0,1, @ lnresult) if lnerror = 0lntype = 0buffer = space (128) buffersize = len (buffer) lnerror = regqueryvalueex (lnresult, registeredowner, 0, @ lntype, @ buffer, @ buffersize) if lnerror = 0 and buffer <> chr (0) username = left (buffer, buffersize-1) endiflntype = 0buffer = space (128) buffersize = len (buffer) lnerror = regqueryvalueex (lnresult, registeredorganization, 0, @ lntype, @ buffer, @ buffersize) if lnerror = 0 and buffer <> chr (0) UserComp = Left (buffer, bufferSize-1) endifendif = regclosekey (lnResult) Adds Label1 (User Name) and Label2 (User Unit) in the form, add to the INI event of Label1 : This.caption = username statement, add: this.caption = usercomp statement in Label2. Add the following statement in the init entry: public nn && set the initial value nn = 0set Bell to 'Welcome.wav', 2 && Set the startup music when starting, if your machine has no sound card, just ring ?? CHR (7) && once.

(2) Set the properties of the form. Alwaysontop = .t.autocenter = .t.borderstyle = 1caption = '' closable = .f.controlbox = .f.desktop = .f.maxbutton = .f.minButton = .f.Movable = .f.picture = 'begin This venom image of .BMP '&& is the same as the size of the form. showWindow = .t. This setup form is a single-line box without a title. (3) Add a timer Timer1 in the form, the Timer Event process of writing the timer NN = nn 1if nn = 45Release thisformclear eventendif This form is automatically turned off after startup. (4) Click event process in the form. BRELEASE thisformclear Event This after the startup, if the user does not want the screen to stay, click the form on the start screen to quickly enter the program screen. (5) Write the unload event of the form. Set Bell Toclear Dells2. About the picture. Nowadays, there is generally a picture about the picture in large programs. The following is a simple example, just less system information. The picture is as follows: (1) Set the formal property. Alwaysontop = .t.autocenter = .t.borderstyle = 2caption = 'About' maxButton = .f.minButton = .f.icon = 'about.ico' (2) Set the username and use unit. This allowable LOAD event process settings of the boot screen. (3) Set the default directory, operating system, hard disk space, CPU model, and 5 Label can be used in memory. For the default directory, add code in the init event: this.caption = allt (SYS (5)) Allt (SYS (2003)) operating system, add: this.caption = OS () Hard disk space in the init event, Init event Add: this.caption = allt (Str (DiskSpace ())) byte CPU model, add: this.caption = sys (17) available memory, add: this.caption = sys (1001) KB (4) Home address, technical support for hyperlink. Tune Windows Shell32 function in the init event of the form. Declare Integer SHELLEXECUTE IN Shell32.dll Integer HWND, String,; String Lpszfile, String, String, Integer creates a tab (Label18), enter: http: //zhanghongju.163.net/ Add the following in its Click event Code: lpszfile = 'http: //zhanghongju.163.net/' && setting Your home address = shellexecute (0, 0, lpszfile, 0, 0, 1) && calls shellexecute function

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

New Post(0)