/[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 25 by twoaday, Wed Oct 12 10:04:26 2005 UTC
# Line 19  Line 19 
19   * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA   * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20   *   *
21   */   */
   
 /*  
  * ChangeLog  
  * Maybe I didn't understand how to use the code, but the original code  
  * always produces a window near the taskbar icon. This is not very useful  
  * because we need it near the dialog. I also removed some code we don't use.  
  * -ts  
  */  
   
22  #include <windows.h>  #include <windows.h>
23    
24  #include "wptW32API.h"  #include "wptW32API.h"
25    
26  #define PD_WINDOWNAME "ClsTrayPop"  #define PD_WINDOWNAME           "ClsTrayPop"
27  #define PD_TIMER_IDENTIFIER 23  #define PD_TIMER_IDENTIFIER     23
28  #define PD_TIMER_TIMEOUT 1500  #define PD_TIMER_TIMEOUT        1500
29    
30  #define PD_TRAYPOP_WIDTH 200  /* XXX: use the given text to figure out these params. */
31  #define PD_TRAYPOP_HEIGHT 80  #define PD_TRAYPOP_WIDTH        250
32    #define PD_TRAYPOP_HEIGHT       80
33    
34  extern HINSTANCE glob_hinst;  extern HINSTANCE glob_hinst;
35  extern HWND glob_hwnd;  extern HWND glob_hwnd;
36    
37    
38  static LPCTSTR  static LPCTSTR
39  store_text( LPCTSTR alert_text )  store_text (LPCTSTR alert_text)
40  {  {
41      static LPCTSTR text;      static LPCTSTR text;
42    
43      if( alert_text )      if (alert_text)
44          text = alert_text;          text = alert_text;
45      return text;      return text;
46  } /* store_text */  } /* store_text */
# Line 200  show_msg (HWND hParentWnd, int millis, L Line 192  show_msg (HWND hParentWnd, int millis, L
192          WS_POPUP, // window style          WS_POPUP, // window style
193          (parent.right + parent.left) / 2, (parent.bottom + parent.top) / 2,          (parent.right + parent.left) / 2, (parent.bottom + parent.top) / 2,
194          nWndWidth - 2, nWndHeight - 2, // width and height, with corrections          nWndWidth - 2, nWndHeight - 2, // width and height, with corrections
195          NULL, // parent handle          NULL, NULL, glob_hinst, NULL);
196          NULL, // menu handle          
         glob_hinst, // instance handle  
         NULL // other parameters  
         );                          
197            
198      if (hWnd == NULL)      if (hWnd == NULL)
199          return 0;          return 0;
200      else {      else {
201          ShowWindow (hWnd, SW_SHOW);          ShowWindow (hWnd, SW_SHOW);
202          UpdateWindow (hWnd);          UpdateWindow (hWnd);
# Line 217  show_msg (HWND hParentWnd, int millis, L Line 206  show_msg (HWND hParentWnd, int millis, L
206          SetActiveWindow (NULL);          SetActiveWindow (NULL);
207      }      }
208            
209      timer = SetTimer (hWnd, // handle to window      timer = SetTimer (hWnd, PD_TIMER_IDENTIFIER, millis,
210                        PD_TIMER_IDENTIFIER, // timer identifier                        (TIMERPROC) popup_timer_proc);
                       millis, // time-out value  
                       (TIMERPROC) popup_timer_proc // timer procedure    
                       );  
211            
212      while (GetMessage (&msg, NULL, 0, 0)) {      while (GetMessage (&msg, NULL, 0, 0)) {
213          TranslateMessage (&msg);          TranslateMessage (&msg);

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26