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]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.