Question : Pattern for tray application

Hi,

I want to create app that staying in tray and sometimes do some work, and send results to service.
I wonder is there any pattern for that app. For now i scratch basics in console project, so i dont have a windows application framework, dont have message loop.

Should i make all actions (i.e sending to service, do some work) via message procedure? or like console style app. When and for what i should use windows messages procedure.

Making tray is no problem i could search for it. But in question i mean whole app structure, communication and so on.

Answer : Pattern for tray application

Missing bracket and other things.

Here is a better version
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
<html>
   <head>
 
<script language="javascript">

var gAutoPrint = true;

function processPrint() {
  if (document.getElementById != null) {
    var html = '<HTML>\n<HEAD>\n';
    if (document.getElementsByTagName != null) {
      var headTags = document.getElementsByTagName("head");
      if (headTags.length > 0) html += headTags[0].innerHTML;
    }
    html += '\n</HE' + 'AD>\n<BODY '+((gAutoPrint)?'onLoad="window.print()"':'')+'>\n';
    var elems = document.getElementsByTagName("div");
    var divContent = "";
    for (var i=0;i<elems.length;i++) {
      if (elems[i].className=="printMe") divContent += elems[i].innerHTML+'<br />';
    }
    if (divContent!="") {
      html += divContent;
      html += '\n</BO' + 'DY>\n</HT' + 'ML>';
      var printWin = window.open("","processPrint");
      printWin.document.write(html);
      printWin.document.close();
    }
    else alert("Error, no contents.");
    return false;
  }
}

</script>


      
      
   </head>
   <body>
    
      <div class="printMe" > This is the content for printMe </div>
       <div class="printMe" > This is the other content for printMe on the same page </div>
<a href="#" onClick="return processPrint();">Print</a> 
   </body>
</html>
Random Solutions  
 
programming4us programming4us