FrontierWinMain.c

Go to the documentation of this file.
00001 
00002 /*  $Id: FrontierWinMain.c 1328 2006-04-24 20:02:59Z sethdill $    */
00003 
00004 /******************************************************************************
00005 
00006     UserLand Frontier(tm) -- High performance Web content management,
00007     object database, system-level and Internet scripting environment,
00008     including source code editing and debugging.
00009 
00010     Copyright (C) 1992-2004 UserLand Software, Inc.
00011 
00012     This program is free software; you can redistribute it and/or modify
00013     it under the terms of the GNU General Public License as published by
00014     the Free Software Foundation; either version 2 of the License, or
00015     (at your option) any later version.
00016 
00017     This program is distributed in the hope that it will be useful,
00018     but WITHOUT ANY WARRANTY; without even the implied warranty of
00019     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020     GNU General Public License for more details.
00021 
00022     You should have received a copy of the GNU General Public License
00023     along with this program; if not, write to the Free Software
00024     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025 
00026 ******************************************************************************/
00027 
00028 #include "frontier.h"
00029 #include "standard.h"
00030 
00031 #ifdef PIKE
00032     #define _WIN32_IE 0x0500
00033 #endif
00034 
00035 #include "WinLand.h"
00036 #include "dialogs.h"
00037 #include "file.h"
00038 #include "font.h"
00039 #include "kb.h"
00040 #include "menu.h"
00041 #include "mouse.h"
00042 #include "quickdraw.h"
00043 #include "scrap.h"
00044 #include "strings.h"
00045 #include "frontierwindows.h"
00046 #include "cancoon.h"
00047 #include "cancooninternal.h"
00048 #include "shell.h"
00049 #include "shellprivate.h"
00050 #include "shellmenu.h"
00051 #include "lang.h"
00052 #include "launch.h"
00053 #include "frontierstart.h"
00054 #include "WinSockNetEvents.h"
00055 #include "FrontierWinMain.h"
00056 #include "winregistry.h"
00057 #include "langdll.h"
00058 #include "htmlcontrol.h"  /*8/26/00 by RAB*/
00059 #include "langinternal.h" /*7.0b31 PBS*/
00060 #include "tablestructure.h" /*7.0b31 PBS*/
00061 #include "dockmenu.h"
00062 
00063 extern typrocessid langipcself;
00064 
00065 HINSTANCE shellinstance;
00066 HINSTANCE hInst;
00067 static boolean flinstanceinitialized = false; //5.1.5b7 dmb
00068 
00069 HWND shellframewindow;
00070 HWND hwndMDIClient= NULL;
00071 HWND hwndActive;
00072 HWND hwndStatus = NULL;
00073 HWND hwndHTMLControl = NULL;
00074 long gstatuswindowparts = 1;
00075 long gstatuswindowarray[50] = {0};
00076 HICON hIconApp;
00077 
00078 //#ifdef PIKE
00079     HICON hTrayIconApp;
00080     #define FWM_SYSTRAYICON WM_USER + 19
00081 //#endif
00082 
00083 HANDLE hAccel;
00084 static HWND hwndNextViewer = (HWND) -1;
00085 
00086 LONG styleDefault = WS_OVERLAPPEDWINDOW;    //WS_MAXIMIZE; /* Default style bits for child windows  */
00087 
00088 LONG CALLBACK FrontierOPWndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
00089 LONG CALLBACK FrontierFrameWndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
00090 
00091 #ifdef PIKE
00092 
00093 #ifndef OPMLEDITOR
00094 CHAR szFrame[] = "pikeframe";   /* Class name for "frame" window */
00095 
00096 CHAR szChild1[] = "pikeopchild";   /* Class name for op MDI window     */
00097 CHAR szChildFTop[] = "pikeoutlinechild";
00098 CHAR szChildFTwp[] = "pikewpchild";
00099 CHAR szChildFTtb[] = "piketablechild";
00100 CHAR szChildFTmb[] = "pikemenuchild";
00101 CHAR szChildFTsc[] = "pikescriptchild";
00102 CHAR szChildRoot[] = "pikerootchild";
00103 
00104 CHAR szChildHTML[] = "pikeHTMLchild";
00105 
00106 CHAR sz_frontierstartreplace [] = "PikeStartReplace";
00107 CHAR sz_frontierstartsearch [] = "PikeStartSearch";
00108 
00109 #else  // OPMLEDITOR
00110 CHAR szFrame[] = "opmlframe";   /* Class name for "frame" window */
00111 
00112 CHAR szChild1[] = "opmlopchild";   /* Class name for op MDI window     */
00113 CHAR szChildFTop[] = "opmloutlinechild";
00114 CHAR szChildFTwp[] = "opmlwpchild";
00115 CHAR szChildFTtb[] = "opmltablechild";
00116 CHAR szChildFTmb[] = "opmlmenuchild";
00117 CHAR szChildFTsc[] = "opmlscriptchild";
00118 CHAR szChildRoot[] = "opmlerootchild";
00119 
00120 CHAR szChildHTML[] = "opmlHTMLchild";
00121 
00122 CHAR sz_frontierstartreplace [] = "OpmlStartReplace";
00123 CHAR sz_frontierstartsearch [] = "OpmlStartSearch";
00124 #endif // OPMLEDITOR
00125 
00126 #else   // !PIKE
00127 CHAR szFrame[] = "frontierframe";   /* Class name for "frame" window */
00128 
00129 CHAR szChild1[] = "frontieropchild";   /* Class name for op MDI window     */
00130 CHAR szChildFTop[] = "frontieroutlinechild";
00131 CHAR szChildFTwp[] = "frontierwpchild";
00132 CHAR szChildFTtb[] = "frontiertablechild";
00133 CHAR szChildFTmb[] = "frontiermenuchild";
00134 CHAR szChildFTsc[] = "frontierscriptchild";
00135 CHAR szChildRoot[] = "frontierrootchild";
00136 
00137 CHAR szChildHTML[] = "frontierHTMLchild";
00138 
00139 CHAR sz_frontierstartreplace [] = "FrontierStartReplace";
00140 CHAR sz_frontierstartsearch [] = "FrontierStartSearch";
00141 #endif  // !PIKE
00142 
00143 UINT wm_startreplace;
00144 UINT wm_startsearch;
00145 
00146 CHAR *pCmdLine;
00147 
00148 static UINT wm_frontieropenfile;
00149 static HANDLE frontiermutex;
00150 static UINT wm_findmsgstring;       /*Used for find/replace dialogs */
00151 
00152 //RAB: 1/20/98 this was 8 changed to 12 for status bar control window handle
00153 #define OPWindowExtraByteCount 12
00154 
00155 //-----------------------RABCC Message Tracking Code-----------------------------------------------
00156 // August 20, 1994
00157 // This code provides a logging of messages received by a window.  This is useful for tracking 
00158 // re-entrency bugs.
00159 //
00160 // 
00161 #define MESSAGETRACKSYSTEM 0
00162 
00163 #if (MESSAGETRACKSYSTEM == 1)
00164 #pragma message ("***************************************MESSAGETRACKING IS ON!!***************************************")
00165 FILE * errfile = NULL;
00166 #define MSGDEFAULT  3
00167 #define MSGOTHER    4
00168 
00169 
00170 UINT MESSAGESTACK[100];
00171 short MESSAGESTACKPTR = 0;
00172 
00173 void PUSHMESSAGE (UINT msg)
00174     {
00175     MESSAGESTACK[MESSAGESTACKPTR] = msg;
00176     ++MESSAGESTACKPTR;
00177     }
00178 
00179 UINT POPMESSAGE ()
00180     {
00181     --MESSAGESTACKPTR;
00182     return (MESSAGESTACK[MESSAGESTACKPTR]);
00183     }
00184 
00185 
00186 void GETMESSAGETEXT (UINT msg, char * msgname)
00187     {
00188     switch (msg)
00189         {
00190         case WM_NULL:
00191             strcpy (msgname, "WM_NULL");
00192             break;
00193 
00194         case WM_CREATE                       :   //001
00195             strcpy (msgname, "WM_CREATE");
00196             break;
00197 
00198         case WM_DESTROY                      :   //0x0002
00199             strcpy (msgname, "WM_DESTROY");
00200             break;
00201 
00202         case WM_MOVE                         :   //0x0003
00203             strcpy (msgname, "WM_MOVE");
00204             break;
00205 
00206         case WM_SIZE                         :   //0x0005
00207             strcpy (msgname, "WM_SIZE");
00208             break;
00209 
00210         case WM_ACTIVATE                     :   //0x0006
00211             strcpy (msgname, "WM_ACTIVATE");
00212             break;
00213 
00214         case WM_SETFOCUS                     :   //0x0007
00215             strcpy (msgname, "WM_SETFOCUS");
00216             break;
00217 
00218         case WM_KILLFOCUS                    :   //0x0008
00219             strcpy (msgname, "WM_KILLFOCUS");
00220             break;
00221 
00222         case WM_ENABLE                       :   //0x000A
00223             strcpy (msgname, "WM_ENABLE");
00224             break;
00225 
00226         case WM_SETREDRAW                    :   //0x000B
00227             strcpy (msgname, "WM_SETREDRAW");
00228             break;
00229 
00230         case WM_SETTEXT                      :   //0x000C
00231             strcpy (msgname, "WM_SETTEXT");
00232             break;
00233 
00234         case WM_GETTEXT                      :   //0x000D
00235             strcpy (msgname, "WM_GETTEXT");
00236             break;
00237 
00238         case WM_GETTEXTLENGTH                :   //0x000E
00239             strcpy (msgname, "WM_GETTEXTLENGTH");
00240             break;
00241 
00242         case WM_PAINT                        :   //0x000F
00243             strcpy (msgname, "WM_PAINT");
00244             break;
00245 
00246         case WM_CLOSE                        :   //0x0010
00247             strcpy (msgname, "WM_CLOSE");
00248             break;
00249 
00250         case WM_QUERYENDSESSION              :   //0x0011
00251             strcpy (msgname, "WM_QUERYENDSESSION");
00252             break;
00253 
00254         case WM_QUIT                         :   //0x0012
00255             strcpy (msgname, "WM_QUIT");
00256             break;
00257 
00258         case WM_QUERYOPEN                    :   //0x0013
00259             strcpy (msgname, "WM_QUERYOPEN");
00260             break;
00261 
00262         case WM_ERASEBKGND                   :   //0x0014
00263             strcpy (msgname, "WM_ERASEBKGND");
00264             break;
00265 
00266         case WM_SYSCOLORCHANGE               :   //0x0015
00267             strcpy (msgname, "WM_SYSCOLORCHANGE");
00268             break;
00269 
00270         case WM_ENDSESSION                   :   //0x0016
00271             strcpy (msgname, "WM_ENDSESSION");
00272             break;
00273 
00274         case WM_SHOWWINDOW                   :   //0x0018
00275             strcpy (msgname, "WM_SHOWWINDOW");
00276             break;
00277 
00278         case WM_WININICHANGE                 :   //0x001A
00279             strcpy (msgname, "WM_WININICHANGE");
00280             break;
00281 
00282         case WM_DEVMODECHANGE                :   //0x001B
00283             strcpy (msgname, "WM_DEVMODECHANGE");
00284             break;
00285 
00286         case WM_ACTIVATEAPP                  :   //0x001C
00287             strcpy (msgname, "WM_ACTIVATEAPP");
00288             break;
00289 
00290         case WM_FONTCHANGE                   :   //0x001D
00291             strcpy (msgname, "WM_FONTCHANGE");
00292             break;
00293 
00294         case WM_TIMECHANGE                   :   //0x001E
00295             strcpy (msgname, "WM_TIMECHANGE");
00296             break;
00297 
00298         case WM_CANCELMODE                   :   //0x001F
00299             strcpy (msgname, "WM_CANCELMODE");
00300             break;
00301 
00302         case WM_SETCURSOR                    :   //0x0020
00303             strcpy (msgname, "WM_SETCURSOR");
00304             break;
00305 
00306         case WM_MOUSEACTIVATE                :   //0x0021
00307             strcpy (msgname, "WM_MOUSEACTIVATE");
00308             break;
00309 
00310         case WM_CHILDACTIVATE                :   //0x0022
00311             strcpy (msgname, "WM_CHILDACTIVATE");
00312             break;
00313 
00314         case WM_QUEUESYNC                    :   //0x0023
00315             strcpy (msgname, "WM_QUEUESYNC");
00316             break;
00317 
00318 
00319         case WM_GETMINMAXINFO                :   //0x0024
00320             strcpy (msgname, "WM_GETMINMAXINFO");
00321             break;
00322 
00323         case WM_PAINTICON                    :   //0x0026
00324             strcpy (msgname, "WM_PAINTICON");
00325             break;
00326 
00327         case WM_ICONERASEBKGND               :   //0x0027
00328             strcpy (msgname, "WM_ICONERASEBKGND");
00329             break;
00330 
00331         case WM_NEXTDLGCTL                   :   //0x0028
00332             strcpy (msgname, "WM_NEXTDLGCTL");
00333             break;
00334 
00335         case WM_SPOOLERSTATUS                :   //0x002A
00336             strcpy (msgname, "WM_SPOOLERSTATUS");
00337             break;
00338 
00339         case WM_DRAWITEM                     :   //0x002B
00340             strcpy (msgname, "WM_DRAWITEM");
00341             break;
00342 
00343         case WM_MEASUREITEM                  :   //0x002C
00344             strcpy (msgname, "WM_MEASUREITEM");
00345             break;
00346 
00347         case WM_DELETEITEM                   :   //0x002D
00348             strcpy (msgname, "WM_DELETEITEM");
00349             break;
00350 
00351         case WM_VKEYTOITEM                   :   //0x002E
00352             strcpy (msgname, "WM_VKEYTOITEM");
00353             break;
00354 
00355         case WM_CHARTOITEM                   :   //0x002F
00356             strcpy (msgname, "WM_CHARTOITEM");
00357             break;
00358 
00359         case WM_SETFONT                      :   //0x0030
00360             strcpy (msgname, "WM_SETFONT");
00361             break;
00362 
00363         case WM_GETFONT                      :   //0x0031
00364             strcpy (msgname, "WM_GETFONT");
00365             break;
00366 
00367         case WM_SETHOTKEY                    :   //0x0032
00368             strcpy (msgname, "WM_SETHOTKEY");
00369             break;
00370 
00371         case WM_GETHOTKEY                    :   //0x0033
00372             strcpy (msgname, "WM_GETHOTKEY");
00373             break;
00374 
00375         case WM_QUERYDRAGICON                :   //0x0037
00376             strcpy (msgname, "WM_QUERYDRAGICON");
00377             break;
00378 
00379         case WM_COMPAREITEM                  :   //0x0039
00380             strcpy (msgname, "WM_COMPAREITEM");
00381             break;
00382 
00383         case WM_COMPACTING                   :   //0x0041
00384             strcpy (msgname, "WM_COMPACTING");
00385             break;
00386 
00387         case WM_COMMNOTIFY                   :   //0x0044  /* no longer suported */
00388             strcpy (msgname, "WM_COMMNOTIFY");
00389             break;
00390 
00391         case WM_WINDOWPOSCHANGING            :   //0x0046
00392             strcpy (msgname, "WM_WINDOWPOSCHANGING");
00393             break;
00394 
00395         case WM_WINDOWPOSCHANGED             :   //0x0047
00396             strcpy (msgname, "WM_WINDOWPOSCHANGED");
00397             break;
00398 
00399         case WM_POWER                        :   //0x0048
00400             strcpy (msgname, "WM_POWER");
00401             break;
00402 
00403         case WM_COPYDATA                     :   //0x004A
00404             strcpy (msgname, "WM_COPYDATA");
00405             break;
00406 
00407         case WM_CANCELJOURNAL                :   //0x004B
00408             strcpy (msgname, "WM_CANCELJOURNAL");
00409             break;
00410 
00411         case WM_NOTIFY                       :   //0x004E
00412             strcpy (msgname, "WM_NOTIFY");
00413             break;
00414 
00415         case WM_INPUTLANGCHANGEREQUEST       :   //0x0050
00416             strcpy (msgname, "WM_INPUTLANGCHANGEREQUEST");
00417             break;
00418 
00419         case WM_INPUTLANGCHANGE              :   //0x0051
00420             strcpy (msgname, "WM_INPUTLANGCHANGE");
00421             break;
00422 
00423         case WM_TCARD                        :   //0x0052
00424             strcpy (msgname, "WM_TCARD");
00425             break;
00426 
00427         case WM_HELP                         :   //0x0053
00428             strcpy (msgname, "WM_HELP");
00429             break;
00430 
00431         case WM_USERCHANGED                  :   //0x0054
00432             strcpy (msgname, "WM_USERCHANGED");
00433             break;
00434 
00435         case WM_NOTIFYFORMAT                 :   //0x0055
00436             strcpy (msgname, "WM_NOTIFYFORMAT");
00437             break;
00438 
00439         case WM_CONTEXTMENU                  :   //0x007B
00440             strcpy (msgname, "WM_CONTEXTMENU");
00441             break;
00442 
00443         case WM_STYLECHANGING                :   //0x007C
00444             strcpy (msgname, "WM_STYLECHANGING");
00445             break;
00446 
00447         case WM_STYLECHANGED                 :   //0x007D
00448             strcpy (msgname, "WM_STYLECHANGED");
00449             break;
00450 
00451         case WM_DISPLAYCHANGE                :   //0x007E
00452             strcpy (msgname, "WM_DISPLAYCHANGE");
00453             break;
00454 
00455         case WM_GETICON                      :   //0x007F
00456             strcpy (msgname, "WM_GETICON");
00457             break;
00458 
00459         case WM_SETICON                      :   //0x0080
00460             strcpy (msgname, "WM_SETICON");
00461             break;
00462 
00463         case WM_NCCREATE                     :   //0x0081
00464             strcpy (msgname, "WM_NCCREATE");
00465             break;
00466 
00467         case WM_NCDESTROY                    :   //0x0082
00468             strcpy (msgname, "WM_NCDESTROY");
00469             break;
00470 
00471         case WM_NCCALCSIZE                   :   //0x0083
00472             strcpy (msgname, "WM_NCCALCSIZE");
00473             break;
00474 
00475         case WM_NCHITTEST                    :   //0x0084
00476             strcpy (msgname, "WM_NCHITTEST");
00477             break;
00478 
00479         case WM_NCPAINT                      :   //0x0085
00480             strcpy (msgname, "WM_NCPAINT");
00481             break;
00482 
00483         case WM_NCACTIVATE                   :   //0x0086
00484             strcpy (msgname, "WM_NCACTIVATE");
00485             break;
00486 
00487         case WM_GETDLGCODE                   :   //0x0087
00488             strcpy (msgname, "WM_GETDLGCODE");
00489             break;
00490 
00491         case WM_NCMOUSEMOVE                  :   //0x00A0
00492             strcpy (msgname, "WM_NCMOUSEMOVE");
00493             break;
00494 
00495         case WM_NCLBUTTONDOWN                :   //0x00A1
00496             strcpy (msgname, "WM_NCLBUTTONDOWN");
00497             break;
00498 
00499         case WM_NCLBUTTONUP                  :   //0x00A2
00500             strcpy (msgname, "WM_NCLBUTTONUP");
00501             break;
00502 
00503         case WM_NCLBUTTONDBLCLK              :   //0x00A3
00504             strcpy (msgname, "WM_NCLBUTTONDBLCLK");
00505             break;
00506 
00507         case WM_NCRBUTTONDOWN                :   //0x00A4
00508             strcpy (msgname, "WM_NCRBUTTONDOWN");
00509             break;
00510 
00511         case WM_NCRBUTTONUP                  :   //0x00A5
00512             strcpy (msgname, "WM_NCRBUTTONUP");
00513             break;
00514 
00515         case WM_NCRBUTTONDBLCLK              :   //0x00A6
00516             strcpy (msgname, "WM_NCRBUTTONDBLCLK");
00517             break;
00518 
00519         case WM_NCMBUTTONDOWN                :   //0x00A7
00520             strcpy (msgname, "WM_NCMBUTTONDOWN");
00521             break;
00522 
00523         case WM_NCMBUTTONUP                  :   //0x00A8
00524             strcpy (msgname, "WM_NCMBUTTONUP");
00525             break;
00526 
00527         case WM_NCMBUTTONDBLCLK              :   //0x00A9
00528             strcpy (msgname, "WM_NCMBUTTONDBLCLK");
00529             break;
00530 
00531         case WM_KEYDOWN                      :   //0x0100
00532             strcpy (msgname, "WM_KEYDOWN");
00533             break;
00534 
00535         case WM_KEYUP                        :   //0x0101
00536             strcpy (msgname, "WM_KEYUP");
00537             break;
00538 
00539         case WM_CHAR                         :   //0x0102
00540             strcpy (msgname, "WM_CHAR");
00541             break;
00542 
00543         case WM_DEADCHAR                     :   //0x0103
00544             strcpy (msgname, "WM_DEADCHAR");
00545             break;
00546 
00547         case WM_SYSKEYDOWN                   :   //0x0104
00548             strcpy (msgname, "WM_SYSKEYDOWN");
00549             break;
00550 
00551         case WM_SYSKEYUP                     :   //0x0105
00552             strcpy (msgname, "WM_SYSKEYUP");
00553             break;
00554 
00555         case WM_SYSCHAR                      :   //0x0106
00556             strcpy (msgname, "WM_SYSCHAR");
00557             break;
00558 
00559         case WM_SYSDEADCHAR                  :   //0x0107
00560             strcpy (msgname, "WM_SYSDEADCHAR");
00561             break;
00562 
00563         case WM_KEYLAST                      :   //0x0108
00564             strcpy (msgname, "WM_KEYLAST");
00565             break;
00566 
00567         case WM_IME_STARTCOMPOSITION         :   //0x010D
00568             strcpy (msgname, "WM_IME_STARTCOMPOSITION");
00569             break;
00570 
00571         case WM_IME_ENDCOMPOSITION           :   //0x010E
00572             strcpy (msgname, "WM_IME_ENDCOMPOSITION");
00573             break;
00574 
00575         case WM_IME_COMPOSITION              :   //0x010F
00576             strcpy (msgname, "WM_IME_COMPOSITION");
00577             break;
00578 
00579         case WM_INITDIALOG                   :   //0x0110
00580             strcpy (msgname, "WM_INITDIALOG");
00581             break;
00582 
00583         case WM_COMMAND                      :   //0x0111
00584             strcpy (msgname, "WM_COMMAND");
00585             break;
00586 
00587         case WM_SYSCOMMAND                   :   //0x0112
00588             strcpy (msgname, "WM_SYSCOMMAND");
00589             break;
00590 
00591         case WM_TIMER                        :   //0x0113
00592             strcpy (msgname, "WM_TIMER");
00593             break;
00594 
00595         case WM_HSCROLL                      :   //0x0114
00596             strcpy (msgname, "WM_HSCROLL");
00597             break;
00598 
00599         case WM_VSCROLL                      :   //0x0115
00600             strcpy (msgname, "WM_VSCROLL");
00601             break;
00602 
00603         case WM_INITMENU                     :   //0x0116
00604             strcpy (msgname, "WM_INITMENU");
00605             break;
00606 
00607         case WM_INITMENUPOPUP                :   //0x0117
00608             strcpy (msgname, "WM_INITMENUPOPUP");
00609             break;
00610 
00611         case WM_MENUSELECT                   :   //0x011F
00612             strcpy (msgname, "WM_MENUSELECT");
00613             break;
00614 
00615         case WM_MENUCHAR                     :   //0x0120
00616             strcpy (msgname, "WM_MENUCHAR");
00617             break;
00618 
00619         case WM_ENTERIDLE                    :   //0x0121
00620             strcpy (msgname, "WM_ENTERIDLE");
00621             break;
00622 
00623 
00624         case WM_CTLCOLORMSGBOX               :   //0x0132
00625             strcpy (msgname, "WM_CTLCOLORMSGBOX");
00626             break;
00627 
00628         case WM_CTLCOLOREDIT                 :   //0x0133
00629             strcpy (msgname, "WM_CTLCOLOREDIT");
00630             break;
00631 
00632         case WM_CTLCOLORLISTBOX              :   //0x0134
00633             strcpy (msgname, "WM_CTLCOLORLISTBOX");
00634             break;
00635 
00636         case WM_CTLCOLORBTN                  :   //0x0135
00637             strcpy (msgname, "WM_CTLCOLORBTN");
00638             break;
00639 
00640         case WM_CTLCOLORDLG                  :   //0x0136
00641             strcpy (msgname, "WM_CTLCOLORDLG");
00642             break;
00643 
00644         case WM_CTLCOLORSCROLLBAR            :   //0x0137
00645             strcpy (msgname, "WM_CTLCOLORSCROLLBAR");
00646             break;
00647 
00648         case WM_CTLCOLORSTATIC               :   //0x0138
00649             strcpy (msgname, "WM_CTLCOLORSTATIC");
00650             break;
00651 
00652         case WM_MOUSEMOVE                    :   //0x0200
00653             strcpy (msgname, "WM_MOUSEMOVE");
00654             break;
00655 
00656         case WM_LBUTTONDOWN                  :   //0x0201
00657             strcpy (msgname, "WM_LBUTTONDOWN");
00658             break;
00659 
00660         case WM_LBUTTONUP                    :   //0x0202
00661             strcpy (msgname, "WM_LBUTTONUP");
00662             break;
00663 
00664         case WM_LBUTTONDBLCLK                :   //0x0203
00665             strcpy (msgname, "WM_LBUTTONDBLCLK");
00666             break;
00667 
00668         case WM_RBUTTONDOWN                  :   //0x0204
00669             strcpy (msgname, "WM_RBUTTONDOWN");
00670             break;
00671 
00672         case WM_RBUTTONUP                    :   //0x0205
00673             strcpy (msgname, "WM_RBUTTONUP");
00674             break;
00675 
00676         case WM_RBUTTONDBLCLK                :   //0x0206
00677             strcpy (msgname, "WM_RBUTTONDBLCLK");
00678             break;
00679 
00680         case WM_MBUTTONDOWN                  :   //0x0207
00681             strcpy (msgname, "WM_MBUTTONDOWN");
00682             break;
00683 
00684         case WM_MBUTTONUP                    :   //0x0208
00685             strcpy (msgname, "WM_MBUTTONUP");
00686             break;
00687 
00688         case WM_MBUTTONDBLCLK                :   //0x0209
00689             strcpy (msgname, "WM_MBUTTONDBLCLK");
00690             break;
00691 
00692 //        case WM_MOUSEWHEEL                   :   //0x020A
00693 //          strcpy (msgname, "WM_MOUSEWHEEL");
00694 //          break;
00695 
00696         case WM_PARENTNOTIFY                 :   //0x0210
00697             strcpy (msgname, "WM_PARENTNOTIFY");
00698             break;
00699 
00700         case WM_ENTERMENULOOP                :   //0x0211
00701             strcpy (msgname, "WM_ENTERMENULOOP");
00702             break;
00703 
00704         case WM_EXITMENULOOP                 :   //0x0212
00705             strcpy (msgname, "WM_EXITMENULOOP");
00706             break;
00707 
00708         case WM_NEXTMENU                     :   //0x0213
00709             strcpy (msgname, "WM_NEXTMENU");
00710             break;
00711 
00712         case WM_SIZING                       :   //0x0214
00713             strcpy (msgname, "WM_SIZING");
00714             break;
00715 
00716         case WM_CAPTURECHANGED               :   //0x0215
00717             strcpy (msgname, "WM_CAPTURECHANGED");
00718             break;
00719 
00720         case WM_MOVING                       :   //0x0216
00721             strcpy (msgname, "WM_MOVING");
00722             break;
00723 
00724         case WM_POWERBROADCAST               :   //0x0218
00725             strcpy (msgname, "WM_POWERBROADCAST");
00726             break;
00727 
00728         case WM_DEVICECHANGE                 :   //0x0219
00729             strcpy (msgname, "WM_DEVICECHANGE");
00730             break;
00731 
00732 
00733         case WM_IME_SETCONTEXT               :   //0x0281
00734             strcpy (msgname, "WM_IME_SETCONTEXT");
00735             break;
00736 
00737         case WM_IME_NOTIFY                   :   //0x0282
00738             strcpy (msgname, "WM_IME_NOTIFY");
00739             break;
00740 
00741         case WM_IME_CONTROL                  :   //0x0283
00742             strcpy (msgname, "WM_IME_CONTROL");
00743             break;
00744 
00745         case WM_IME_COMPOSITIONFULL          :   //0x0284
00746             strcpy (msgname, "WM_IME_COMPOSITIONFULL");
00747             break;
00748 
00749         case WM_IME_SELECT                   :   //0x0285
00750             strcpy (msgname, "WM_IME_SELECT");
00751             break;
00752 
00753         case WM_IME_CHAR                     :   //0x0286
00754             strcpy (msgname, "WM_IME_CHAR");
00755             break;
00756 
00757         case WM_IME_KEYDOWN                  :   //0x0290
00758             strcpy (msgname, "WM_IME_KEYDOWN");
00759             break;
00760 
00761         case WM_IME_KEYUP                    :   //0x0291
00762             strcpy (msgname, "WM_IME_KEYUP");
00763             break;
00764 
00765         case WM_MDICREATE                    :   //0x0220
00766             strcpy (msgname, "WM_MDICREATE");
00767             break;
00768 
00769         case WM_MDIDESTROY                   :   //0x0221
00770             strcpy (msgname, "WM_MDIDESTROY");
00771             break;
00772 
00773         case WM_MDIACTIVATE                  :   //0x0222
00774             strcpy (msgname, "WM_MDIACTIVATE");
00775             break;
00776 
00777         case WM_MDIRESTORE                   :   //0x0223
00778             strcpy (msgname, "WM_MDIRESTORE");
00779             break;
00780 
00781         case WM_MDINEXT                      :   //0x0224
00782             strcpy (msgname, "WM_MDINEXT");
00783             break;
00784 
00785         case WM_MDIMAXIMIZE                  :   //0x0225
00786             strcpy (msgname, "WM_MDIMAXIMIZE");
00787             break;
00788 
00789         case WM_MDITILE                      :   //0x0226
00790             strcpy (msgname, "WM_MDITILE");
00791             break;
00792 
00793         case WM_MDICASCADE                   :   //0x0227
00794             strcpy (msgname, "WM_MDICASCADE");
00795             break;
00796 
00797         case WM_MDIICONARRANGE               :   //0x0228
00798             strcpy (msgname, "WM_MDIICONARRANGE");
00799             break;
00800 
00801         case WM_MDIGETACTIVE                 :   //0x0229
00802             strcpy (msgname, "WM_MDIGETACTIVE");
00803             break;
00804 
00805         case WM_MDISETMENU                   :   //0x0230
00806             strcpy (msgname, "WM_MDISETMENU");
00807             break;
00808 
00809         case WM_ENTERSIZEMOVE                :   //0x0231
00810             strcpy (msgname, "WM_ENTERSIZEMOVE");
00811             break;
00812 
00813         case WM_EXITSIZEMOVE                 :   //0x0232
00814             strcpy (msgname, "WM_EXITSIZEMOVE");
00815             break;
00816 
00817         case WM_DROPFILES                    :   //0x0233
00818             strcpy (msgname, "WM_DROPFILES");
00819             break;
00820 
00821         case WM_MDIREFRESHMENU               :   //0x0234
00822             strcpy (msgname, "WM_MDIREFRESHMENU");
00823             break;
00824 
00825 //        case WM_MOUSEHOVER                   :   //0x02A1
00826 //          strcpy (msgname, "WM_MOUSEHOVER");
00827 //          break;
00828 
00829 //        case WM_MOUSELEAVE                   :   //0x02A3
00830 //          strcpy (msgname, "WM_MOUSELEAVE");
00831 //          break;
00832 
00833         case WM_CUT                          :   //0x0300
00834             strcpy (msgname, "WM_CUT");
00835             break;
00836 
00837         case WM_COPY                         :   //0x0301
00838             strcpy (msgname, "WM_COPY");
00839             break;
00840 
00841         case WM_PASTE                        :   //0x0302
00842             strcpy (msgname, "WM_PASTE");
00843             break;
00844 
00845         case WM_CLEAR                        :   //0x0303
00846             strcpy (msgname, "WM_CLEAR");
00847             break;
00848 
00849         case WM_UNDO                         :   //0x0304
00850             strcpy (msgname, "WM_UNDO");
00851             break;
00852 
00853         case WM_RENDERFORMAT                 :   //0x0305
00854             strcpy (msgname, "WM_RENDERFORMAT");
00855             break;
00856 
00857         case WM_RENDERALLFORMATS             :   //0x0306
00858             strcpy (msgname, "WM_RENDERALLFORMATS");
00859             break;
00860 
00861         case WM_DESTROYCLIPBOARD             :   //0x0307
00862             strcpy (msgname, "WM_DESTROYCLIPBOARD");
00863             break;
00864 
00865         case WM_DRAWCLIPBOARD                :   //0x0308
00866             strcpy (msgname, "WM_DRAWCLIPBOARD");
00867             break;
00868 
00869         case WM_PAINTCLIPBOARD               :   //0x0309
00870             strcpy (msgname, "WM_PAINTCLIPBOARD");
00871             break;
00872 
00873         case WM_VSCROLLCLIPBOARD             :   //0x030A
00874             strcpy (msgname, "WM_VSCROLLCLIPBOARD");
00875             break;
00876 
00877         case WM_SIZECLIPBOARD                :   //0x030B
00878             strcpy (msgname, "WM_SIZECLIPBOARD");
00879             break;
00880 
00881         case WM_ASKCBFORMATNAME              :   //0x030C
00882             strcpy (msgname, "WM_ASKCBFORMATNAME");
00883             break;
00884 
00885         case WM_CHANGECBCHAIN                :   //0x030D
00886             strcpy (msgname, "WM_CHANGECBCHAIN");
00887             break;
00888 
00889         case WM_HSCROLLCLIPBOARD             :   //0x030E
00890             strcpy (msgname, "WM_HSCROLLCLIPBOARD");
00891             break;
00892 
00893         case WM_QUERYNEWPALETTE              :   //0x030F
00894             strcpy (msgname, "WM_QUERYNEWPALETTE");
00895             break;
00896 
00897         case WM_PALETTEISCHANGING            :   //0x0310
00898             strcpy (msgname, "WM_PALETTEISCHANGING");
00899             break;
00900 
00901         case WM_PALETTECHANGED               :   //0x0311
00902             strcpy (msgname, "WM_PALETTECHANGED");
00903             break;
00904 
00905         case WM_HOTKEY                       :   //0x0312
00906             strcpy (msgname, "WM_HOTKEY");
00907             break;
00908 
00909         case WM_PRINT                        :   //0x0317
00910             strcpy (msgname, "WM_PRINT");
00911             break;
00912 
00913         case WM_PRINTCLIENT                  :   //0x0318
00914             strcpy (msgname, "WM_PRINTCLIENT");
00915             break;
00916 
00917         case WM_HANDHELDFIRST                :   //0x0358
00918             strcpy (msgname, "WM_HANDHELDFIRST");
00919             break;
00920 
00921         case WM_HANDHELDLAST                 :   //0x035F
00922             strcpy (msgname, "WM_HANDHELDLAST");
00923             break;
00924 
00925         case WM_AFXFIRST                     :   //0x0360
00926             strcpy (msgname, "WM_AFXFIRST");
00927             break;
00928 
00929         case WM_AFXLAST                      :   //0x037F
00930             strcpy (msgname, "WM_AFXLAST");
00931             break;
00932 
00933         case WM_PENWINFIRST                  :   //0x0380
00934             strcpy (msgname, "WM_PENWINFIRST");
00935             break;
00936 
00937         case WM_PENWINLAST                   :   //0x038F
00938             strcpy (msgname, "WM_PENWINLAST");
00939             break;
00940 
00941         default:
00942             strcpy (msgname, "Unknown Message");
00943             break;
00944         }
00945     }
00946 
00947 
00948 void MESSAGEENDER (short x)
00949     {
00950     char msgname[100];
00951     char msgname2[100];
00952     UINT msg;
00953 
00954     switch (x)
00955         {
00956         case true:
00957             strcpy (msgname, "Exit Message:  TRUE");
00958             break;
00959 
00960         case false:
00961             strcpy (msgname, "Exit Message:  FALSE");
00962             break;
00963 
00964         case MSGDEFAULT:
00965             strcpy (msgname, "Exit Message:  Default");
00966             break;
00967 
00968         case MSGOTHER:
00969             strcpy (msgname, "Exit Message:  Other");
00970             break;
00971 
00972         default:
00973             strcpy (msgname, "Exit Message:  UNKNOWN");
00974             break;
00975         }
00976 
00977     msg = POPMESSAGE();
00978 
00979     GETMESSAGETEXT (msg, msgname2);
00980 
00981     fprintf (errfile, "%s\t%s\n", msgname, msgname2);
00982     }
00983 
00984 void MESSAGETRACKER (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
00985     char msgname[100];
00986 
00987     if (errfile == NULL)
00988         {
00989         errfile = fopen ("errfile.txt", "w+");
00990         }
00991 
00992     GETMESSAGETEXT (msg, msgname);
00993 
00994     fprintf (errfile, "Message: %-30s  (%ld)\t\t Window: %lX\twParam: %lX\tlParam: %lX\n",
00995                         msgname, msg, hwnd, wParam, lParam);
00996 
00997     PUSHMESSAGE (msg);
00998     }
00999 #else
01000 #define MESSAGETRACKER(a,b,c,d)
01001 #define MESSAGEENDER(x)
01002 #endif
01003 
01004 
01005 static boolean ccerrormessage (bigstring bs) {
01006     
01007     char s [256];
01008     short itemnumber;
01009 
01010     copyptocstring (bs, s);
01011 
01012     itemnumber = MessageBox (hwndMDIClient, s, "Error Info", MB_OK | MB_ICONEXCLAMATION | MB_APPLMODAL);
01013     
01014     return (true);
01015     } /*ccerrormessage*/
01016 
01017 
01018 static boolean shellpushcancoonglobals (void) {
01019     
01020     short ix;
01021     
01022     if (!shellfindcallbacks (idcancoonconfig, &ix))
01023         return (false);
01024     
01025     if (!shellpushglobals (nil)) /*save off old state*/
01026         return (false);
01027         
01028     shellglobals = globalsarray [ix];
01029     
01030     config = shellglobals.config;
01031     
01032     return (true);
01033     } /*shellpushcancoonglobals*/
01034     
01035 
01036 extern long getstatusbarheight () {
01037     /* 2005-01-30 SMD - made extern */
01038     RECT rectStatus;
01039 
01040     if (hwndStatus != NULL) {
01041         GetWindowRect(hwndStatus, &rectStatus);
01042 
01043         return (rectStatus.bottom - rectStatus.top);
01044         }
01045 
01046     return (0);
01047     } /*getstatusbarheight*/
01048 
01049 static long getstatusbarwidth () {
01050     RECT rectStatus;
01051 
01052     if (hwndStatus != NULL) {
01053         GetWindowRect(hwndStatus, &rectStatus);
01054 
01055         return (rectStatus.right - rectStatus.left);
01056         }
01057 
01058     return (0);
01059     } /*getstatusbarwidth*/
01060 
01061 static boolean setstatusbartext (char * szText, long partNumber) {
01062     if (hwndStatus != NULL) {
01063         return ((boolean) SendMessage(hwndStatus, SB_SETTEXT, (WPARAM) partNumber, (LPARAM) (LPSTR) szText));
01064         }
01065     return (false);
01066     } /*setstatusbartext*/
01067 
01068 boolean setstatusbarstring (bigstring bs, long partNumber) {
01069     boolean res;
01070 
01071     nullterminate (bs);
01072 
01073     releasethreadglobals();
01074 
01075     res = setstatusbartext (stringbaseaddress(bs), partNumber);
01076 
01077     grabthreadglobals();
01078 
01079     return (res);
01080     } /*setstatusbarstring*/
01081 
01082 
01083 boolean getstatusbarstring (bigstring bs, long partNumber) {
01084     boolean res;
01085     unsigned long longres;
01086 
01087     res = true;
01088 
01089     releasethreadglobals();
01090 
01091     if (hwndStatus != NULL) {
01092         longres = SendMessage(hwndStatus, SB_GETTEXT, (WPARAM) partNumber, (LPARAM) (LPSTR) stringbaseaddress(bs));
01093         }
01094 
01095     grabthreadglobals();
01096 
01097     setstringlength (bs, LOWORD(longres));
01098 
01099     return (res);
01100     } /*getstatusbarstring*/
01101 
01102 
01103 static boolean setDefinedStatusBarParts (long width) {
01104     int aWidths[50];
01105     int dec, i;
01106     int borders[4];
01107 
01108     if (hwndStatus != NULL) {
01109         SendMessage(hwndStatus, SB_GETBORDERS, 0, (LPARAM) borders);
01110 
01111 //      width = width - borders[1] - borders[1]; /*Account for vertical width*/
01112 
01113         aWidths[gstatuswindowparts-1] = -1;
01114         dec = gstatuswindowarray[gstatuswindowparts-1] + 13 + (borders[1]*2);
01115 
01116         for (i = gstatuswindowparts-2; i >= 0; i--) {
01117             aWidths[i] = width - dec;
01118             dec = dec + gstatuswindowarray[i];
01119             }
01120 
01121         return ((boolean)SendMessage (hwndStatus, SB_SETPARTS, (WPARAM) gstatuswindowparts, (LPARAM)aWidths));
01122         }
01123 
01124     return (false);
01125     }
01126 
01127 boolean setstatusbarparts (long count, long * array) {
01128     int i;
01129     boolean res;
01130 
01131     for (i = 0; i < count; i++) {
01132         gstatuswindowarray[i] = array[i];
01133         }
01134 
01135     gstatuswindowparts = count;
01136 
01137     releasethreadglobals();
01138 
01139     res = setDefinedStatusBarParts (getstatusbarwidth());
01140 
01141     grabthreadglobals();
01142 
01143     return (res);
01144     } /*setstatusbarparts*/
01145 
01146 
01147 long getstatusbarparts (long * array) {
01148     int i;
01149     long res;
01150     int aWidths[50];
01151     RECT r;
01152     long prior;
01153 
01154     releasethreadglobals();
01155 
01156     res = SendMessage (hwndStatus, SB_GETPARTS, (WPARAM) 50, (LPARAM)aWidths);
01157 
01158     if (res > 0) {
01159         SendMessage (hwndStatus, SB_GETRECT, (WPARAM) res - 1, (LPARAM) &r);
01160         }
01161 
01162     grabthreadglobals();
01163 
01164 
01165     prior = 0;
01166 
01167     for (i = 0; i < res; i++) {
01168         if (aWidths[i] != -1)
01169             array[i] = aWidths[i] - prior;
01170         else
01171             array[i] = r.right-r.left;
01172 
01173         prior = aWidths[i];
01174         }
01175 
01176     return (res);
01177     } /*getstatusbarparts*/
01178 
01179 
01180 
01181 
01182 
01183 
01184 WNDPROC wndprocMDIClient;
01185 
01186 LONG CALLBACK FrontierMDIWndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
01187     
01188     
01189     switch (msg){
01190         case WM_WINDOWPOSCHANGING:
01191             {
01192             WINDOWPOS * wp;
01193 
01194             if (hwndMDIClient != NULL) {
01195 
01196                 if (hwnd == hwndMDIClient) {
01197 
01198                 wp = (WINDOWPOS *) lParam;
01199 
01200                 wp->cy = wp->cy - getstatusbarheight();
01201                     }
01202                 }
01203 
01204             return (CallWindowProc (wndprocMDIClient, hwnd, msg, wParam, lParam));
01205 
01206             }
01207 
01208 #if (FRONTIERWEB == 1)
01209         case WM_NCCALCSIZE:
01210             {
01211             LPNCCALCSIZE_PARAMS lp;
01212             long res;
01213             HWND tophwnd;
01214             int flNoMaxedWindow;
01215 
01216             res = CallWindowProc (wndprocMDIClient, hwnd, msg, wParam, lParam);
01217 
01218             //RAB 2/21/2001: If there is a maxed window do not size HTML control
01219             flNoMaxedWindow = true;
01220 
01221             tophwnd = GetTopWindow (hwndMDIClient);
01222 
01223             if (IsZoomed (tophwnd)) {
01224                 flNoMaxedWindow = false;
01225                 }
01226 
01227             if (wParam && flNoMaxedWindow) {
01228                 lp = (LPNCCALCSIZE_PARAMS) lParam;
01229 
01230                 SetWindowPos (hwndHTMLControl, HWND_BOTTOM, 0, 0, lp->rgrc[0].right, lp->rgrc[0].bottom, 0);
01231                 }
01232 
01233             return (res);
01234             }
01235 
01236         case WM_SIZE:
01237             {
01238             HWND tophwnd;
01239 
01240             if (hwndHTMLControl != NULL) {
01241                 //RAB 2/21/2001: If there is a maxed window do not size HTML control
01242                 tophwnd = GetTopWindow (hwndMDIClient);
01243 
01244                 if (! IsZoomed (tophwnd)) {
01245                     SetWindowPos (hwndHTMLControl, HWND_BOTTOM, 0, 0, LOWORD(lParam), HIWORD (lParam), 0);
01246                     }
01247                 }
01248             break;
01249             }
01250 
01251         case WM_VSCROLL:
01252         case WM_HSCROLL:
01253             {
01254             RECT r;
01255 
01256             if (hwndHTMLControl != NULL) {
01257             
01258 //              GetClientRect (shellframewindow, &r);
01259                 GetClientRect (hwndMDIClient, &r);
01260 
01261                 SetWindowPos (hwndHTMLControl, HWND_BOTTOM, 0, 0, r.right, r.bottom, SWP_NOSIZE | SWP_NOZORDER);
01262                 }
01263             break;
01264             }
01265 #endif
01266         }
01267     return (CallWindowProc (wndprocMDIClient, hwnd, msg, wParam, lParam));
01268 
01269      }
01270 
01271 
01272 
01273 
01274     
01275 static boolean registerChildWindowClass (short idicon, CHAR *classname) {
01276     
01277     WNDCLASS wc;
01278     wc.style         = CS_DBLCLKS;
01279 //  wc.style         = CS_OWNDC;
01280     wc.lpfnWndProc   = (WNDPROC) FrontierOPWndProc;
01281     wc.cbClsExtra    = 0;
01282     wc.cbWndExtra    = OPWindowExtraByteCount;
01283     wc.hInstance     = hInst;
01284     wc.hIcon         = LoadIcon(hInst, MAKEINTRESOURCE(idicon));
01285     wc.hCursor       = NULL; // 5.0a8 dmb - was: LoadCursor(NULL,IDC_ARROW);
01286     wc.hbrBackground = (HBRUSH) (COLOR_BTNFACE + 1);
01287     wc.lpszMenuName  = NULL;
01288     wc.lpszClassName = classname;
01289 
01290     return (RegisterClass(&wc) != 0);
01291     } /*registerChildWindowClass*/
01292 
01293 static boolean registerHTMLChildWindowClass () {
01294     
01295     WNDCLASS wc;
01296     wc.style         = CS_DBLCLKS;
01297     wc.lpfnWndProc   = (WNDPROC) htmlControlWndProc;
01298     wc.cbClsExtra    = 0;
01299     wc.cbWndExtra    = OPWindowExtraByteCount;
01300     wc.hInstance     = hInst;
01301     wc.hIcon         = NULL;
01302     wc.hCursor       = NULL; 
01303     wc.hbrBackground = (HBRUSH) (COLOR_BTNFACE + 1);
01304     wc.lpszMenuName  = NULL;
01305     wc.lpszClassName = szChildHTML;
01306 
01307     return (RegisterClass(&wc) != 0);
01308     } /*registerHTMLChildWindowClass*/
01309 
01310 
01311 BOOL InitializeApplication() {
01312     
01313     WNDCLASS wc;
01314     char bsfatfile [] = "\x0c" "Fatpage_File";
01315     char bsfrontierdoc [] = "\x18" "Frontier Document [FATP]";
01316     tyfilespec fs;
01317     bigstring bsopen;
01318 
01319     getapplicationfilespec (NULL, &fs);
01320 
01321     copystring (fsname (&fs), bsopen);
01322 
01323     pushstring ("\x04 %1\0", bsopen);
01324 
01325 #ifdef PIKE /*7.0b24 PBS -- register OPML file type and icon.*/
01326     
01327 #ifndef OPMLEDITOR  
01328     registerFileType ("\x05" ".opml", "\x04" "OPML", "\x0b" "text/x-opml", "\x1c" "Radio UserLand OPML Document", fsname(&fs), -1 * ID_OPML_ICON, bsopen);
01329 #else
01330     registerFileType ("\x05" ".opml", "\x04" "OPML", "\x0b" "text/x-opml", "\x0d" "OPML Document", fsname(&fs), -1 * ID_OPML_ICON, bsopen);
01331 #endif
01332 
01333 #else
01334     registerFileType ("\x04" ".fat", bsfatfile, "\x09" "text/fatp", bsfrontierdoc, fsname(&fs), -1 * ID_FATPAGE_ICON, bsopen);
01335     registerFileType ("\x05" ".fatp", bsfatfile, "\x09" "text/fatp", NULL, NULL, -1 * ID_FATPAGE_ICON, NULL);
01336     registerFileType ("\x05" ".root", "\x0c" "FrontierRoot", NULL, "\x18" "Frontier Object Database", fsname(&fs), -1 * ID_ROOT_ICON, bsopen);
01337     registerFileType ("\x05" ".2clk", "\x0c" "Frontier2Clk", NULL, "\x17" "Frontier Desktop Script", fsname(&fs), -1 * ID_2CLK_ICON, bsopen);
01338 
01339     registerFileType ("\x05" ".FTwp", "\x0a" "FrontierWP", NULL, "\x14" "Frontier WP Document", fsname(&fs), -1 * ID_WP_ICON, bsopen);
01340     registerFileType ("\x05" ".FTop", "\x0f" "FrontierOutline", NULL, "\x10" "Frontier Outline", fsname(&fs), -1 * ID_OP_ICON, bsopen);
01341     registerFileType ("\x05" ".FTsc", "\x0e" "FrontierScript", NULL, "\x0f" "Frontier Script", fsname(&fs), -1 * ID_SCRIPT_ICON, bsopen);
01342     registerFileType ("\x05" ".FTmb", "\x0c" "FrontierMenu", NULL, "\x0d" "Frontier Menu", fsname(&fs), -1 * ID_MENU_ICON, bsopen);
01343     registerFileType ("\x05" ".FTtb", "\x0d" "FrontierTable", NULL, "\x0e" "Frontier Table", fsname(&fs), -1 * ID_TABLE_ICON, bsopen);
01344     registerFileType ("\x05" ".FTds", "\x15" "FrontierDesktopScript", NULL, "\x17" "Frontier Desktop Script", fsname(&fs), -1 * ID_DESKTOPSCRIPT_ICON, bsopen);
01345 #endif
01346 
01347     /* 9/24/01 RAB */
01348     hIconApp = LoadIcon(hInst,MAKEINTRESOURCE(ID_FRONTIER_ICON));
01349 
01350 //#ifdef PIKE
01351     hTrayIconApp = LoadIcon(hInst,MAKEINTRESOURCE(ID_FRONTIERTRAY_ICON));
01352 //#endif
01353 
01354 
01355     /* Register the frame class */
01356     wc.style         = CS_DBLCLKS;
01357     wc.lpfnWndProc   = (WNDPROC) FrontierFrameWndProc;
01358     wc.cbClsExtra    = 0;
01359     wc.cbWndExtra    = 4;
01360     wc.hInstance    = hInst;
01361     wc.hIcon         = hIconApp;
01362     wc.hCursor       = NULL; // 5.0a8 dmb - was: LoadCursor(NULL,IDC_ARROW);
01363     wc.hbrBackground = (HBRUSH) (COLOR_APPWORKSPACE+1);
01364     wc.lpszMenuName  = IDMULTIPAD;
01365     wc.lpszClassName = szFrame;
01366 
01367     if (!RegisterClass (&wc) )
01368         return (FALSE);
01369 
01370     /* Register the MDI child classes */ /*7.0fc1 PBS: use Frontier icon*/
01371     if (!registerChildWindowClass (/*ID_NOTE_ICON*/ ID_FRONTIER_ICON, szChild1)) /*Class for generic windows (About, QuickScript).*/
01372         return (false);
01373 
01374     if (!registerChildWindowClass (ID_OP_ICON, szChildFTop))
01375         return (false);
01376 
01377     if (!registerChildWindowClass (ID_WP_ICON, szChildFTwp))
01378         return (false);
01379 
01380     if (!registerChildWindowClass (ID_TABLE_ICON, szChildFTtb))
01381         return (false);
01382 
01383     if (!registerChildWindowClass (ID_MENU_ICON, szChildFTmb))
01384         return (false);
01385 
01386     if (!registerChildWindowClass (ID_SCRIPT_ICON, szChildFTsc))
01387         return (false);
01388 
01389     if (!registerChildWindowClass (ID_ROOT_ICON, szChildRoot))
01390         return (false);
01391     
01392     registerHTMLChildWindowClass ();
01393 
01394     return TRUE;
01395     } /*InitializeApplication*/
01396 
01397 /*
01398 static void showenv (void) {
01399 
01400     LPTSTR lpszVariable;  
01401     LPVOID lpvEnv; 
01402  
01403     // Get a pointer to the environment block. 
01404  
01405     lpvEnv = GetEnvironmentStrings(); 
01406  
01407     // Variable strings are separated by NULL byte, and the block is 
01408     // terminated by a NULL byte. 
01409  
01410     for (lpszVariable = (LPTSTR) lpvEnv; *lpszVariable; lpszVariable++) 
01411     { 
01412        while (*lpszVariable) 
01413           putchar(*lpszVariable++); 
01414        putchar('\n'); 
01415     } 
01416     
01417     FreeEnvironmentStrings (lpvEnv); //2003-05-18 AR
01418 }*/ /*showenv*/
01419 
01420 
01421 /****************************************************************************
01422  *                                                                          *
01423  *  FUNCTION   : InitializeInstance ()                                      *
01424  *                                                                          *
01425  *  PURPOSE    : Performs a per-instance initialization of Frontier. It     *
01426  *               also creates the frame and an MDI window.                  *
01427  *                                                                          *
01428  *  RETURNS    : TRUE  - If initialization was successful.                  *
01429  *               FALSE - otherwise.                                         *
01430  *                                                                          *
01431  ****************************************************************************/
01432 BOOL InitializeInstance(LPSTR lpCmdLine, INT nCmdShow)
01433     {
01434     extern HWND  hwndMDIClient;
01435     CHAR         sz[80];
01436     HDC          hdc;
01437     HMENU        hmenu;
01438     unsigned long x, y, nWidth, nHeight;
01439     DWORD style;
01440 
01441 #if FRONTIERWEB == 1
01442     bigstring bsresult;
01443     char * initialURL;
01444     RECT r;
01445 #endif
01446 
01447     /* Get the base window title */
01448     LoadString (hInst, IDS_APPNAME, sz, sizeof(sz));
01449 
01450     //showenv ();    /*2003-05-18 AR: this is debugging code, commented out*/
01451     
01452     if (! getProfileLong ("\x06" "FrameX", &x))
01453         x = CW_USEDEFAULT;
01454 
01455     if (! getProfileLong ("\x06" "FrameY", &y))
01456         x = CW_USEDEFAULT;      //yes X; y will be ignored
01457 
01458     if (! getProfileLong ("\x06" "FrameW", &nWidth))
01459         nWidth = CW_USEDEFAULT;
01460 
01461     if (! getProfileLong ("\x06" "FrameH", &nHeight))
01462         nWidth = CW_USEDEFAULT;     //yes nWidth; nHeight will be ignored
01463 
01464     if (getProfileLong ("\x0a" "FrameStyle", &style))
01465         nCmdShow = style;
01466     else
01467         style = 0;
01468 
01469 //#ifdef PIKE
01470 #ifndef OPMLEDITOR           /*2005-04-17 dluebbert*/
01471     nCmdShow = SW_HIDE;     /* 9/24/01 RAB */
01472 #endif // OPMLEDITOR
01473 //#endif
01474 
01475     style = style | WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN;
01476 
01477     /* If the command line string is empty, nullify the pointer to it
01478     ** else copy command line into our data segment
01479     */
01480     if ( lpCmdLine && !(*lpCmdLine))
01481          pCmdLine = NULL;
01482     else {
01483         pCmdLine = (CHAR *) LocalAlloc(LPTR, lstrlen(lpCmdLine) + 1);
01484         if (pCmdLine)
01485             lstrcpy(pCmdLine, lpCmdLine);
01486         }
01487     
01488     /* Create the frame */
01489     shellframewindow = CreateWindow (szFrame,
01490                   sz,
01491                   style,
01492                   x,
01493                   y,
01494                   nWidth,
01495                   nHeight,
01496                   NULL,
01497                   NULL,
01498                   hInst,
01499                   NULL);
01500 
01501     if ((!shellframewindow) || (!hwndMDIClient))
01502         return FALSE;
01503 
01504     DeleteMenu (GetMenu (shellframewindow), 0, MF_BYPOSITION); // destroy the dummy menu
01505     
01506     /* Load main menu accelerators */
01507     if (!(hAccel = LoadAccelerators (hInst, IDMULTIPAD)))
01508         return FALSE;
01509     
01510     // Do the Frontier/Shell startup
01511     if (!shellinit ())
01512         return (false);
01513     
01514     langipcself = getcurrentprocessid();
01515 
01516     grabthreadglobals ();
01517     
01518     if (!frontierstart ()) {
01519         
01520         shellshutdown ();
01521         
01522         return (false);
01523         }
01524 
01525     findreplacewindow = NULL;  /*just ensure that this is NULL */
01526 
01527 
01528     wndprocMDIClient = (WNDPROC) SetWindowLong (hwndMDIClient, GWL_WNDPROC, (long)FrontierMDIWndProc);
01529 
01530     #if (FRONTIERWEB==1)
01531         GetClientRect (shellframewindow, &r);
01532 
01533         hwndHTMLControl = CreateMDIWindow (szChildHTML, NULL, WS_CHILD , 0, 0,
01534             r.right, r.bottom, hwndMDIClient, hInst, 0);
01535 
01536         if (langrunstringnoerror ("\x26" "system.callbacks.htmlControlStartup ()", bsresult)) { /*7.0b39 PBS: call system.callbacks.htmlControlStartup*/
01537             nullterminate (bsresult);
01538             initialURL = bsresult+1;
01539             }
01540         else {
01541             initialURL = "about:blank";
01542             }
01543 
01544 /*
01545 hwndStatus = GetDlgItem(m_hwnd, ID_STATUSBAR);
01546 GetWindowRect(hwndStatus, &rectStatus);
01547 statusHeight = rectStatus.bottom - rectStatus.top;
01548 MoveWindow( hwndStatus, 
01549             0,
01550             height - statusHeight,
01551             width,
01552             statusHeight,
01553             TRUE);
01554 
01555 if(m_pContainer)
01556    m_pContainer->setLocation(0, 0, width, height-statusHeight);
01557 */
01558 
01559         if ((*(gwebappInfo.webappSetup))(hInst, hwndHTMLControl, hwndStatus, initialURL))
01560             gwebappInfo.flactive = true;
01561 
01562     #endif
01563 
01564     /* Display the frame window */
01565     ShowWindow (shellframewindow, nCmdShow);
01566     UpdateWindow (shellframewindow);
01567 
01568  //   ShowWindow (hwndHTMLControl, nCmdShow);
01569     ShowWindow (hwndHTMLControl, SW_SHOWNOACTIVATE); /*7.0 RAB: fix for minimized HTML control window*/
01570 
01571     UpdateWindow (hwndHTMLControl);
01572 
01573     /* if we allocated a buffer then free it */
01574     if (pCmdLine) {
01575 
01576         LocalFree((LOCALHANDLE) pCmdLine);
01577 
01578         pCmdLine = NULL;
01579         }
01580 
01581     releasethreadglobals ();
01582 
01583     flinstanceinitialized = true;
01584 
01585     return TRUE;
01586         UNREFERENCED_PARAMETER(hmenu);
01587         UNREFERENCED_PARAMETER(hdc);
01588     } /*InitializeInstance*/
01589 
01590 
01591 
01592 BOOL WinProcessMouseEvent (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
01593     {
01594     EventRecord ev;
01595     POINT winpt;
01596 
01597     ev.hwnd = hwnd;
01598     ev.winmsg = msg;
01599     ev.wparam = wParam;
01600     ev.lparam = lParam;
01601     ev.part = HTCLIENT;
01602 
01603     ev.message = (long) hwnd;
01604     ev.when = gettickcount ();
01605 
01606     switch (msg) {
01607         case WM_LBUTTONDOWN:
01608         case WM_LBUTTONDBLCLK:
01609             ev.what = mouseDown;
01610             ev.where.h = LOWORD(lParam);
01611             ev.where.v = HIWORD(lParam);
01612             ev.modifiers = wParam;
01613             break;
01614 
01615         case WM_RBUTTONDOWN:
01616         case WM_RBUTTONDBLCLK:
01617             ev.what = rmouseDown;
01618             ev.where.h = LOWORD(lParam);
01619             ev.where.v = HIWORD(lParam);
01620             ev.modifiers = wParam;
01621             break;
01622 
01623         case WM_MBUTTONDOWN:
01624         case WM_MBUTTONDBLCLK:
01625             ev.what = cmouseDown;
01626             ev.where.h = LOWORD(lParam);
01627             ev.where.v = HIWORD(lParam);
01628             ev.modifiers = wParam;
01629             break;
01630 
01631         case WM_NCLBUTTONDOWN:
01632         case WM_NCLBUTTONDBLCLK:
01633             ev.what = mouseDown;
01634             ev.part = wParam;
01635 
01636             winpt.x = LOWORD(lParam);
01637             winpt.y = HIWORD(lParam);
01638 
01639             ScreenToClient (hwnd, &winpt);
01640 
01641             ev.where.h = (short) winpt.x;
01642             ev.where.v = (short) winpt.y;
01643 
01644             ev.modifiers = 0;
01645             break;
01646 
01647         case WM_NCRBUTTONDOWN:
01648         case WM_NCRBUTTONDBLCLK:
01649             ev.what = rmouseDown;
01650             ev.part = wParam;
01651 
01652             winpt.x = LOWORD(lParam);
01653             winpt.y = HIWORD(lParam);
01654 
01655             ScreenToClient (hwnd, &winpt);
01656 
01657             ev.where.h = (short) winpt.x;
01658             ev.where.v = (short) winpt.y;
01659 
01660             ev.modifiers = 0;
01661             break;
01662 
01663         case WM_NCMBUTTONDOWN:
01664         case WM_NCMBUTTONDBLCLK:
01665             ev.what = cmouseDown;
01666             ev.part = wParam;
01667 
01668             winpt.x = LOWORD(lParam);
01669             winpt.y = HIWORD(lParam);
01670 
01671             ScreenToClient (hwnd, &winpt);
01672 
01673             ev.where.h = (short) winpt.x;
01674             ev.where.v = (short) winpt.y;
01675 
01676             ev.modifiers = 0;
01677             break;
01678 
01679         default:
01680             ev.what = mouseDown;
01681             ev.where.h = LOWORD(lParam);
01682             ev.where.v = HIWORD(lParam);
01683             ev.modifiers = wParam;
01684             break;
01685         }
01686 
01687     return (shellprocessevent (&ev));
01688     }
01689 
01690 BOOL WinProcessKeyboardEvent (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
01691     {
01692     EventRecord ev;
01693 
01694     ev.hwnd = hwnd;
01695     ev.winmsg = msg;
01696     ev.wparam = wParam;
01697     ev.lparam = lParam;
01698     ev.part = HTCLIENT;
01699 
01700     ev.what = keyDown;
01701     ev.message = wParam;
01702     ev.when = gettickcount ();
01703     ev.where.h = 0;
01704     ev.where.v = 0;
01705     ev.modifiers = lParam;
01706     return (shellprocessevent (&ev));
01707     }
01708 
01709 BOOL WinProcessPaintEvent (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
01710     {
01711     EventRecord ev;
01712 
01713     ev.hwnd = hwnd;
01714     ev.winmsg = msg;
01715     ev.wparam = wParam;
01716     ev.lparam = lParam;
01717     ev.part = HTCLIENT;
01718 
01719     ev.what = updateEvt;
01720     ev.message = (long) hwnd;
01721     ev.when = gettickcount ();
01722     ev.where.h = 0;
01723     ev.where.v = 0;
01724     ev.modifiers = wParam;
01725     return (shellprocessevent (&ev));
01726     }
01727 
01728 BOOL WinProcessCommandEvent (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
01729     {
01730     EventRecord ev;
01731 
01732     ev.hwnd = hwnd;
01733     ev.winmsg = msg;
01734     ev.wparam = wParam;
01735     ev.lparam = lParam;
01736     ev.part = HTCLIENT;
01737 
01738     ev.what = menuEvt;
01739     ev.message = (long) hwnd;
01740     ev.when = gettickcount ();
01741     ev.where.h = 0;
01742     ev.where.v = 0;
01743     ev.modifiers = (((LOWORD(wParam) / 100) * 100) << 16) + (LOWORD(wParam));
01744     
01745     keyboardpeek (&keyboardstatus);
01746     
01747     return (shellprocessevent (&ev));
01748     }
01749 
01750 BOOL WinProcessScrollEvent (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, boolean isvert)
01751     {
01752     EventRecord ev;
01753 
01754     ev.hwnd = hwnd;
01755     ev.winmsg = msg;
01756     ev.wparam = wParam;
01757     ev.lparam = lParam;
01758     ev.part = HTCLIENT;
01759 
01760     ev.what = scrollEvt;
01761     ev.message = (long) hwnd;
01762     ev.when = gettickcount ();
01763     ev.where.h = HIWORD (wParam);
01764     ev.where.v = LOWORD (wParam);
01765     ev.modifiers = isvert;
01766     
01767     keyboardpeek (&keyboardstatus);
01768     
01769     return (shellprocessevent (&ev));
01770     }
01771 
01772 BOOL WinProcessActivateEvent (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
01773     {
01774     EventRecord ev;
01775 
01776     ev.hwnd = hwnd;
01777     ev.winmsg = msg;
01778     ev.wparam = wParam;
01779     ev.lparam = lParam;
01780     ev.part = HTCLIENT;
01781 
01782     ev.what = activateEvt;
01783     ev.message = (long) hwnd;
01784     ev.when = gettickcount ();
01785     ev.where.h = 0;
01786     ev.where.v = 0;
01787     if (GET_WM_MDIACTIVATE_FACTIVATE(hwnd, wParam, lParam))
01788         ev.modifiers = activeFlag;
01789     else
01790         ev.modifiers = 0;
01791 
01792     return (shellprocessevent (&ev));
01793     }
01794 
01795 BOOL WinProcessNCActivateEvent (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
01796     {
01797     EventRecord ev;
01798 
01799     ev.hwnd = hwnd;
01800     ev.winmsg = msg;
01801     ev.wparam = wParam;
01802     ev.lparam = lParam;
01803     ev.part = HTCLIENT;
01804 
01805     ev.what = activateEvt;
01806     ev.message = (long) hwnd;
01807     ev.when = gettickcount ();
01808     ev.where.h = 0;
01809     ev.where.v = 0;
01810     if (wParam)
01811         ev.modifiers = activeFlag;
01812     else
01813         ev.modifiers = 0;
01814 
01815     return (shellprocessevent (&ev));
01816     } /*WinProcessNCActivateEvent*/
01817 
01818 
01819 BOOL WinProcessActivateAppEvent (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
01820     
01821     /*
01822     5.0a22 dmb: added
01823     
01824     2006-04-17 aradke: Removed tyjugglermessage for endianness-agnostic code.
01825         See shellhandlejugglerevent in shelljuggler.c.
01826     */
01827 
01828     EventRecord ev;
01829 
01830     ev.hwnd = hwnd;
01831     ev.winmsg = msg;
01832     ev.wparam = wParam;
01833     ev.lparam = lParam;
01834     
01835     ev.message = 0;
01836     ev.message |= (suspendResumeMessage << 24);
01837     ev.message |= ((wParam != 0) ? resumeFlag : 0);
01838 
01839     ev.what = jugglerEvt;
01840     ev.when = gettickcount ();
01841     ev.where.h = 0;
01842     ev.where.v = 0;
01843 
01844     return (shellprocessevent (&ev));
01845     } /*WinProcessActivateAppEvent*/
01846 
01847 
01848 static BOOL WinMapSpecialKey (WPARAM *wParam) {
01849 
01850     switch (*wParam) {
01851     
01852         case VK_LEFT:
01853             *wParam = chleftarrow;
01854             break; 
01855     
01856         case VK_RIGHT:
01857             *wParam = chrightarrow;
01858             break; 
01859     
01860         case VK_UP:
01861             *wParam = chuparrow;
01862             break; 
01863     
01864         case VK_DOWN:
01865             *wParam = chdownarrow;
01866             break; 
01867     
01868         case VK_PRIOR:
01869             *wParam = chpageup;
01870             break;
01871         
01872         case VK_NEXT:
01873             *wParam = chpagedown;
01874             break;
01875     
01876         case VK_HOME:
01877             *wParam = chhome;
01878             break; 
01879     
01880         case VK_END:
01881             *wParam = chend;
01882             break; 
01883     
01884         case VK_INSERT:
01885             *wParam = chleftarrow;
01886             break; 
01887     
01888         case VK_DELETE:
01889             *wParam = chdelete;
01890             break; 
01891     
01892         case VK_F1:
01893             *wParam = chhelp;
01894             break; 
01895     
01896         case VK_F2:
01897             *wParam = chenter;
01898             break; 
01899         
01900         default:
01901             return FALSE;
01902         }
01903     
01904     return TRUE;
01905     } /*WinMapSpecialKey*/
01906 
01907 
01908 /****************************************************************************
01909  *                                                                          *
01910  *  FUNCTION   : QueryCloseAllChildren()                                    *
01911  *                                                                          *
01912  *  PURPOSE    : Asks the child windows if it is ok to close up app. Nothing*
01913  *               is destroyed at this point. The z-order is not changed.    *
01914  *                                                                          *
01915  *  RETURNS    : TRUE - If all children agree to the query.                 *
01916  *               FALSE- If any one of them disagrees.                       *
01917  *                                                                          *
01918  ****************************************************************************/
01919 
01920 BOOL QueryCloseAllChildren() {
01921     boolean fl;
01922     
01923     grabthreadglobals ();
01924     
01925     keyboardpeek (&keyboardstatus);
01926     
01927     fl = shellquit ();
01928     
01929     releasethreadglobals ();
01930 
01931     return (fl);
01932     }
01933 
01934 
01935 /****************************************************************************
01936  *                                                                          *
01937  *  FUNCTION   : QueryCloseChild (hwnd)                                     *
01938  *                                                                          *
01939  *  PURPOSE    : If the child MDI is unsaved, allow the user to save, not   *
01940  *               save, or cancel the close operation.                       *
01941  *                                                                          *
01942  *  RETURNS    : TRUE  - if user chooses save or not save, or if the file   *
01943  *                       has not changed.                                   *
01944  *               FALSE - otherwise.                                         *
01945  *                                                                          *
01946  ****************************************************************************/
01947 
01948 BOOL QueryCloseChild(register HWND hwnd)
01949     {
01950     boolean fl;
01951     
01952     grabthreadglobals ();
01953     
01954     keyboardpeek (&keyboardstatus);
01955     
01956     if (keyboardstatus.floptionkey)
01957         fl = shellcloseall (getfrontwindow (), true);
01958     else
01959         fl = shellclose (getfrontwindow (), true);
01960     
01961     releasethreadglobals ();
01962 
01963     return (fl);
01964     }
01965 
01966 
01967 
01968 
01969 LPSTR GetCmdLine (void) {
01970 
01971     LPSTR lpCmdLine, lpT;
01972 
01973 #if defined(_MAC)
01974     lpCmdLine =  NULL;
01975 #else
01976     lpCmdLine = GetCommandLine();
01977 #endif
01978 
01979     // on Win32, lpCmdLine's first string includes its own name, remove this
01980     // to make it exactly like the windows command line.
01981 
01982     if (*lpCmdLine) {
01983         lpT = strchr(lpCmdLine, ' ');   // skip self name
01984         if (lpT) {
01985             lpCmdLine = lpT;
01986             while (*lpCmdLine == ' ') {
01987                 lpCmdLine++;            // skip spaces to end or first cmd
01988                 }
01989             }
01990         else {
01991             lpCmdLine += strlen(lpCmdLine);   // point to NULL
01992             }
01993         }
01994     return(lpCmdLine);
01995     } /*GetCmdLine*/
01996 
01997 
01998 boolean openwindowsparamlinefiles (void) {
01999 
02000     /*
02001     7.0b26 PBS: updated with two fixes from Bob:
02002 
02003     1. Strip leading and trailing quotes in the path -- fixes Win2K bug.
02004 
02005     2. Get full path name of file instead of 8.3 name -- fixes Win98/NT4 bug.
02006 
02007     8.0b46: Deal with folder "" not found errors when person double-clicks on the
02008     app and it's already running.
02009     */
02010 
02011     bigstring bspath;
02012     bigstring bsnewfile;
02013     tyfilespec fs;
02014     short len;
02015     LPTSTR lpFilePart;
02016     char buffer[1001];
02017     DWORD newLen;
02018     WIN32_FIND_DATA info;
02019     HANDLE hinfo;
02020 
02021     if (pCmdLine) {
02022 
02023         if (strcmpi (pCmdLine, "-Embedding") == 0)
02024             return (false);
02025         
02026         copyctopstring (pCmdLine, bspath);
02027 
02028         /*7.0b26: Delete leading and trailing quotes.*/
02029         
02030         if ((lastchar(bspath) == '"') && (getstringcharacter (bspath, 0) == '"')) {
02031 
02032             setstringlength (bspath, stringlength(bspath) - 1); /*trailing "*/
02033 
02034             deletestring (bspath, 1, 1); /*leading "*/
02035             }
02036 
02037         len = stringlength (bspath);
02038 
02039         if (len == 0) { /*8.0b46: user has double-clicked on the app icon*/
02040                 
02041                 bigstring bsresult;
02042     
02043                 grabthreadglobals ();
02044 
02045                 langrunstringnoerror ("\x28" "system.callbacks.systemTrayIcon2Click ()", bsresult);
02046 
02047                 releasethreadglobals ();
02048                 
02049                 #ifndef PIKE
02050                     ShowWindow (shellframewindow, SW_SHOW); /*Show the window.*/
02051 
02052                     activateapplication (NULL); /*Bring to front*/
02053                 #endif
02054 
02055                 return (true);
02056             } /*if*/
02057 
02058         nullterminate (bspath);
02059         
02060         /*7.0b26: Get full path name, not 8.3 name.*/
02061 
02062         newLen = GetFullPathName (stringbaseaddress(bspath), 1000, buffer, &lpFilePart);
02063 
02064         if ((newLen > 0) && (newLen < 1000)) {
02065             hinfo = FindFirstFile (buffer, &info);
02066 
02067             if (hinfo != INVALID_HANDLE_VALUE) {
02068                 *lpFilePart = 0;
02069                 copyctopstring (buffer, bspath);
02070 
02071                 copyctopstring (info.cFileName, bsnewfile);
02072 
02073                 pushstring (bsnewfile, bspath);
02074 
02075                 FindClose (hinfo);
02076                 }
02077             }
02078             
02079         pathtofilespec (bspath, &fs);
02080         
02081         return (shellopenfile (&fs, false, nil));
02082         }
02083 
02084     return (false);
02085     } /*openwindowsparamlinefiles*/
02086 
02087 
02088 /*boolean openwindowsparamlinefiles (void) {
02089 
02090     bigstring bspath;
02091     tyfilespec fs;
02092     short len;
02093     boolean flquoteatbeginning = false;
02094     boolean flquoteatend = false;
02095 
02096     if (pCmdLine) {
02097 
02098         if (strcmpi (pCmdLine, "-Embedding") == 0)
02099             return (false);
02100         
02101         copyctopstring (pCmdLine, bspath);
02102 
02103         len = stringlength (bspath);
02104 
02105         pathtofilespec (bspath, &fs);
02106         
02107         return (shellopenfile (&fs, false, nil));
02108         }
02109 
02110     return (false);
02111     } /*openwindowsparamlinefiles*/
02112 
02113 /****************************************************************************
02114  *                                                                          *
02115  *  FUNCTION   : FrontierFrameWndProc (hwnd, msg, wParam, lParam )                *
02116  *                                                                          *
02117  *  PURPOSE    : The window function for the "frame" window, which controls *
02118  *               the menu and encompasses all the MDI child windows. Does   *
02119  *               the major part of the message processing. Specifically, in *
02120  *               response to:                                               *
02121  *                                                                          *
02122  *                   WM_CREATE          : Creates and displays the "frame". *
02123  *                                                                          *
02124  *                   WM_INITMENU        : Sets up the state of the menu.    *
02125  *                                                                          *
02126  *                   WM_WININICHANGE &  : If default printer characteristics*
02127  *                   WM_DEVMODECHANGE     have been changed, reinitialises  *
02128  *                                        printer DC.                       *
02129  *                                                                          *
02130  *                   WM_COMMAND         : Passes control to a command-      *
02131  *                                        handling function.                *
02132  *                                                                          *
02133  *                   WM_CLOSE           : Quits the app. if all the child   *
02134  *                                        windows agree.                    *
02135  *                                                                          *
02136  *                   WM_QUERYENDSESSION : Checks that all child windows     *
02137  *                                        agree to quit.                    *
02138  *                                                                          *
02139  *                   WM_DESTROY         : Destroys frame window and quits   *
02140  *                                        app.                              *
02141  *                                                                          *
02142  ****************************************************************************/
02143 LONG CALLBACK FrontierFrameWndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
02144     
02145     /*
02146     5.0.2 dmb/rab: grabthreadglobals for frontieropenfile code
02147 
02148     5.0.2b20 dmb: don't create new find/replace window if one is already open
02149 
02150     5.1.5b7 dmb: don't accept frontieropenfile if we're not done initializing
02151     */
02152     
02153     if (msg == wm_frontieropenfile) {
02154         
02155         if (lParam) {
02156             bigstring inputFile;
02157             int n;
02158             boolean flinitted = flinstanceinitialized;
02159 
02160             getProfileString ("\x0b" "DeskTopFile", inputFile);
02161 
02162             n = stringlength (inputFile);
02163             
02164             pCmdLine = (CHAR *) LocalAlloc(LPTR, n + 1);
02165 
02166             if (pCmdLine) {
02167                 
02168                 if (flinitted)
02169                     grabthreadglobals ();
02170                 
02171                 copyptocstring (inputFile, pCmdLine);
02172                 
02173                 activateapplication (NULL);
02174                 
02175                 if (flinitted)
02176                     openwindowsparamlinefiles ();
02177                 
02178                 LocalFree((LOCALHANDLE) pCmdLine);
02179                 
02180                 pCmdLine = NULL;
02181                 
02182                 if (flinitted)
02183                     releasethreadglobals ();
02184                 }
02185             }
02186         
02187         return 0;
02188         }
02189 
02190     if (msg == wm_startsearch) {
02191 
02192         if (findreplacewindow == NULL)
02193             findreplacewindow = FindText ((FINDREPLACE *) lParam);
02194         else
02195             windowbringtofront (findreplacewindow);
02196 
02197         return (0);
02198         }
02199 
02200     if (msg == wm_startreplace) {
02201 
02202         if (findreplacewindow == NULL)
02203             findreplacewindow = ReplaceText ((FINDREPLACE *) lParam);
02204         else
02205             windowbringtofront (findreplacewindow);
02206 
02207         return (0);
02208         }
02209 
02210 
02211     if (msg == wm_findmsgstring) {
02212 
02213         shellprocessfindmessage ((FINDREPLACE *) lParam);
02214 
02215         return (0);
02216         }
02217 
02218     
02219     switch (msg){
02220 /*      case WM_WINDOWPOSCHANGING:
02221             {
02222             WINDOWPOS * wp;
02223 
02224             if (hwndMDIClient != NULL) {
02225 
02226                 if (hwnd == hwndMDIClient) {
02227 
02228                 wp = (WINDOWPOS *) lParam;
02229 
02230                 wp->flags |= SWP_NOZORDER;
02231                     }
02232                 }
02233 
02234             #if (FRONTIERWEB == 1)
02235                 doweb (hwnd, msg, wParam, lParam);
02236             #endif
02237 
02238             return DefFrameProc (hwnd,hwndMDIClient,msg,wParam,lParam);
02239             }
02240 */
02241 
02242         case 0x020A: { /*WM_MOUSEWHEEL:*/
02243 
02244             short delta;
02245             WindowPtr w = getfrontwindow ();
02246             tydirection dir = down;
02247 
02248             if (w != nil) {
02249                 
02250                 delta = (short) HIWORD (wParam);
02251 
02252                 delta = delta / 120; /*WHEEL_DELTA == 120*/
02253 
02254                 if (delta < 0)
02255                     dir = up;
02256 
02257                 grabthreadglobals ();
02258     
02259                 shellpushglobals (w);
02260 
02261                 (*shellglobals.scrollroutine) (dir, false, abs (delta));
02262 
02263                 shellpopglobals ();
02264 
02265                 releasethreadglobals ();
02266                 } /*if*/
02267 
02268             break;
02269             } 
02270 
02271 //#ifdef PIKE
02272         case FWM_SYSTRAYICON:
02273             {
02274         //  RECT r;
02275     
02276             if (lParam == WM_LBUTTONDBLCLK) {
02277 
02278                 bigstring bsresult;
02279     
02280                 grabthreadglobals ();
02281 
02282                 langrunstringnoerror ("\x28" "system.callbacks.systemTrayIcon2Click ()", bsresult);
02283 
02284                 releasethreadglobals ();
02285                 
02286                 #ifndef PIKE
02287                     ShowWindow (shellframewindow, SW_SHOW); /*Show the window.*/
02288 
02289                     activateapplication (NULL); /*Bring to front*/
02290                 #endif
02291                 }
02292 
02293             if (lParam == WM_RBUTTONUP) {
02294 
02295                 grabthreadglobals ();
02296 
02297                 rundockmenu ();
02298 
02299                 releasethreadglobals ();
02300                 }
02301                 
02302             return DefFrameProc (hwnd,hwndMDIClient,msg,wParam,lParam);
02303             }
02304 //#endif
02305 
02306 
02307         case WM_SIZE:
02308             {
02309             long statusHeight;
02310             unsigned short width;
02311             unsigned short height;
02312 
02313             width = LOWORD(lParam);
02314 
02315             height = HIWORD(lParam);
02316 
02317             statusHeight = getstatusbarheight();
02318 
02319             if (hwndStatus != NULL) {
02320                 MoveWindow( hwndStatus, 
02321                     0,
02322                     height - statusHeight,
02323                     width,
02324                     statusHeight,
02325                     TRUE);
02326 
02327                 setDefinedStatusBarParts (width);
02328                 }
02329 
02330             if (hwndMDIClient != NULL) {
02331             
02332                 SetWindowPos (hwndMDIClient, HWND_BOTTOM, 0, 0, width, height - statusHeight, SWP_NOZORDER);
02333                 }
02334 
02335             return DefFrameProc (hwnd,hwndMDIClient,msg,wParam,lParam);
02336             }
02337 
02338         case WM_CREATE:
02339             {
02340             CLIENTCREATESTRUCT ccs;
02341             HDC hdc;
02342 
02343             /* Find window menu where children will be listed */
02344             ccs.hWindowMenu = GetSubMenu (GetMenu(hwnd),WINDOWMENU);
02345             ccs.idFirstChild = IDM_WINDOWCHILD;
02346 
02347             hwndStatus = CreateStatusWindow( WS_CHILD | 
02348                                     WS_VISIBLE | 
02349                                     WS_CLIPSIBLINGS | 
02350                                     CCS_BOTTOM | 
02351                                     SBARS_SIZEGRIP ,
02352                                     NULL,
02353                                     hwnd,
02354                                     1001);
02355 
02356             /* Create the MDI client filling the client area */
02357             hwndMDIClient = CreateWindow ("mdiclient",
02358                                           NULL,
02359                                           WS_CHILD | WS_CLIPCHILDREN |
02360                                           /*WS_VSCROLL | WS_HSCROLL | */MDIS_ALLCHILDSTYLES,
02361                                           0,
02362                                           0,
02363                                           0,
02364                                           0,
02365                                           hwnd,
02366                                           (HMENU)0xCAC,
02367                                           hInst,
02368                                           (LPSTR)&ccs);
02369 
02370 
02371             ShowWindow (hwndMDIClient,SW_SHOW);
02372 
02373             /* Check if printer can be initialized */
02374             if (hdc = GetPrinterDC (TRUE)){
02375                 DeleteDC (hdc);
02376                 }
02377             
02378             hwndNextViewer = SetClipboardViewer (hwnd);
02379             
02380             if (hwndNextViewer == NULL)
02381                 if (GetLastError() != ERROR_SUCCESS)
02382                     hwndNextViewer = (HWND) -1;
02383             
02384             #if (FRONTIERWEB == 1)
02385 //              doweb (hwnd, msg, wParam, lParam);
02386             #endif
02387 
02388             break;
02389             }
02390 
02391         //  case WM_INITMENU:
02392                 /* Set up the menu state */
02393         //      InitializeMenu ((HMENU)wParam);
02394         //      shellinitmenus();
02395         //      break;
02396 
02397         case WM_WININICHANGE:
02398         case WM_DEVMODECHANGE:
02399             {
02400                 /*  If control panel changes default printer characteristics,
02401                  *  reinitialize our printer information...
02402                  */
02403                 HDC hdc;
02404     
02405                 if (hdc = GetPrinterDC (TRUE))
02406                 {
02407                     DeleteDC (hdc);
02408                 }
02409                 break;
02410             }
02411             break;
02412 
02413         case WM_PAINT: {
02414             PAINTSTRUCT ps;
02415             BeginPaint (hwnd, &ps);
02416             EndPaint (hwnd, &ps);
02417             }
02418             break;
02419 
02420         case WM_COMMAND:
02421             /* Direct all menu selection or accelerator commands to another
02422              * function
02423              */
02424         //  setport(GetDC(hwndActive));
02425             WinProcessCommandEvent (hwndActive, msg, wParam, lParam);
02426         //  ReleaseDC(hwndActive, getport());
02427         //  setport (NULL);
02428 
02429             #if (FRONTIERWEB == 1)
02430 //              doweb (hwnd, msg, wParam, lParam);
02431             #endif
02432 
02433             return DefFrameProc (hwnd,hwndMDIClient,msg,wParam,lParam);
02434             break;
02435 
02436         case WM_CLOSE: 
02437 
02438 //#ifdef PIKE
02439             ShowWindow (hwnd, SW_HIDE);
02440             break;
02441 //#else
02442 
02443 
02444 
02445 /*          grabthreadglobals ();
02446             
02447             keyboardpeek (&keyboardstatus);
02448 
02449             #ifdef PIKE
02450 
02451                 if (pikequit ())
02452 
02453                     shellquit ();
02454 
02455             #else
02456             
02457                 shellquit();
02458 
02459             #endif
02460             
02461             releasethreadglobals ();
02462 
02463             #if (FRONTIERWEB == 1)
02464 //              doweb (hwnd, msg, wParam, lParam);
02465             #endif
02466 
02467             break;
02468 //#endif*/
02469 
02470         case WM_QUERYENDSESSION:
02471             /*  Before session ends, check that all files are saved */
02472             return QueryCloseAllChildren ();
02473 
02474         case WM_DESTROY: {
02475             WINDOWPLACEMENT w;
02476 
02477             //Save the Frame position
02478             w.length = sizeof(WINDOWPLACEMENT);
02479 
02480             if (GetWindowPlacement (hwnd, &w)) {
02481                 setProfileLong ("\x06" "FrameX", w.rcNormalPosition.left);
02482                 setProfileLong ("\x06" "FrameY", w.rcNormalPosition.top);
02483                 setProfileLong ("\x06" "FrameW", w.rcNormalPosition.right - w.rcNormalPosition.left);
02484                 setProfileLong ("\x06" "FrameH", w.rcNormalPosition.bottom - w.rcNormalPosition.top);
02485                 setProfileLong ("\x0a" "FrameStyle", w.showCmd);
02486                 }
02487 
02488             if (hwndNextViewer != (HWND) -1)
02489                 ChangeClipboardChain(hwnd, hwndNextViewer);
02490 
02491             #if (FRONTIERWEB == 1)
02492 //              doweb (hwnd, msg, wParam, lParam);
02493             #endif
02494 
02495             PostQuitMessage (0);
02496             }
02497             break;
02498         
02499         case WM_QUIT:
02500             // we never get here; the thread exits before sending it to this proc.
02501             // seems weird, but consistent with the docs
02502             break;
02503         
02504         case WM_CHANGECBCHAIN:  
02505 
02506             // If the next window is closing, repair the chain.
02507             if ((HWND) wParam == hwndNextViewer) 
02508                 hwndNextViewer = (HWND) lParam; 
02509 
02510             // Otherwise, pass the message to the next link. 
02511             else if (hwndNextViewer != NULL)
02512                 SendMessage(hwndNextViewer, msg, wParam, lParam); 
02513 
02514             break;
02515 
02516         case WM_DRAWCLIPBOARD:
02517             handlescrapdisposed (); //it needs to be refreshed
02518 
02519             if ((HWND) wParam == hwndNextViewer) 
02520                 hwndNextViewer = (HWND) lParam;
02521 
02522             if ((hwndNextViewer != (HWND) NULL) && (lParam != (LPARAM) NULL))
02523                 SendMessage(hwndNextViewer, msg, wParam, lParam); 
02524 
02525             break;
02526 
02527         case WM_RENDERFORMAT:
02528             shellexportscrap (win2shellscraptype (wParam));
02529             break;
02530         
02531         case WM_RENDERALLFORMATS:
02532             shellwritescrap (allscraptypes);
02533             break;
02534 
02535         case WM_DESTROYCLIPBOARD:
02536             shelldisposescrap ();
02537             break;
02538 
02539         case wm_destroycaret:
02540             DestroyCaret ();
02541             break;
02542 
02543         case wm_processAccept:
02544             fwsNetEventAcceptSocket (wParam, lParam);
02545             break;
02546 
02547         case WM_ACTIVATEAPP:
02548             WinProcessActivateAppEvent (hwnd, msg, wParam, lParam);
02549             return (0);
02550 
02551         default:
02552             /*  use DefFrameProc() instead of DefWindowProc() since there
02553              *  are things that have to be handled differently because of MDI
02554              */
02555 
02556 
02557             #if (FRONTIERWEB == 1)
02558 //              doweb (hwnd, msg, wParam, lParam);
02559             #endif
02560 
02561             return DefFrameProc (hwnd,hwndMDIClient,msg,wParam,lParam);
02562     }
02563     return 0;
02564 }
02565 
02566 
02567 static boolean GetFrontierWindowInfo (HWND hwnd, hdlwindowinfo *hinfo) {
02568 
02569     if (!getwindowinfo (hwnd, hinfo))
02570         return (false);
02571     
02572     if (**hinfo == NULL) // dmb: I don't understand why, but it can be so 
02573         return (false);
02574 
02575     return ((***hinfo).hdata != NULL);
02576     } /*GetFrontierWindowInfo*/
02577 
02578 
02579 LONG CALLBACK FrontierOPWndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
02580     {
02581     hdlwindowinfo hinfo;
02582     LONG retval;
02583 
02584     MESSAGETRACKER(hwnd, msg, wParam, lParam);
02585 
02586     switch (msg){
02587         case WM_CREATE: {
02588             
02589             ShowWindow (hwnd, SW_HIDE);
02590             /*
02591             EventRecord ev;
02592 
02593             SetFocus (hwnd);
02594                 
02595             ev.message = hwnd;
02596             ev.what = activateEvt;
02597             ev.where.h = 0;
02598             ev.where.v = 0;
02599             if (wParam)
02600                 ev.modifiers = activeFlag;
02601             else
02602                 ev.modifiers = 0;
02603 
02604             shellprocessevent (&ev);
02605             */  
02606             }
02607             break;
02608 
02609         case WM_SIZE:
02610             if (GetFrontierWindowInfo (hwnd, &hinfo)) {
02611                 RECT rr;
02612                 HDC oldone;
02613                 
02614                 #ifdef USINGSTATUSBAR
02615                     //RAB: 1/20/98 - Added code to keep the status bar where it should be
02616                     int cxParent = LOWORD (lParam);
02617                     int cyParent = HIWORD (lParam);
02618                     int x, y, cx, cy;
02619                     RECT rWindow;
02620                     HWND hwndStatusBar;
02621 
02622                     hwndStatusBar = (HWND) GetWindowLong (hwnd, 8);
02623 
02624                     // Keep Status Window Height the same
02625                     GetWindowRect (hwndStatusBar, &rWindow);
02626 
02627                     cy = rWindow.bottom - rWindow.top;
02628 
02629                     x = 0;
02630 
02631                     y = cyParent - cy;
02632 
02633                     cx = cxParent;
02634 
02635                     MoveWindow (hwndStatusBar, x, y, cx, cy, TRUE);
02636                     //RAB: 1/20/98 end of changes
02637                 #endif
02638 
02639                 rr = (**hinfo).contentrect;
02640 
02641                 if ((rr.right != LOWORD(lParam)) || (rr.bottom != HIWORD(lParam)))  {
02642                     
02643                     oldone = getport();
02644                 //  winpushport(GetDC(hwnd));
02645                     grabthreadglobals ();
02646                     shellpushglobals (hwnd);
02647 
02648                     shelladjustaftergrow (hwnd);
02649                     
02650                     shellpopglobals ();
02651                     releasethreadglobals ();
02652                 //  ReleaseDC(hwnd, getport());
02653                     //setport (oldone);
02654                 //  winpopport();
02655                     }
02656                 }
02657             
02658             retval = DefMDIChildProc (hwnd, msg, wParam, lParam);
02659             MESSAGEENDER (MSGDEFAULT);
02660             return (retval);    
02661             
02662         case WM_SYSCOMMAND: {
02663 
02664             /*#ifdef PIKE /*7.0b26 PBS: standard Windows maximize behavior.*/
02665 
02666                 hdlhashtable hprefs;
02667                 boolean flkernelhandledmaximize = false;
02668 
02669 #if (FRONTIERWEB == 1)
02670                 //RAB 2/21/2001: If a window was maxed we must be sure to resize the HTML control.
02671                 if ((wParam == SC_RESTORE) || (wParam == SC_MINIMIZE)) {
02672                     HWND tophwnd;
02673 
02674                     tophwnd = GetTopWindow (hwndMDIClient);
02675 
02676                     if (IsZoomed (tophwnd)) {
02677                         RECT r;
02678 
02679                         if (hwndHTMLControl != NULL) {
02680                         
02681                             GetClientRect (hwndMDIClient, &r);
02682 
02683                             SetWindowPos (hwndHTMLControl, HWND_BOTTOM, 0, 0, r.right, r.bottom, SWP_NOACTIVATE | SWP_NOZORDER);
02684                             }
02685 
02686                         }
02687                     }
02688 #endif
02689 
02690                 if (wParam == SC_MAXIMIZE) { /*handle maximize*/
02691                     grabthreadglobals ();
02692                     shellpushglobals (hwnd);
02693 
02694                     if (langfastaddresstotable (roottable, "\x0a" "user.prefs", &hprefs)) {
02695 
02696                         hdlhashnode hnode;
02697                         tyvaluerecord val;
02698 
02699                         pushhashtable (hprefs);
02700 
02701                         if (hashlookup ("\x15" "flwinstandardmaximize", &val, &hnode)) {
02702 
02703                             if (copyvaluerecord (val, &val) && coercetoboolean (&val))
02704                                 
02705                                 if ((!val.data.flvalue) && (shellwindowinfo != NULL)) {
02706 
02707                                     (*shellglobals.zoomwindowroutine) (shellwindowinfo, true);
02708                         
02709                                     flkernelhandledmaximize = true;
02710                                     } /*if*/
02711                             } /*if*/
02712 
02713                         pophashtable ();
02714                         } /*if*/
02715                         
02716                     if ((shellwindowinfo != NULL) && (!flkernelhandledmaximize)) {
02717                             
02718                         keyboardpeek (&keyboardstatus); //6.0a13 dmb
02719 
02720                         if ((**shellwindowinfo).configresnum == idaboutconfig) {
02721                                                     
02722                             (*shellglobals.zoomwindowroutine) (shellwindowinfo, true);
02723 
02724                             flkernelhandledmaximize = true;
02725                             } /*if*/
02726                         } /*if*/
02727                         
02728                     shellpopglobals ();
02729                     releasethreadglobals ();
02730 
02731                     if (flkernelhandledmaximize) {
02732                         retval = 0;
02733                         break;
02734                         } /*if*/
02735                     } /*if*/
02736 
02737         /*  #else
02738 
02739                 if (wParam == SC_MAXIMIZE) { /*handle maximize*/
02740         /*              grabthreadglobals ();
02741                         shellpushglobals (hwnd);
02742                         
02743                         if (shellwindowinfo != NULL) {
02744                             
02745                             keyboardpeek (&keyboardstatus); //6.0a13 dmb
02746                                                     
02747                             (*shellglobals.zoomwindowroutine) (shellwindowinfo, true);
02748                             }
02749                         
02750                         shellpopglobals ();
02751                         releasethreadglobals ();
02752                     retval = 0;
02753                     break;
02754                     }
02755 
02756             #endif*/
02757 
02758             retval = DefMDIChildProc (hwnd, msg, wParam, lParam);
02759             MESSAGEENDER (MSGDEFAULT);
02760             return (retval);
02761             }
02762 
02763         case WM_MDIACTIVATE:
02764             /* If we're activating this child, remember it */
02765             if (GET_WM_MDIACTIVATE_FACTIVATE(hwnd, wParam, lParam)){
02766                 hwndActive     = hwnd;
02767                 }
02768             else{
02769                 hwndActive     = NULL;
02770                 }
02771 
02772             if (GetFrontierWindowInfo (hwnd, &hinfo)) {
02773 
02774             //  winpushport(GetDC(hwnd));
02775 
02776                 WinProcessActivateEvent (hwnd, msg, wParam, lParam);
02777                 
02778             //  ReleaseDC(hwnd, getport());
02779             //  winpopport ();
02780                 }
02781 
02782             break;
02783 
02784         case WM_NCACTIVATE:
02785             if (wParam && GetFrontierWindowInfo (hwnd, &hinfo)) {
02786 
02787             //  winpushport(GetDC(hwnd));
02788                 
02789                 WinProcessNCActivateEvent (hwnd, msg, wParam, lParam);
02790                 
02791             //  ReleaseDC(hwnd, getport());
02792             //  winpopport ();
02793                 }
02794 
02795             retval = DefMDIChildProc (hwnd, msg, wParam, lParam);
02796             MESSAGEENDER (MSGDEFAULT);
02797             return (retval);            
02798 
02799         case WM_ACTIVATEAPP:
02800             WinProcessActivateAppEvent (hwnd, msg, wParam, lParam);
02801             return (0);
02802 
02803         case WM_QUERYENDSESSION:
02804             /* Prompt to save the child */
02805             retval = !QueryCloseChild (hwnd);
02806             MESSAGEENDER (MSGOTHER);
02807             return (retval);
02808         
02809         case WM_CLOSE:
02810             /* If its OK to close the child, do so, else ignore */
02811             if (QueryCloseChild (hwnd))
02812                 {
02813                 retval = DefMDIChildProc (hwnd, msg, wParam, lParam);
02814                 MESSAGEENDER (MSGDEFAULT);
02815                 return (retval);            
02816                 }
02817             else
02818                 break;
02819 
02820         case WM_SETFOCUS:
02821             /*  See of editor needs focus  **/
02822             retval = DefMDIChildProc (hwnd, msg, wParam, lParam);
02823             MESSAGEENDER (MSGDEFAULT);
02824             return (retval);            
02825 
02826         case WM_LBUTTONDOWN:
02827         case WM_RBUTTONDOWN:
02828         //  setport(GetDC(hwnd));
02829 
02830             setmousedoubleclickstatus(false);
02831             WinProcessMouseEvent (hwnd, msg, wParam, lParam);
02832         //  ReleaseDC(hwnd, getport());
02833         //  setport (NULL);
02834             break;
02835 
02836         case WM_LBUTTONDBLCLK:
02837         case WM_RBUTTONDBLCLK:
02838         //  setport(GetDC(hwnd));
02839             setmousedoubleclickstatus(true);
02840             WinProcessMouseEvent (hwnd, msg, wParam, lParam);
02841         //  ReleaseDC(hwnd, getport());
02842         //  setport (NULL);
02843             break;
02844         
02845         // For the normal left mouse button do not trap or otherwise interfere
02846         // with the normal NC behavior.
02847         //case WM_NCLBUTTONDOWN:
02848         //case WM_NCLBUTTONDBLCLK:
02849 
02850     
02851         case WM_NCRBUTTONDOWN:
02852         case WM_NCMBUTTONDOWN:
02853             if ((wParam == HTERROR) || (wParam == HTNOWHERE) || (wParam == HTTRANSPARENT)) {
02854                 retval = DefMDIChildProc (hwnd, msg, wParam, lParam);
02855                 MESSAGEENDER (MSGDEFAULT);
02856                 return (retval);            
02857                 }
02858 
02859             WinProcessMouseEvent (hwnd, msg, wParam, lParam);
02860             break;
02861 
02862         case WM_NCRBUTTONDBLCLK:
02863         case WM_NCMBUTTONDBLCLK:
02864             if ((wParam == HTERROR) || (wParam == HTNOWHERE) || (wParam == HTTRANSPARENT)) {
02865                 retval = DefMDIChildProc (hwnd, msg, wParam, lParam);
02866                 MESSAGEENDER (MSGDEFAULT);
02867                 return (retval);            
02868                 }
02869 
02870             setmousedoubleclickstatus(true);
02871             WinProcessMouseEvent (hwnd, msg, wParam, lParam);
02872             break;
02873 
02874         case WM_KEYDOWN:
02875             if (!WinMapSpecialKey (&wParam))
02876                 {
02877                 retval = DefMDIChildProc (hwnd, msg, wParam, lParam);
02878                 MESSAGEENDER (MSGDEFAULT);
02879                 return (retval);            
02880                 }
02881             // fall through to WM_CHAR case with updated wParam
02882 
02883         case WM_CHAR:
02884 // 5.0a24 rab: why are we trapping this - blocks Alt-space for menu etc.        case WM_SYSCHAR:
02885         //  setport(GetDC(hwnd));
02886             WinProcessKeyboardEvent (hwnd, msg, wParam, lParam);
02887         //  ReleaseDC(hwnd, getport());
02888         //  setport (NULL);
02889             break;
02890 
02891         case WM_PAINT:
02892             if (GetFrontierWindowInfo (hwnd, &hinfo)) { // window is ready for updating
02893             //  PAINTSTRUCT ps;
02894             //  setport(BeginPaint (hwnd, &ps));
02895                 WinProcessPaintEvent (hwnd, msg, wParam, lParam);
02896             //  ValidateRect (hwnd, NULL);
02897             //  EndPaint (hwnd, &ps);
02898             //  setport (NULL);
02899             //  ValidateRect (hwnd, NULL);
02900                 break;
02901                 }
02902 
02903             retval = DefMDIChildProc (hwnd, msg, wParam, lParam);
02904             MESSAGEENDER (MSGDEFAULT);
02905             return (retval);            
02906 
02907         case WM_COMMAND:
02908         //  setport(GetDC(hwnd));
02909             WinProcessCommandEvent (hwnd, msg, wParam, lParam);
02910         //  ReleaseDC(hwnd, getport());
02911         //  setport (NULL);
02912             break;
02913 
02914         case WM_HSCROLL:
02915         //  setport(GetDC(hwnd));
02916             WinProcessScrollEvent (hwnd, msg, wParam, lParam, false);
02917         //  ReleaseDC(hwnd, getport());
02918         //  setport (NULL);
02919             break;
02920 
02921         case WM_VSCROLL:
02922         //  setport(GetDC(hwnd));
02923             WinProcessScrollEvent (hwnd, msg, wParam, lParam, true);
02924         //  ReleaseDC(hwnd, getport());
02925         //  setport (NULL);
02926             break;
02927 
02928         default:
02929             /* Again, since the MDI default behaviour is a little different,
02930              * call DefMDIChildProc instead of DefWindowProc()
02931              */
02932             retval = DefMDIChildProc (hwnd, msg, wParam, lParam);
02933             MESSAGEENDER (MSGDEFAULT);
02934             return (retval);            
02935     }
02936 
02937     MESSAGEENDER (FALSE);
02938     return FALSE;
02939 }
02940 
02941 #if (MEMTRACKER == 1)
02942 extern void displaymemtrack ();
02943 #endif
02944 
02945 
02946 #if (FRONTIERCOM == 1)
02947 typedef int (WINAPI * tycominit) (HINSTANCE hInstance, 
02948                               HINSTANCE hPrevInstance,
02949                               LPSTR lpCmdLine, 
02950                               int nCmdShow, XDLLProcTable * calltable);
02951 
02952 typedef void (WINAPI * tycomclear) ();
02953 
02954 //extern int WINAPI comInit(HINSTANCE hInstance, 
02955 //                              HINSTANCE hPrevInstance,
02956 //                              LPSTR lpCmdLine, 
02957 //                              int nCmdShow, XDLLProcTable * calltable);
02958 //extern int comClear ();
02959 typedef struct tyComServerInfo {
02960     tycominit cominit;
02961     tycomclear comclear;
02962     XDLLProcTable  calltable;
02963     HANDLE hCOMModule;
02964     HINSTANCE   hInstance;
02965     HINSTANCE   hPrevInstance;
02966     LPSTR       lpCmdLine;
02967     int         nCmdShow;
02968     } tyComServerInfo;
02969 
02970 tyComServerInfo gcomServerInfo;
02971 
02972 Handle COMSYSModule() {
02973     return (gcomServerInfo.hCOMModule);
02974     } /*COMSYSModule*/
02975 
02976 
02977 boolean initCOM ()
02978 {
02979     if ( !flcominitialized )
02980     {
02981         LPVOID reserved = NULL;
02982         HRESULT err;
02983     
02984         err = CoInitialize( reserved );
02985     
02986         if ( SUCCEEDED( err ) )
02987         {
02988             flcominitialized = true;
02989             return (true);
02990         }
02991         else
02992             return (false);
02993     }
02994 
02995     return (true);
02996 }
02997 
02998 void shutdownCOM ()
02999 {
03000     CoUninitialize();
03001     flcominitialized = false;
03002 }
03003 
03004 
03005 Handle COMStartup () {
03006 
03007     initCOM();
03008 
03009     gcomServerInfo.hCOMModule = LoadLibrary ("COMDLL.DLL");
03010     
03011     if (gcomServerInfo.hCOMModule == NULL)
03012         gcomServerInfo.hCOMModule = LoadLibrary ("DLLS\\COMDLL.DLL");
03013         
03014     if (gcomServerInfo.hCOMModule == NULL)
03015         gcomServerInfo.hCOMModule = LoadLibrary ("..\\DLLS\\COMDLL.DLL");
03016 
03017     if (gcomServerInfo.hCOMModule != NULL) {
03018         gcomServerInfo.cominit = (tycominit) GetProcAddress (gcomServerInfo.hCOMModule, "comInit");
03019         gcomServerInfo.comclear = (tycominit) GetProcAddress (gcomServerInfo.hCOMModule, "comClear");
03020 
03021         if ((gcomServerInfo.cominit != NULL) && (gcomServerInfo.comclear != NULL)) {
03022 
03023             fillcalltable(&gcomServerInfo.calltable);
03024             
03025             (*(gcomServerInfo.cominit)) (gcomServerInfo.hInstance, gcomServerInfo.hPrevInstance, gcomServerInfo.lpCmdLine, gcomServerInfo.nCmdShow, &gcomServerInfo.calltable);
03026             }
03027         }
03028 
03029     return (gcomServerInfo.hCOMModule);
03030     } /*COMStartup*/
03031 
03032 boolean COMShutdown () {
03033     shutdownCOM();
03034 
03035     if ((gcomServerInfo.cominit != NULL) && (gcomServerInfo.comclear != NULL))
03036         (*(gcomServerInfo.comclear)) ();
03037 
03038     if (gcomServerInfo.hCOMModule != NULL)
03039         FreeLibrary (gcomServerInfo.hCOMModule);
03040 
03041     gcomServerInfo.cominit = NULL;
03042     gcomServerInfo.comclear = NULL;
03043     gcomServerInfo.hCOMModule = NULL;
03044 
03045     return (true);
03046     } /*COMShutdown*/
03047 
03048 #endif
03049 
03050 //#ifdef PIKE
03051 
03052     /* 9/24/01 RAB */
03053     #define PACKVERSION(major,minor) MAKELONG(minor,major)
03054 
03055     DWORD GetDllVersion(LPCTSTR lpszDllName)
03056         {
03057 
03058         HINSTANCE hinstDll;
03059         DWORD dwVersion = 0;
03060 
03061         hinstDll = LoadLibrary(lpszDllName);
03062         
03063         if(hinstDll)
03064             {
03065             DLLGETVERSIONPROC pDllGetVersion;
03066 
03067             pDllGetVersion = (DLLGETVERSIONPROC) GetProcAddress(hinstDll, "DllGetVersion");
03068 
03069     /*Because some DLLs might not implement this function, you
03070       must test for it explicitly. Depending on the particular 
03071       DLL, the lack of a DllGetVersion function can be a useful
03072       indicator of the version.
03073     */
03074             if(pDllGetVersion)
03075                 {
03076                 DLLVERSIONINFO dvi;
03077                 HRESULT hr;
03078 
03079                 ZeroMemory(&dvi, sizeof(dvi));
03080                 dvi.cbSize = sizeof(dvi);
03081 
03082                 hr = (*pDllGetVersion)(&dvi);
03083 
03084                 if(SUCCEEDED(hr))
03085                     {
03086                     dwVersion = PACKVERSION(dvi.dwMajorVersion, dvi.dwMinorVersion);
03087                     }
03088                 }
03089         
03090             FreeLibrary(hinstDll);
03091             }
03092         return dwVersion;
03093         }
03094 
03095 //#endif
03096 
03097 int CALLBACK WinMain (
03098         HINSTANCE   hInstance,
03099         HINSTANCE   hPrevInstance,
03100         LPSTR       lpCmdLine,
03101         int         nCmdShow
03102         )
03103     {
03104 
03105 //#ifdef PIKE
03106 
03107     NOTIFYICONDATA statusIconData;
03108 
03109 //#endif
03110 
03111     #if (FRONTIERCOM == 1)
03112         gcomServerInfo.hInstance = hInstance;
03113         gcomServerInfo.hPrevInstance = hPrevInstance;
03114         gcomServerInfo.lpCmdLine = lpCmdLine;
03115         gcomServerInfo.nCmdShow = nCmdShow;
03116 
03117         COMStartup();
03118     #endif
03119 
03120     #if (FRONTIERWEB == 1)
03121         webappStartup ();
03122 
03123         OleInitialize(NULL);
03124 
03125         InitCommonControls();
03126     #endif
03127 
03128 #ifdef PIKE /*7.0b26 PBS*/
03129 #ifndef OPMLEDITOR  // 2005-04-06 dluebbert
03130     wm_frontieropenfile = RegisterWindowMessage ("PikeOpenFile");
03131 #else // OPMLEDITOR
03132     wm_frontieropenfile = RegisterWindowMessage ("OpmlOpenFile");
03133 #endif // OPMLEDITOR
03134 #else
03135     wm_frontieropenfile = RegisterWindowMessage ("FrontierOpenFile");
03136 #endif
03137 
03138     wm_findmsgstring = RegisterWindowMessage (FINDMSGSTRING);
03139     
03140     wm_startreplace = RegisterWindowMessage (sz_frontierstartreplace);
03141     
03142     wm_startsearch = RegisterWindowMessage (sz_frontierstartsearch);
03143 
03144 #ifdef PIKE 
03145     
03146 #ifndef OPMLEDITOR
03147     frontiermutex = CreateMutex (NULL, true, "PikeInstance");
03148 #else //OPMLEDITOR
03149     frontiermutex = CreateMutex (NULL, true, "OpmlInstance");
03150 #endif // OPMLEDITOR
03151 
03152 #else
03153     frontiermutex = CreateMutex (NULL, true, "FrontierInstance");
03154 #endif
03155 
03156     if (GetLastError () == ERROR_ALREADY_EXISTS) {
03157         bigstring inputFile;
03158 
03159         //5.0b9 rab: It is not allowed to share memory directly between processes
03160         //under NT so instead we just write the command line to the registry then
03161         //read it back when processing the openfile message.
03162 
03163         copyctopstring (lpCmdLine, inputFile);
03164 
03165         setProfileString ("\x0b" "DeskTopFile", inputFile);
03166 
03167 //      MessageBox (NULL, lpCmdLine, "Frontier Exists", MB_OK);
03168 
03169         SendMessage (HWND_BROADCAST, wm_frontieropenfile, 0, (LPARAM) true);
03170         
03171         return 0;
03172         }
03173     
03174     hInst = hInstance;
03175     shellinstance = hInstance;
03176 
03177     /* If this is the first instance of the app. register window classes */
03178     if (!hPrevInstance) {
03179         if (!InitializeApplication ())
03180             return 0;
03181         }
03182     
03183     /* Create the frame and do other initialization */      
03184     if (!InitializeInstance (lpCmdLine, nCmdShow))
03185         return 0;
03186 
03187 //#ifdef PIKE
03188     
03189     if(GetDllVersion(TEXT("shell32.dll")) >= PACKVERSION(5,0))
03190         {
03191         statusIconData.cbSize = sizeof(NOTIFYICONDATA);
03192         }
03193     else
03194         {
03195         statusIconData.cbSize = sizeof(NOTIFYICONDATA);//NOTIFYICONDATA_V1_SIZE;
03196         }
03197 
03198     statusIconData.hIcon = hTrayIconApp;
03199     statusIconData.uFlags = NIF_ICON | NIF_TIP | NIF_MESSAGE;
03200     statusIconData.uID = 5335;
03201     statusIconData.hWnd = shellframewindow;
03202     statusIconData.uCallbackMessage = FWM_SYSTRAYICON;
03203 
03204 #ifdef PIKE
03205 #ifndef OPMLEDITOR
03206     strcpy (statusIconData.szTip, "Radio UserLand");
03207 #else  // OPMLEDITOR
03208     strcpy (statusIconData.szTip, "OPML");
03209 #endif // OPMLEDITOR
03210 #else
03211     strcpy (statusIconData.szTip, "Frontier"); // 2005-04-02 creedon: removed UserLand
03212 #endif
03213 
03214     Shell_NotifyIcon (NIM_ADD, &statusIconData);
03215 
03216 //#endif
03217 
03218     /* Enter main message loop */
03219     shellmaineventloop ();
03220 
03221 //#ifdef PIKE
03222 
03223     Shell_NotifyIcon (NIM_DELETE, &statusIconData);
03224 
03225 //#endif
03226 
03227     #if (MEMTRACKER == 1)
03228         displaymemtrack ();
03229     #endif
03230 
03231     fwsNetEventShutDown();
03232 
03233     #if (FRONTIERWEB==1)
03234         OleUninitialize();
03235 
03236         webappShutdown ();
03237 
03238     #endif
03239 
03240     #if (FRONTIERCOM == 1)
03241         COMShutdown ();
03242     #endif
03243 
03244     #if (MESSAGETRACKSYSTEM == 1)
03245         fclose (errfile);
03246     #endif
03247     
03248     if (frontiermutex != NULL)
03249         verify (CloseHandle (frontiermutex));
03250 
03251     return 0;
03252 }  /*WinMain*/
03253 
03254 
03255 
03256 BOOL fAbort;            /* TRUE if the user has aborted the print job    */
03257 HWND hwndPDlg;          /* Handle to the cancel print dialog             */
03258 CHAR szDevice[160];     /* Contains the device, the driver, and the port */
03259 PSTR szDriver;          /* Pointer to the driver name                    */
03260 PSTR szPort;            /* Port, ie, LPT1                                */
03261 PSTR szTitle;           /* Global pointer to job title                   */
03262 INT iPrinter = 0;       /* level of available printer support.           */
03263                         /* 0 - no printer available                      */
03264                         /* 1 - printer available                         */
03265                         /* 2 - driver supports 3.0 device initialization */
03266 HANDLE hInitData=NULL;  /* handle to initialization data                 */
03267 
03268 CHAR szExtDeviceMode[] = "EXTDEVICEMODE";
03269 
03270 /****************************************************************************
03271  *                                                                          *
03272  *  FUNCTION   : GetPrinterDC ()                                            *
03273  *                                                                          *
03274  *  PURPOSE    : Creates a printer display context for the default device.  *
03275  *               As a side effect, it sets the szDevice and szPort variables*
03276  *               It also sets iPrinter to the supported level of printing.  *
03277  *                                                                          *
03278  *  RETURNS    : HDC   - A handle to printer DC.                            *
03279  *                                                                          *
03280  ****************************************************************************/
03281 HDC GetPrinterDC(BOOL bInformation)
03282 {
03283     HDC      hdc;
03284 #if defined(_MAC)
03285     iPrinter = 0;
03286 
03287     if (bInformation)
03288         hdc = CreateIC("PRINTER", NULL, NULL, NULL);
03289     else
03290         hdc = CreateDC("PRINTER", NULL, NULL, NULL);
03291 
03292     if (hdc)
03293         iPrinter = 1;
03294 
03295 #else
03296 
03297     LPDEVMODE  lpdevmode = NULL;
03298 
03299     iPrinter = 0;
03300 
03301     /* Get the printer information from win.ini into a buffer and
03302      * null terminate it.
03303      */
03304     GetProfileString ( "windows", "device", "" ,szDevice, sizeof(szDevice));
03305     for (szDriver = szDevice; *szDriver && *szDriver != ','; szDriver++)
03306         ;
03307     if (*szDriver)
03308         *szDriver++ = 0;
03309 
03310     /* From the current position in the buffer, null teminate the
03311      * list of ports
03312      */
03313     for (szPort = szDriver; *szPort && *szPort != ','; szPort++)
03314         ;
03315     if (*szPort)
03316         *szPort++ = 0;
03317 
03318     /* if the device, driver and port buffers all contain meaningful data,
03319      * proceed.
03320      */
03321     if (!*szDevice || !*szDriver || !*szPort){
03322         *szDevice = 0;
03323         return NULL;
03324     }
03325 
03326     /* Create the printer display context */
03327     if (hInitData){
03328         /* Get a pointer to the initialization data */
03329         lpdevmode = (LPDEVMODE) LocalLock (hInitData);
03330 
03331         if (lstrcmp (szDevice, (LPSTR)lpdevmode)){
03332             /* User has changed the device... cancel this setup, as it is
03333              * invalid (although if we worked harder we could retain some
03334              * of it).
03335              */
03336             lpdevmode = NULL;
03337             LocalUnlock (hInitData);
03338             LocalFree (hInitData);
03339             hInitData = NULL;
03340         }
03341     }
03342 
03343     if (bInformation)
03344       hdc = CreateIC (szDriver, szDevice, szPort, lpdevmode);
03345    else
03346       hdc = CreateDC (szDriver, szDevice, szPort, lpdevmode);
03347 
03348     /* Unlock initialization data */
03349     if (hInitData)
03350         LocalUnlock (hInitData);
03351 
03352     if (!hdc)
03353         return NULL;
03354 
03355 
03356     iPrinter = 1;
03357 
03358     /* Find out if ExtDeviceMode() is supported and set flag appropriately */
03359     if (GetProcAddress (LoadLibrary(szDriver), szExtDeviceMode))
03360         iPrinter = 2;
03361 
03362 #endif
03363 
03364     return hdc;
03365 
03366 }
03367 
03368 
03369 
03370 
03371 EventAvail (unsigned short mask, EventRecord * ev)
03372     {
03373     MSG msg;
03374     HWND hwnd;
03375 
03376     hwnd = NULL;
03377 
03378     if ((mask & mDownMask) == mDownMask) {
03379         if ((PeekMessage (&msg, hwnd, WM_LBUTTONDOWN, WM_LBUTTONDOWN, PM_NOREMOVE)) ||
03380             (PeekMessage (&msg, hwnd, WM_RBUTTONDOWN, WM_RBUTTONDOWN, PM_NOREMOVE)) ||
03381             (PeekMessage (&msg, hwnd, WM_MBUTTONDOWN, WM_MBUTTONDOWN, PM_NOREMOVE)))
03382             return (true);
03383         }
03384 
03385     
03386     if ((mask & mUpMask) == mUpMask) {
03387         if ((PeekMessage (&msg, hwnd, WM_LBUTTONUP, WM_LBUTTONDBLCLK, PM_NOREMOVE)) ||
03388             (PeekMessage (&msg, hwnd, WM_RBUTTONUP, WM_RBUTTONDBLCLK, PM_NOREMOVE)) ||
03389             (PeekMessage (&msg, hwnd, WM_MBUTTONUP, WM_MBUTTONDBLCLK, PM_NOREMOVE)))
03390             return (true);
03391         }
03392 
03393     
03394     if ((mask & keyDownMask) == keyDownMask) {
03395         if ((PeekMessage (&msg, hwnd, WM_KEYDOWN, WM_KEYDOWN, PM_NOREMOVE)) ||
03396             (PeekMessage (&msg, hwnd, WM_SYSKEYDOWN, WM_SYSKEYDOWN, PM_NOREMOVE)))
03397             return (true);
03398         }
03399 
03400 
03401     if (((mask & keyUpMask) == keyUpMask) || ((mask & autoKeyMask) == autoKeyMask)) {
03402         if (PeekMessage (&msg, hwnd, WM_KEYUP, WM_KEYLAST, PM_NOREMOVE))
03403             return (true);
03404         }
03405 
03406     
03407     if ((mask & updateMask) == updateMask) {
03408         if (PeekMessage (&msg, hwnd, WM_PAINT, WM_PAINT, PM_NOREMOVE))
03409             return (true);
03410         }
03411 
03412 /*  diskMask  */
03413         
03414     if ((mask & activMask) == activMask) {
03415         if (PeekMessage (&msg, hwnd, WM_ACTIVATE, WM_ACTIVATE, PM_NOREMOVE))
03416         if (PeekMessage (&msg, hwnd, WM_MDIACTIVATE, WM_MDIACTIVATE, PM_NOREMOVE))
03417             return (true);
03418         }
03419 
03420 
03421     if (((mask & highLevelEventMask) == highLevelEventMask) || ((mask & osMask) == osMask)){
03422         if ((PeekMessage (&msg, hwnd, WM_NULL, WM_ACTIVATE-1, PM_NOREMOVE)) ||
03423             (PeekMessage (&msg, hwnd, WM_ACTIVATE+1, WM_PAINT-1, PM_NOREMOVE)) ||
03424             (PeekMessage (&msg, hwnd, WM_PAINT+1, WM_KEYFIRST-1, PM_NOREMOVE)) ||
03425             (PeekMessage (&msg, hwnd, WM_KEYLAST+1, WM_COMMAND-1, PM_NOREMOVE)) ||
03426             (PeekMessage (&msg, hwnd, WM_SYSCOMMAND+1, WM_MOUSEFIRST-1, PM_NOREMOVE)) ||
03427             (PeekMessage (&msg, hwnd, WM_MOUSELAST+1, WM_MDIACTIVATE-1, PM_NOREMOVE)) ||
03428             (PeekMessage (&msg, hwnd, WM_MDIACTIVATE+1, WM_USER-1, PM_NOREMOVE)))
03429             return (true);
03430         }
03431 
03432     return (false);
03433     }
03434 

Generated on Wed May 31 18:19:47 2006 for frontierkernel 10.1.10a by  doxygen 1.4.6