Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Andy Kramek
  Where is Andy Kramek?
 Hot Springs Village
 Arkansas - United States
 Andy Kramek
 To: Arjun Bagojikop
  Where is Arjun Bagojikop?
 Sangli
 India
 Arjun Bagojikop
 Tags
Subject: RE: Display Property-Appearance API
Thread ID: 143261 Message ID: 143318 # Views: 3 # Ratings: 0
Version: Visual FoxPro 9 Category: Active X Controls & OLE Automation
Date: Monday, August 27, 2007 7:50:57 PM         
   


> Thanks a lof of Ken
>
> i have tested Barnards FAQ,its very excellent. but that concept does not effect on PAD. so that i want to change appearance fonts programmaticly. if any solution please suggest me.
>

If, despite everything you have been told, you still insist on doing this, at least give the user the chance!

Here is some VFP code (sorry, but I can't remember where I originally got it from to acknowledge the original author) that runs the windows configuration utilities from within VFP. The one you need is the "Desktop Property Page", then select "Appearance" and the "Advanced" Button. Choose "Menu in the drop-down list and you can change the font and appearance - but you can easily modify this code to do restrict the amount of damage you do...

LOCAL oForm 
oForm = CreateObject("Tform") 
oForm.Show(1) 
* end of main 

DEFINE CLASS Tform As Form 
    Width=480 
    Height=300 
    BorderStyle=2 
    MaxButton=.F. 
    MinButton=.F. 
    Caption="Control Panel Functions" 
    Autocenter=.T. 
     
    ADD OBJECT lst As ListBox WITH; 
    Left=8, Top=5, Width=464, Height=210 
     
    ADD OBJECT Label1 As Label WITH; 
    Left=10, Top=228, Caption="Command:", Autosize=.T. 
     
    ADD OBJECT txtCmd As TextBox WITH; 
    Left=80, Top=226, Height=24, Width=384, ReadOnly=.T. 
     
    ADD OBJECT cmdRun As CommandButton WITH; 
    Left=382, Top=256, Height=27, Width=80, Caption="Run" 

PROCEDURE Init 
    THIS.lst.InteractiveChange 

PROCEDURE lst.Init 
    ThisForm.AddCmd("System, General property page", "shell32.dll,Control_RunDLL sysdm.cpl,,0") 
    ThisForm.AddCmd("Desktop property page", "shell32.dll,Control_RunDLL desk.cpl,,0") 
    ThisForm.AddCmd("Add New Printer wizard", "shell32.dll,SHHelpShortcuts_RunDLL AddPrinter") 
    ThisForm.AddCmd("Add Hardware Wizard", "shell32.dll,Control_RunDLL hdwwiz.cpl") 
    ThisForm.AddCmd("Install/Uninstall tab selected", "shell32.dll,Control_RunDLL appwiz.cpl,,1") 
    ThisForm.AddCmd("Set Date & Time properties tab", "shell32.dll,Control_RunDLL timedate.cpl") 
    ThisForm.AddCmd("Fonts Folder in Explorer view", "shell32.dll,SHHelpShortcuts_RunDLL FontsFolder") 
    ThisForm.AddCmd("Internet Properties, General Tab", "shell32.dll,Control_RunDLL inetcpl.cpl") 
    ThisForm.AddCmd("Mouse Properties", "shell32.dll,Control_RunDLL main.cpl @0") 
    ThisForm.AddCmd("Keyboard Properties, Speed tab", "shell32.dll,Control_RunDLL main.cpl @1") 
    ThisForm.AddCmd("Multimedia/Audio property page", "shell32.dll,Control_RunDLL mmsys.cpl,,0") 

    WITH THIS 
        .RowSourceType=2 
        .RowSource="csCommands" 
        .ListIndex=1 
    ENDWITH 

PROCEDURE lst.InteractiveChange 
    ThisForm.txtCmd.Value = "rundll32.exe " +; 
        ALLTRIM(csCommands.params) 

PROCEDURE AddCmd(cName, cParams) 
    IF Not USED("csCommands") 
        CREATE CURSOR csCommands (cmdname C(50), params C(100)) 
    ENDIF 
    INSERT INTO csCommands VALUES (" "+m.cName, m.cParams) 

PROCEDURE cmdRun.Click 
    ThisForm.RunCmd1("rundll32.exe", ALLTRIM(csCommands.params)) 

PROCEDURE RunCmd1(cApp, cParam) 
    DECLARE INTEGER ShellExecute IN shell32; 
        INTEGER hwnd, STRING lpOperation,; 
        STRING lpFile, STRING lpParameters,; 
        STRING lpDirectory, INTEGER nShowCmd 
    = ShellExecute(0, "open", cApp, cParam, "", 1) 

PROCEDURE RunCmd2(cApp, cParam) 
    DECLARE INTEGER WinExec IN kernel32; 
        STRING lpCmdLine, INTEGER nCmdShow 
    = WinExec(cApp + " " + cParam, 1) 
ENDDEFINE 


Regards
Andy Kramek
Microsoft MVP (Visual FoxPro)
Tightline Computers Inc, Akron Ohio, USA

ENTIRE THREAD

Display Property-Appearance API Posted by Arjun Bagojikop @ 8/27/2007 10:38:29 AM
RE: Display Property-Appearance API Posted by Ken Murphy @ 8/27/2007 12:59:37 PM
RE: Display Property-Appearance API Posted by Arjun Bagojikop @ 8/27/2007 5:53:56 PM
RE: Display Property-Appearance API Posted by Ken Murphy @ 8/27/2007 7:26:03 PM
RE: Display Property-Appearance API Posted by Andy Kramek @ 8/27/2007 7:50:57 PM
RE: Display Property-Appearance API Posted by Arjun Bagojikop @ 8/28/2007 4:41:15 AM
RE: Display Property-Appearance API Posted by Andy Kramek @ 8/27/2007 1:21:21 PM