Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
FLL creation problem
Message
 
To
18/11/2011 15:36:47
Emerson Reed
Folhamatic Tecnologia Em Sistemas
Americana - São Paulo, Brazil
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows 7
Miscellaneous
Thread ID:
01529243
Message ID:
01529258
Views:
56
Likes (1)
:)
http://www.news2news.com/vfp/?example=271
* Using Win32 Functions in Visual FoxPro
* example=271
* Using FlashWindowEx to flash the taskbar button of the VFP application

DO declare

#DEFINE FLASHW_STOP 0
#DEFINE FLASHW_CAPTION 1
#DEFINE FLASHW_TRAY 2
#DEFINE FLASHW_ALL BITOR(FLASHW_CAPTION, FLASHW_TRAY)
#DEFINE FLASHW_TIMER 4
#DEFINE FLASHW_TIMERNOFG 12

*| typedef struct {
*|   UINT  cbSize;      0:4
*|   HWND  hwnd;        4:4
*|   DWORD dwFlags;     8:4
*|   UINT  uCount;     12:4
*|   DWORD dwTimeout;  16:4
*| } FLASHWINFO, *PFLASHWINFO; total = 20 bytes
#DEFINE FLASHWINFO_STRU_SIZE  20

LOCAL hWindow, lcBuffer, lnFlags, lnTimes, lnInterval

hWindow = GetActiveWindow()

lnFlags = FLASHW_TRAY
lnTimes = 5
lnInterval = 0  && default cursor blink rate applied

lcBuffer = num2dword(FLASHWINFO_STRU_SIZE) +;
	num2dword(hWindow) +;
	num2dword(lnFlags) +;
	num2dword(lnTimes) +;
	num2dword(lnInterval)

= FlashWindowEx(@lcBuffer)

FUNCTION num2dword(lnValue)
#DEFINE m0 0x0000100
#DEFINE m1 0x0010000
#DEFINE m2 0x1000000
	IF lnValue < 0
		lnValue = 0x100000000 + lnValue
	ENDIF
	LOCAL b0, b1, b2, b3
	b3 = Int(lnValue/m2)
	b2 = Int((lnValue - b3*m2)/m1)
	b1 = Int((lnValue - b3*m2 - b2*m1)/m0)
	b0 = Mod(lnValue, m0)
RETURN Chr(b0)+Chr(b1)+Chr(b2)+Chr(b3)

PROCEDURE declare
	DECLARE INTEGER FlashWindowEx IN user32 STRING @pfwi
	DECLARE INTEGER GetActiveWindow IN user32
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform