Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Flash minimized app caption
Message
 
To
05/02/2003 14:29:37
Elyse Pomerantz
Dynamic Data Concepts, Inc.
Brooklyn, New York, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00697473
Message ID:
00749496
Views:
22
>>>Hi All
>>>
>>>Anyone know how to flash the minimized application caption on the status bar - like when Excel (or other) apps require your attention but the app is minimized?
>>>
>>>TIA
>>>
>>Jos,
>>
>>Look at FlashWindowEx() in the Platform SDK. It requires either Windows 98 or later or Windows 2000 or later. If you need some assistance with translating it to VFP, just post back.
>
>Do you have any sample code for this?

Sure,
DECLARE INTEGER FlashWindowEx IN Win32api;
  STRING @pfwi
SET PROCEDURE TO Con_Int ADDITIVE
oConvert = CREATEOBJECT('ConvertInt')
* Size of the structure
lcfwi = oConvert.IntegerToString(20)
* Window handle of the window to flash
lcfwi = lcfwi + oConvert.IntegerToString(_vfp.hwnd)
* Flash the caption
lcfwi = lcfwi + oConvert.IntegerToString(1)
* The number of times to flash
lcfwi = lcfwi + oConvert.IntegerToString(10)
* Timeout in milliseconds - 0 = until number executed
lcfwi = lcfwi + oConvert.IntegerToString(0)
? FlashWindowEx(@lcfwi)

* Con_int.prg

DEFINE CLASS ConvertInt AS CUSTOM

  FUNCTION IntegerToString
    
    LPARAMETER pnInteger, pnbytes
    
    LOCAL lcresult, lnbytes, lnmask,;
      lninteger, lni, lnchar
    lcresult = ""
    IF PCOUNT() = 2
      lnbytes = pnbytes
    ELSE
      * Default to DWORD
      lnbytes = 4
    ENDIF
    lninteger = pnInteger
    lnmask = 255
    FOR lni = 1 TO lnbytes
      lnchar = BITAND(lninteger, lnmask)
      lcresult = lcresult + CHR(lnchar)
      lninteger = BITRSHIFT(lninteger, 8)
    NEXT
    RETURN lcresult
  ENDFUNC
  
  FUNCTION StringToInteger
    
    LPARAMETER pcstring, plsigned
    
    LOCAL lnresult, lnlast, lni, llsigned,;
      lnmsb, lnmax
    lnresult = 0
    lnlast = LEN(pcstring)
    * Return Signed Integer?
    IF PCOUNT() = 2
      llsigned = plsigned
    ELSE
      llsigned = .F.
    ENDIF
    FOR lni = 1 TO lnlast
      lnresult = lnresult + ASC(SUBSTR(pcstring, lni, 1)) * (256 ^ (lni - 1))
    NEXT
    IF llsigned
      lnmsb = (lnlast * 8) - 1
      IF BITTEST(lnresult, lnmsb)
        lnmax = (2 ^ (lnmsb + 1))
        lnresult = lnresult - lnmax
      ENDIF
    ENDIF
    RETURN lnresult
  ENDFUNC
ENDDEFINE
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform