Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ThemedControl 3

Status
Not open for further replies.

abbasaif

ISP
Oct 8, 2018
89
AE
Hi All

Can I get the step by step procedure, how to create themed control.
I downloaded from VFPX but gives a lot of errors.

Please consider me as a beginner and let me know, how to implement this theme in my app.

Thanks

abbasaif
 
Well, and since that was removed, of course the VFPX project about themed controls isn't just documented by Doug Hennig's paper, it has its own documentation on Github as well.

First the overview page (readme.md - if you're unfamiliar with Github - is a file that contains markdown for exactly what is shown on the project home page):

It tells the help is a ThemedControlsHelp.htm file in the VCX folder, it only lacks documentation for the ribbon.

Did you find that ThemedControlsHelp.htm?

The easiest way to get at this is not by navigating online in the Github repository, click "clone or download" and then download the project as a zip, unzip and then start the ThemedControlsHelp.htm

[highlight #FCE94F]Important![/highlight]

One notice, very general about any download you do: Right click on the downloaded zip and follow these instructions:
Microsoft introduced this mechanism of trust or better untrust of any file downloaded from the internet or getting on your computer from mail attachments. And if you don't unblock, every file extracted from the blocked zip inherits that blocking, that's even true if a setup.exe is marked that way and you run it, every file the setup.exe generates extracts is getting this mark. It's slightly related to why CHM files don't work from a network share, but let's not drift away into details, it's something Micorosft expects you to know and which after over 10 years still hasn't become general knowledge.

The consequence of this blocked files is very subtle, that's why it almost always stays unnoticed, you can run executables, you can watch images, you can read a text, you can work on most files despite that blocking, so calling it blocked seems wrong. But it does something, it starts the executable or the software associated with the file type in a low permission mode.

And indeed that also happens with VFP when you start a PRG marked that way via double click in Windows File Explorer you get a security question whether you trust that PRG and if you do VFP is started in low privilege mode, doesn't find some components and goes into repair setup mode trying to find its installer.

But if you first start VFP and then DO such a PRG it runs normal, which shows how weak this protection is, but also what would have made it much more known, if it can't slip your attention, if it would always hit you.

If you're serious about your system security you first check whether a downloaded file has the checksums as specified by a provider of a download sometimes. Even a platform like GitHub doesn't offer it as an automatic UI or API feature to be able to get eg the MD5 or SHA512 checksum, there are many tools computing this for the file, the point is they only do this for the file you have, not for the file that's online and which you downloaded and want to know whether it is exactly what is provided and wasn't modified.

It's a bit of pity how this all isn't ideal yet, as that checksum idea is even older than that of the trust zone marking of downloaded files.

It has the consequence of MSSQL Server or at least Management studio not working in all aspects when you don't unblock the setup.exe, I solved a problem for someone with linked servers by reinstalling some software from unblocked setups. The situation is as I already said those setups then generate blocked files. The setup itself runs elevated - otherwise you'd notice and the setup wouldn't install - but the installed software then runs with lowered privileges. IE's protected mode is based on this.

If you look in your user profile AppData folder you see besides a Local folder for local userprofiles and a Roaming Folder for domain profiles (most often in a company you can log in at any workstation and your profile then will use that folder) and there is a LocalLow folder there. If I open it at my desktop it contains folders for/from Adobe, Microsoft, Mozilla, Oracle, and Sun. Which shows only the real big software vendors know and use this feature to higher the security of their software.

So I won't blame anyone not knowing all this, but it's surely something at least developers should know about Windows. It adds to the topic of UAC and redirection and elevation of processes in the opposite direction.

So if you downloaded the ThemedControls.tip, unzipped and double clicked on something specific you might have got a security warning. I just experimented and you should still be able to double click and start the sample.pjx and then start main.prg from it and a demo of the themed controls starts and works. Which again shows how low the effect is. I may try further things, but likely everything works much better, if you delete the unzipped folder, go into zip file properties unblock it and the extract once more.

Oh, and last and perhaps not least it's much like anything from VFPX a VFP9 project, the system.app included is GDIPLUSX and also only works in VFP9. VFPX is a VFP9 extension, not any earlier VFP version, many things might work almost, as they are not all checking your VFP version and simply fail on VFP9 features, but it should be clear from the outset VFPX is meant as the community-driven VFP10 by means of extending VFP9 within the possibilities of VFP9 itself, there may be single developers who pay attention to downward compatibility with older VFP versions and API declarations of GDI+ functions also will work in older VFP as they mainly depend on Windows itself and even apply to Windows98, but you can't blame VFP developers to make use of newer language features only available in VFP9, so while themed controls mainly make use of GDI+ Windows feature independent of VFP, they likely also use VFP9 specific feature and don't work in VFP8 or lower.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Mr. Abbasaif,

Further to Olaf's kind en extensive instructions. There is an other one: be sure you install VFP9 Service Pack 2 and the latest Hotfix if you want to work with this class and GDIPlus

Regards,
Koen
 
Hi,

I copied the whole directory of ThemedControl in my current project as a part of project and compiled.
After compilation it gives the following errors:

Compiling k:\winfas\tc\themedcontrols\vcx\ctl32.prg
#DEFINE CCM_GETUNICODEFORMAT (0x2000 + 6)
Error in line 164: Constant is already created with #DEFINE.
#DEFINE CCM_SETUNICODEFORMAT (0x2000 + 5)
Error in line 166: Constant is already created with #DEFINE.

Compiling k:\winfas\tc\themedcontrols\vcx\ctl32_api.prg
#DEFINE CCM_GETUNICODEFORMAT (0x2000 + 6)
Error in line 164: Constant is already created with #DEFINE.
#DEFINE CCM_SETUNICODEFORMAT (0x2000 + 5)
Error in line 166: Constant is already created with #DEFINE.

Compiling k:\winfas\tc\themedcontrols\vcx\ctl32_classes.prg
#DEFINE CCM_GETUNICODEFORMAT (0x2000 + 6)
Error in line 164: Constant is already created with #DEFINE.
#DEFINE CCM_SETUNICODEFORMAT (0x2000 + 5)
Error in line 166: Constant is already created with #DEFINE.

Compiling k:\winfas\tc\themedcontrols\vcx\ctl32_functions.prg
#DEFINE CCM_GETUNICODEFORMAT (0x2000 + 6)
Error in line 164: Constant is already created with #DEFINE.
#DEFINE CCM_SETUNICODEFORMAT (0x2000 + 5)
Error in line 166: Constant is already created with #DEFINE.

Compiling k:\winfas\tc\themedcontrols\vcx\ctl32_structures.prg
#DEFINE CCM_GETUNICODEFORMAT (0x2000 + 6)
Error in line 164: Constant is already created with #DEFINE.
#DEFINE CCM_SETUNICODEFORMAT (0x2000 + 5)
Error in line 166: Constant is already created with #DEFINE.

Kindly let me know how to remove these..?

Thanks

Abbasaif
 
Thanks for the reply!

I checked there is no duplication.

Abbasaif
 
Hi mr. Abbasaif

It stil looks like your project is trying to instantiate the define's in the header file ctl32.h twice.
This does not mean that you have two ctl32.h files in you project, it means one of the programs of your project is trying to instantiate ctl32.h a second time.
Since I don't know how your project nor installation looks like, I would advise you to install Themedcontrols first in a separate own directory, you will than find a Themedcontrols.pjx with which you can play. Please follow Dough's extensive document on the letter and also study the ThemedcontrolsHelp.html file.
If you than have played enough and understand how Emerson made this nice class you can subclass the class into your own and enhance your forms with it.

Regards,
Koen
 
Thanks Mr. Koen for pointing out me to understand the concept of duplication.

I was not using Themedcontrol in my Project, as my project is almost finish, so I decided to change the old looking main menu with this beautiful creation.

I copied the whole themedcontrol directory (Which I was downloaded from VFPx) into my running directory and changed the name from "Themedcontrol" to "TC" and set the path according to it.

After that I compiled without doing nothing and found the above mentioned errors.

Please guide is there anything I am missing?

Thanks

Abbasaif

 
Hi,

It stil looks like your project is trying to instantiate the define's in the header file ctl32.h twice.
This does not mean that you have two ctl32.h files in you project, it means one of the programs of your project is trying to instantiate ctl32.h a second time.

I checked my Project Manager thoroughly and found that ctl32.h is already there in FoxyView (The directory which I am using for FoxyPreviewer).

Please let me know what to do, if I remove this, will it effect my running project.

Thanks

Abbasaif
 
Mr Abbasaif,
If you have two ctl32.h in your project, I would rename one in e.g. ctl32old.h and see what happens, if you encounter an error you should try to rename the otherone and rename ct32old.h back to ctl32.h
Please note,
I cannot oversee how your project is concepted so it is also for me a trial and error. I still believe what you are doing here is wrong.
Donot just copy the whole Themedcontrols directory into your present project. Themedcontrol consists of, I believe 5 different classes and it is very unlikely you will using them all 5. It is much better to delete that directory from your project and install Themedcontrols in a separate directory. Now you van open the Themedcontrols project file and play and learn how it works, what it does.
Regards,
Koen
 
Thanks Mr. Koen, it works.

There are no errors now.

Abbasaif
 
Hi,

Can anybody guide me how to put/insert image as shown in figure in themedcontrol?

Thanks

Abbasaif

err1_wo8ijd.jpg
 
I tried a lot using power point given in example. But did not get through.

In Help it saying

"In the Properties window, activate each page and set the Caption and Picture16 properties"

Please guide.

Thanks

Abbasaif
 


Mr. Abbasaif,

In the form (the frmSample) you drill down in the properties window to
.ThemedOutlookNavbar
.Panes
.Pane1
.Picture16 or Picture24 property
and
.Pane2 etc

Koen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top