Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Icon in Taskbar
Message
De
12/06/2018 19:22:22
 
 
À
11/06/2018 04:29:08
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
Divers
Thread ID:
01660671
Message ID:
01660701
Vues:
69
you can use the API sendMessage with (#define wm_seticon 0x080 ) constant and icon_small (0) parameter to set any icon on vfp window application.
this is available with any executable ...
add a button to you app and put this code in click event
DECLARE INTEGER ExtractIcon IN shell32 INTEGER hInst, STRING  lpszExeFileName, INTEGER lpiIcon
DECLARE INTEGER SendMessage IN user32 INTEGER hWnd, INTEGER Msg, INTEGER wParam, INTEGER lParam



*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

local lnIcon,nindex,gnlower,gnUpper

gnLower = 1
gnUpper = 12   &&can choose icon between 1-12 for example from vfp9.exe (or another application)
rand(-1)
lnIcon =ExtractIcon (0,HOME(1)+"vfp9.exe",INT((gnUpper - gnLower + 1) * RAND( ) + gnLower))  

SendMessage(_vfp.HWND, WM_SETICON, ICON_small, lnIcon)
SendMessage(thisform.HWND, WM_SETICON, ICON_small, lnIcon)
this is available at runtime with your application...build a test proj and compile to test...
the new icon is shoiwn on taskbar.
if you have a top level form and screen=off the form icon is shown dynamically on taskbar.here can change form.icon property dynamically to see new icon on taskbar.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform