/[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 23 by twoaday, Fri Sep 30 10:10:16 2005 UTC revision 24 by twoaday, Sat Oct 8 10:43:08 2005 UTC
# Line 32  Line 32 
32    
33  #include "wptW32API.h"  #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
38    
39  #define PD_TRAYPOP_WIDTH 200  /* XXX: use the given text to figure out these params. */
40  #define PD_TRAYPOP_HEIGHT 80  #define PD_TRAYPOP_WIDTH        250
41    #define PD_TRAYPOP_HEIGHT       80
42    
43  extern HINSTANCE glob_hinst;  extern HINSTANCE glob_hinst;
44  extern HWND glob_hwnd;  extern HWND glob_hwnd;
45    
46    
47  static LPCTSTR  static LPCTSTR
48  store_text( LPCTSTR alert_text )  store_text (LPCTSTR alert_text)
49  {  {
50      static LPCTSTR text;      static LPCTSTR text;
51    
52      if( alert_text )      if (alert_text)
53          text = alert_text;          text = alert_text;
54      return text;      return text;
55  } /* store_text */  } /* store_text */
# Line 200  show_msg (HWND hParentWnd, int millis, L Line 201  show_msg (HWND hParentWnd, int millis, L
201          WS_POPUP, // window style          WS_POPUP, // window style
202          (parent.right + parent.left) / 2, (parent.bottom + parent.top) / 2,          (parent.right + parent.left) / 2, (parent.bottom + parent.top) / 2,
203          nWndWidth - 2, nWndHeight - 2, // width and height, with corrections          nWndWidth - 2, nWndHeight - 2, // width and height, with corrections
204          NULL, // parent handle          NULL, NULL, glob_hinst, NULL);
205          NULL, // menu handle          
         glob_hinst, // instance handle  
         NULL // other parameters  
         );                          
206            
207      if (hWnd == NULL)      if (hWnd == NULL)
208          return 0;          return 0;
209      else {      else {
210          ShowWindow (hWnd, SW_SHOW);          ShowWindow (hWnd, SW_SHOW);
211          UpdateWindow (hWnd);          UpdateWindow (hWnd);
# Line 217  show_msg (HWND hParentWnd, int millis, L Line 215  show_msg (HWND hParentWnd, int millis, L
215          SetActiveWindow (NULL);          SetActiveWindow (NULL);
216      }      }
217            
218      timer = SetTimer (hWnd, // handle to window      timer = SetTimer (hWnd, PD_TIMER_IDENTIFIER, millis,
219                        PD_TIMER_IDENTIFIER, // timer identifier                        (TIMERPROC) popup_timer_proc);
                       millis, // time-out value  
                       (TIMERPROC) popup_timer_proc // timer procedure    
                       );  
220            
221      while (GetMessage (&msg, NULL, 0, 0)) {      while (GetMessage (&msg, NULL, 0, 0)) {
222          TranslateMessage (&msg);          TranslateMessage (&msg);

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26