Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trying to find out how to imitate WinXP behavior....
Message
From
17/02/2004 13:05:14
 
 
To
17/02/2004 12:17:07
Lamar Glover
Southeastern Apparel, Inc.
Dothan, Alabama, United States
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00874439
Message ID:
00878014
Views:
21
Try this as an example. It should run as is:
SET TALK OFF
SET SAFETY OFF
CLOSE TABLES
CREATE TABLE testflas (cid c(10), ddate D)
FOR i = 1 TO 500
	APPEND BLANK
	REPLACE testflas.cid WITH ALLTRIM(STR(i))
	REPLACE testflas.ddate WITH DATE() - i
ENDFOR

GO TOP

llend = .F.

oform = CREATEOBJECT('TESTFLASH')
oform.show()
DO WHILE !llend
	read events
ENDDO
IF TYPE('oform')="O" .and. !ISNULL(oform)
	oform.release
ENDIF
RELEASE oform
CLOSE tables
RETURN

PROCEDURE  decl
	DECLARE Sleep IN kernel32 INTEGER dwMilliseconds
	DECLARE INTEGER GetActiveWindow IN user32

	DECLARE INTEGER FlashWindow IN user32;
		INTEGER hWnd, INTEGER bInvert


DEFINE CLASS testflash AS FORM

        caption = 'TESTFLASH'
	Height = 160
	Width = 325
	DoCreate = .T.
	WindowState = 0
	Name = "TESTFLASH"
	lstop = .F.


	ADD OBJECT timer1 AS timer WITH ;
		Top = 0, ;
		Left = 12, ;
		Height = 23, ;
		Width = 23, ;
		Interval = 50, ;
		Name = "Timer1"


	ADD OBJECT cmdgo AS commandbutton WITH ;
		Top = 108, ;
		Left = 120, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "Start", ;
		Name = "cmdGo"


	ADD OBJECT label1 AS label WITH ;
		BackStyle = 0, ;
		Caption = "", ;
		Height = 17, ;
		Left = 36, ;
		Top = 60, ;
		Width = 132, ;
		Name = "Label1"


	ADD OBJECT label3 AS label WITH ;
		BackStyle = 0, ;
		Caption = "ID", ;
		Height = 17, ;
		Left = 36, ;
		Top = 36, ;
		Width = 40, ;
		Name = "Label3"


	ADD OBJECT label4 AS label WITH ;
		BackStyle = 0, ;
		Caption = "Date", ;
		Height = 17, ;
		Left = 180, ;
		Top = 36, ;
		Width = 40, ;
		Name = "Label4"


	ADD OBJECT label2 AS label WITH ;
		BackStyle = 0, ;
		Caption = "", ;
		Height = 17, ;
		Left = 180, ;
		Top = 60, ;
		Width = 132, ;
		Name = "Label2"


	PROCEDURE Unload
		DODEFAULT()
		llend = .T.
		CLEAR EVENTS
		RETURN
	ENDPROC


	PROCEDURE timer1.Timer
		IF _screen.windowstate = 1 && minimized
			IF testflas.ddate < DATE() - 15
				THISFORM.lstop = .T.
			ENDIF
		ENDIF
		RETURN
	ENDPROC


	PROCEDURE cmdgo.Click
		MESSAGEBOX('VFP will minimize and then in approximately 15 seconds VFP will'+CHR(13);
		          +'start flashing on the startmenu.  Press escape or click on it to'+CHR(13);
		          +'bring it open on the screen.',0)
		         
		DO DECL
		LOCAL hWindow
		hWindow = GetActiveWindow()
		_screen.windowstate = 1

		GO TOP
		SCAN
			THISFORM.label1.caption=testflas.cid
			thisform.label2.caption=DTOC(testflas.ddate)
			WAIT WINDOW "Processing: "+testflas.cid TIMEOUT 1
			IF THISFORM.lstop = .T.
				DO WHILE _screen.windowstate = 1
					= FlashWindow (hWindow, 1)
					= Sleep (250)
					= FlashWindow (hWindow, 0)
					= Sleep (100)
				ENDDO
				MESSAGEBOX('Verify that the date for this record is 15 days old!',0)
				EXIT
			ENDIF
		ENDSCAN
		GO TOP
		RETURN
	ENDPROC


ENDDEFINE
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Reply
Map
View

Click here to load this message in the networking platform