×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Microsoft: FoxPro FAQ

Program Source Code

How to change .ESL Icon using good 'ol native FoxPro 2.x by Scott24x7
Posted: 15 Mar 02 (Edited 15 Mar 02)

Copy and past the code below into a .PRG file, I like to call it FIXICON.PRG, but that is up to you.  You will need to change the name of the Icon file (as designated by the .ICO file name) in line 17, and the path to your .ESL file in line 19.  Then, compile, and run, and like magic, you'll have a new Icon that represents your overall application, and that silly Fox Head will disappear.
     Note:  That I don't recommend using Icons that are greater than 16x16, or that use High Color definitions.  FPW was created back in the day before such things, and I have had *unusual* (at best) experiences with icons over 256 colors, or 32x32.
     Make sure you back up your .ESL file before applying this Icon code.  (You never know what might happen...)

* * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
*     FIXICON.PRG: Replace Icon in Fox 2.x ESL
*     Author:  Scott Payton
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * *

CLEAR
CLOSE ALL
*
PRIVATE M.LC_ESLIcon
PRIVATE M.LC_FoxIcon
PRIVATE M.LC_NewIcon
*
M.LC_NEWIcon = ""
M.LC_FoxIcon = ""
M.LC_ESLIcon = Read_Icon( "\ICONS\MYICON.ICO", 126, @m.LC_NEWIcon )
*
=Updt_Icon("\MYAPP\FOXW2600.ESL", 175720, m.LC_NewIcon)
*
CLOSE ALL
 
* * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * *

FUNCTION Updt_Icon

PARAMETER PC_Name, PN_Offset, PC_Buffer
*
PRIVATE M.LN_Handle
*
M.LN_Handle = FOPEN( m.PC_Name, 2 ) && Read/Write Buffered.
*
IF M.LN_Handle < 0 && If open not successfull...
   ?? CHR( 7 )
   WAIT WINDOW m.PC_Name + " Open error: " + STR(FERROR())
   RETURN .F.
ENDIF
*
=FSEEK(M.LN_Handle, M.PN_Offset)
*
=FWRITE(M.LN_Handle, M.PC_Buffer, 512)
*
=FCLOSE(M.LN_Handle)

* * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * *

FUNCTION Read_Icon

PARAMETER M.PC_Name, M.PN_Offset, M.PC_Buffer
*
PRIVATE M.LN_Handle
*
M.LN_Handle = FOPEN(M.PC_Name)
 
IF M.LN_Handle < 0  && If open not successfull...
   ?? CHR( 7 )
   WAIT WINDOW m.PC_Name + " Open error: " + STR(FERROR())
   RETURN .F.
ENDIF
=FSEEK(M.LN_Handle, M.PN_Offset)
*
M.PC_Buffer = FREAD(M.LN_Handle, 512)
*
=FCLOSE(M.LN_Handle)

Back to Microsoft: FoxPro FAQ Index
Back to Microsoft: FoxPro Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close