/[winpt]/trunk/Src/wptTrayPop.cpp
ViewVC logotype

Diff of /trunk/Src/wptTrayPop.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 22 by twoaday, Mon Jan 31 11:02:21 2005 UTC revision 23 by twoaday, Fri Sep 30 10:10:16 2005 UTC
# Line 30  Line 30 
30    
31  #include <windows.h>  #include <windows.h>
32    
33    #include "wptW32API.h"
34    
35  #define PD_WINDOWNAME "ClsTrayPop"  #define PD_WINDOWNAME "ClsTrayPop"
36  #define PD_TIMER_IDENTIFIER 23  #define PD_TIMER_IDENTIFIER 23
37  #define PD_TIMER_TIMEOUT 1500  #define PD_TIMER_TIMEOUT 1500
# Line 173  init_wclass (WNDCLASS *p_wclass, HINSTAN Line 175  init_wclass (WNDCLASS *p_wclass, HINSTAN
175  } /* init_wclass */  } /* init_wclass */
176    
177    
178    /* Show the given message in a pop-up window for millis miliseconds. */
179  int  int
180  show_msg (HWND hParentWnd, int millis, LPCTSTR string)  show_msg (HWND hParentWnd, int millis, LPCTSTR string)
181  {      {    
# Line 206  show_msg (HWND hParentWnd, int millis, L Line 209  show_msg (HWND hParentWnd, int millis, L
209      if (hWnd == NULL)      if (hWnd == NULL)
210          return 0;          return 0;
211      else {      else {
212          ShowWindow(hWnd, SW_SHOW);          ShowWindow (hWnd, SW_SHOW);
213          UpdateWindow(hWnd);          UpdateWindow (hWnd);
214          // ensure parent never loses focus          // ensure parent never loses focus
215          EnableWindow(hParentWnd, TRUE);          EnableWindow (hParentWnd, TRUE);
216          SetActiveWindow(NULL);          center_window (hWnd, hParentWnd);
217            SetActiveWindow (NULL);
218      }      }
219            
220      timer = SetTimer(      timer = SetTimer (hWnd, // handle to window
221          hWnd, // handle to window                        PD_TIMER_IDENTIFIER, // timer identifier
222          PD_TIMER_IDENTIFIER, // timer identifier                        millis, // time-out value
223          millis, // time-out value                        (TIMERPROC) popup_timer_proc // timer procedure  
224          (TIMERPROC) popup_timer_proc // timer procedure                        );
225          );      
226            while (GetMessage (&msg, NULL, 0, 0)) {
227      while( GetMessage(&msg, NULL, 0, 0) ) {          TranslateMessage (&msg);
228          TranslateMessage(&msg);          DispatchMessage (&msg);
         DispatchMessage(&msg);    
229      }      }
230            
231      return msg.wParam;      return msg.wParam;
232  } /* show_alert */  }

Legend:
Removed from v.22  
changed lines
  Added in v.23

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26