Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can I use VFP8 to change the Windows wallpaper
Message
 
À
28/07/2004 05:28:19
Yim Ming Sun Derek
Spacious Design Consultant
Hong Kong, Hong Kong
Information générale
Forum:
Visual FoxPro
Catégorie:
Photos et traitement d'images
Divers
Thread ID:
00927836
Message ID:
00928633
Vues:
39
Here are the step I took to achieve this.
1. Create a project (blank)
2. Add the main program.
3. Add the picture "picture1.jpg" I want to use and make sure it is marked as included in the executable.
4. (This was only so I don't have to change my wallpaper)Create a form and added a picture control, and in the pricture property I put this:
= ADDBS(JUSTPATH(SYS(16))) + 'picture2.jpg'
That way there is no confusion as to which picture is being used.
5. Here is the code I used in the main program.
SET SAFETY off
CREATE CURSOR MYPIC (PIC m)  && create a cursor with a memo field
lcSt = FILETOSTR('picture1.jpg') && Store the picture into the memo (only the binary)
INSERT INTO myPic VALUES (lcst) && Put the info into the memo
COPY MEMO PIC TO  ADDBS(JUSTPATH(SYS(16))) + 'picture2.jpg' && Bring it back as a picture
DO FORM c:\rick4\form1.scx
READ events
Then I compile the executable and rename the original picture (or rename it), to make sure there is no confusion.
Run the executable, and check the directory and 'picture2.jpg' is there and "picture1.jpg" is still not there. Conclusion VFP extracted the picture from the compiled executable and created a new picture, to use as you wish.

>Hi, Mike
>
>I have try your method but not success.
>Can you send me some sample coding ?
>
>Derek
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform