*--Courtesy 2005/09/06 Frank Dietrich, Universal Thread #DEFINE FLASHWINFO_STRU_SIZE 20 && Größe der Struktur #DEFINE FLASHW_STOP 0 && Stop Flashing, wenn zuvor mit FLASHW_TIMER && aufgerufen #DEFINE FLASHW_CAPTION 1 && Flash die WindowCaption #DEFINE FLASHW_TRAY 2 && Flash den Taskbar - Button #DEFINE FLASHW_ALL BitOr(FLASHW_CAPTION, FLASHW_TRAY) && Taskbar + Caption #DEFINE FLASHW_TIMER 4 && Flash continuously until called with STOP #DEFINE FLASHW_TIMERNOFG 12 && Flash continuously until Window comes to foreground DO flashwindowex WITH -1,0 return *========================================================= * * PROCEDURE: FlashWindowEx * *========================================================= PROCEDURE FlashWindowEx * Created...........: 25.September 2004, 18:15 Uhr * Changed...........: * Description.......: Flash the Window in the Taskbar * Calling Samples...: ? FlashWindowEx(<ExpN>[, <ExpN2>[, <ExpN2>]]) * Parameters........: tnFlashTimes, tnFlashWhat, tnWindowHandle * * tnFlashTimes: * -2 = Stop continuous flashing * -1 = Start continous flashing * 0 = Start continuous flashing until * window receives focus * * tnFlashWhat * 0 = Taskbar-Button + Caption * 1 = Taskbar-Button * 2 = WindowCaption * * Returns...........: boolean lparameters tnFlashTimes, tnFlashWhat, tnWindowHandle *-- typedef struct *-- { *-- UINT cbSize; && Größe der Struktur -> 5*DWord = 5*4 = 20 *-- HWND hwnd; && Window-Handle *-- DWORD dwFlags; && FlashFlags, wie oft, was *-- UINT uCount; && Number of times to flash the window *-- DWORD dwTimeout; && Timeout zwischen den Flashs in ms, wenn 0, *-- } FLASHWINFO, && dann ist es die CursorBlinkRate *-- *PFLASHWINFO; tnFlashTimes = iif(vartype(tnFlashTimes) = "N", tnFlashTimes, 0) tnFlashWhat = iif(vartype(tnFlashWhat) = "N", tnFlashWhat, 3) tnWindowHandle = iif(vartype(tnWindowHandle) = "N", tnWindowHandle, _vfp.hWnd) LOCAL hWindow, pfwi, lnFlags, lnTimes, lnInterval DECLARE INTEGER FlashWindowEx IN user32 STRING @pfwi *DECLARE INTEGER GetActiveWindow IN user32 hWindow = tnWindowHandle lnInterval = 0 && default cursor blink rate applied lnTimes = 0 && flash how many times? *-- Aufbauen der Optionen je nach Parameter lnFlags = 0 *-- Was soll flashen do case case tnFlashWhat = 1 && TaskBarButton lnFlags = lnFlags + FLASHW_TRAY case tnFlashWhat = 2 && Caption lnFlags = lnFlags + FLASHW_CAPTION other lnFlags = lnFlags + FLASHW_ALL endcase *-- wie lange flashen do case case tnFlashTimes = -2 && STOP lnFlags = lnFlags + FLASHW_STOP case tnFlashTimes = -1 && START until Stop lnFlags = lnFlags + FLASHW_TIMER case tnFlashTimes = 0 && Start until Activate lnFlags = lnFlags + FLASHW_TIMERNOFG && NOFG => NoForeground other lnTimes = tnFlashTimes endcase pfwi = Num2dword(FLASHWINFO_STRU_SIZE) +; Num2dword(hWindow) +; Num2dword(lnFlags) +; Num2dword(lnTimes) +; Num2dword(lnInterval) = FlashWindowEx (@pfwi) clear dlls FlashWindowEx return .T. *-- eop FlashWindowEx *while Num2DWord is #DEFINE Byte1 1 && 2^ 0 #DEFINE Byte2 256 && 2^ 8 #DEFINE Byte3 65536 && 2^16 #DEFINE Byte4 16777216 && 2^24 *========================================================= * * PROCEDURE: Num2DWord * *========================================================= PROCEDURE Num2DWord * Created...........: 25.September 2004, 18:12 Uhr * Changed...........: * Description.......: Umwandlung eines numerischen Wertes in ein DWord (string). * Liefert das gleiche Ergebnis wie Long2String * Calling Samples...: ? Num2DWord(<ExpN>) * Parameters........: tnValue * Returns...........: String (dWord) = String with a length of four bytes lparameters tnValue LOCAL b0, b1, b2, b3 b3 = Int(tnValue / Byte4) b2 = Int((tnValue - b3*Byte4) / Byte3) b1 = Int((tnValue - b3*Byte4 - b2*Byte3) / Byte2) *-- Konsequenterweise müßte die letzte Zeile heißen: *-- b0 = int((tnValue - b3*Byte4 - b2*Byte3 - b1*Byte2) / Byte1) *-- Byte1 ist aber 1, daher die Division überflüssig *-- der Ausdruck in Mod() entspricht dem Klammerausdruck oben b0 = Mod(tnValue, Byte2) RETURN Chr(b0)+Chr(b1)+Chr(b2)+Chr(b3) *-- eop Num2DWord