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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing icon for GETFILE()

Status
Not open for further replies.

EMJULIAN

Programmer
Aug 14, 2002
45
US
Is there a way to change the icon on the GETFILE() screen to my own or does it have to be the fox?

Thanks!
Eve
 
You can use this command to change the fox

_Screen.Icon="c:\your.ico"

change c:\your.ico to the icon of your choice
 
EMJULIAN,

Open you Visual Foxpro helpfile from in VFP, I'm assuming the caption on that window is "Visual Foxpro" (if not then change it in the code below). Now cut-n-paste the code below into a prg file and run it...it will change the icon on the helpfile window (or any window that you have the caption for) and it will change the caption on the window and it will maximize the window and bring it to the foreground of the desktop. This will work for most any window that you can bring up in windows and so it can change the Getfile() icon, though I'm not sure what you mean because in XP the Getfile() dialog doesn't have an icon. But rather than belabor that point, I thought I would show you an example of change icons, captions and state with windows.


*Constants for ShowWindow second paramter
#DEFINE SW_NORMAL 1
#DEFINE SW_MAXIMIZE 3
#DEFINE SW_MINIMIZE 6

*Constants for SendMessage second parameter
#DEFINE WM_GETICON 0x7F
#DEFINE WM_SETICON 0x80

*Constants for SendMessage third parameter
#DEFINE ICON_SMALL 0
#DEFINE ICON_BIG 1

DECLARE Long FindWindow in Win32API String, String
DECLARE Long BringWindowToTop in Win32API Long
DECLARE Long ShowWindow in Win32API Long, Long
DECLARE INTEGER SetWindowText IN user32 INTEGER hWnd, STRING lpString
DECLARE INTEGER ExtractIcon IN shell32 INTEGER hInst, STRING lpszExeFileName, INTEGER lpiIcon
DECLARE INTEGER SendMessage IN user32 INTEGER hWnd, INTEGER Msg, INTEGER wParam, INTEGER lParam

lnHWND = FindWindow(null,"Visual Foxpro")
lnIcon = ExtractIcon (0,HOME()+"GRAPHICS\ICONS\Win95\audio.ICO",0) && I am assuming this icon exists on your system
SetWindowText(lnHWND, "My Custom Caption")
SendMessage(lnHWND, WM_SETICON, ICON_small, lnIcon)
*!* SendMessage(lnHWND, WM_SETICON, ICON_BIG, lnIcon)
BringWindowToTop(lnHWND)
ShowWindow(lnHWND, SW_MAXIMIZE)
CLEAR DLLS "FindWindow", "BringWindowToTop", "ShowWindow", "SetWindowText", "ExtractIcon", "SendMessage"

Slighthaze = NULL

[ul][li]FAQ184-2483
An excellent guide to getting a fast and accurate response to your questions in this forum.[/li][/ul]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top