1 /***********************************************************************
2 *
3 * ***** *** ***
4 * * * * * *
5 * * *** ***
6 * * * * * *
7 * ***** *** ***
8 *
9 * A FREE Finite Elements Analysis Program in ANSI C for the Windows OS.
10 *
11 * Composed and edited and copyright by
12 * Professor Dr.-Ing. Frank Rieg, University of Bayreuth, Germany
13 *
14 * eMail:
15 * frank.rieg@uni-bayreuth.de
16 * dr.frank.rieg@t-online.de
17 *
18 * V15.0 November 18, 2015
19 *
20 * This program is free software; you can redistribute it and/or modify
21 * it under the terms of the GNU General Public License as published by
22 * the Free Software Foundation; either version 2, or (at your option)
23 * any later version.
24 *
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 * GNU General Public License for more details.
29 *
30 * You should have received a copy of the GNU General Public License
31 * along with this program; see the file COPYING. If not, write to
32 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
33 ***********************************************************************/
34 /***********************************************************************
35 * Z88G fuer Windows
36 * wandelt COSMOS-Files oder NASTRAN-Files
37 * aus Pro/MESH (PTC, Pro/ENGINEER)
38 * in Z88I*.TXT- Files fuer die Z88- Elementtypen:
39 * - Scheiben Nr. 7 ( 8 Knoten) und Nr.14 (6 Knoten)
40 * - Tetraeder Nr.16 (10 Knoten) und Nr.17 (4 Knoten)
41 * - Platten Nr.20 ( 8 Knoten) und Nr.18 (6 Knoten)
42 * - Torus Nr. 8 ( 8 Knoten) und Nr.15 (6 Knoten)
43 * - Schalen Nr.23 ( 8 Knoten) und Nr.24 (6 Knoten)
44 * 7.3.2017 Rieg
45 ***********************************************************************/
46 /***********************************************************************
47 * Windows
48 ***********************************************************************/
49 #ifdef FR_WIN
50 #include <z88g.h>
51 #include <windows.h>
52 #include <commctrl.h>
53 #include <stdio.h> /* FILE */
54 #include <stdlib.h> /* exit */
55 #include <string.h> /* strcpy */
56 #endif
57
58 /***********************************************************************
59 * Window- Function-Declarationen
60 ***********************************************************************/
61 LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
62
63 HWND InitToolBar (HWND hParent);
64
65 HFONT EzCreateFont (HDC hdc, char * szFaceName, int iDeciPtHeight,
66 int iDeciPtWidth, int iAttributes, BOOL fLogRes);
67
68 /***********************************************************************
69 * externe Variable
70 ***********************************************************************/
71 HDC hDC;
72 HINSTANCE hInstance;
73 HFONT hFont;
74 HWND hToolBar;
75 HMENU hMenuGer,hMenuEng;
76 HCURSOR waitcur;
77
78 /***********************************************************************
79 * Functions
80 ***********************************************************************/
81 int cosm88(void);
82 int nast88(void);
83 int dnas88(void);
84 int wrim88g(FR_INT4,int);
85 int wlog88g(FR_INT4,int);
86 int ale88g(int);
87 int lan88g(void);
88
89 /****************************************************************************
90 * globale Variable
91 ****************************************************************************/
92 /*--------------------------------------------------------------------------
93 * Files
94 *-------------------------------------------------------------------------*/
95 /*--------------------------------------------------------------------------
96 * Files
97 *-------------------------------------------------------------------------*/
98 FILE *fdyn,*fwlo,*fpro,*fin,*fi1,*fi2,*fi5,*fcfg;
99
100 /*
101 ** fdyn= z88.dyn
102 ** fwlo= z88g.log
103 ** fpro= z88g.cos oder z88g.nas
104 ** fin = z88g.in
105 ** fi1 = z88i1.txt
106 ** fi2 = z88i2.txt
107 ** fi5 = z88i5.txt
108 ** fcfg= z88com.cfg
109 */
110
111 char cdyn[8] = "z88.dyn";
112 char clgd[9] = "z88g.log";
113 char ccco[9] = "z88g.cos";
114 char cnas[9] = "z88g.nas";
115 char cin[8] = "z88g.in";
116 char ci1[10] = "z88i1.txt";
117 char ci2[10] = "z88i2.txt";
118 char ci5[10] = "z88i5.txt";
119 char cfg[11] = "z88com.cfg";
120
121 /*--------------------------------------------------------------------------
122 * Char-Arrays
123 *-------------------------------------------------------------------------*/
124 char cstore[256];
125 char cbcall[128];
126 char cbpref[128];
127 char cbhelp[512];
128 char callbrow[512];
129 char cmess[512];
130 char cbytes[128];
131 char *comli;
132
133 /*--------------------------------------------------------------------------
134 * Variable
135 *-------------------------------------------------------------------------*/
136 FR_INT4 IFFLAG= 0,ICFLAG= 0,LANG=2;
137
138 int ifmode= IDM_VOLU;
139 int iffile= IDM_NAST;
140
141 int *pp;
142
143 /***********************************************************************
144 * WinMain
145 ***********************************************************************/
WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,PSTR lpszCmdLine,int nCmdShow)146 int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
147 PSTR lpszCmdLine, int nCmdShow)
148 {
149 HWND hWnd;
150 MSG msg;
151 WNDCLASSEX wndclass;
152
153 char capname[10];
154
155 /***********************************************************************
156 * Handles kommen lassen, Window oeffnen
157 ***********************************************************************/
158 comli= (char *)calloc(256,sizeof(char));
159 comli= lpszCmdLine;
160
161 strcpy(capname,"Z88G");
162
163 wndclass.cbSize = sizeof(wndclass);
164 wndclass.style = CS_HREDRAW | CS_VREDRAW;
165 wndclass.lpfnWndProc = WndProc;
166 wndclass.cbClsExtra = 0;
167 wndclass.cbWndExtra = 0;
168 wndclass.hInstance = hInstance;
169 wndclass.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(ICO_Z88G));
170 wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
171 wndclass.hbrBackground = CreateSolidBrush(RGB(255,255,255));
172 wndclass.lpszMenuName = capname;
173 wndclass.lpszClassName = capname;
174 wndclass.hIconSm = LoadIcon(hInstance, MAKEINTRESOURCE(ICO_Z88G));
175
176 RegisterClassEx(&wndclass);
177
178 hWnd = CreateWindow(capname,"Z88 3D-Converter Z88G",
179 WS_OVERLAPPEDWINDOW,
180 0, 150,
181 540, 346,
182 NULL, NULL, hInstance, NULL);
183
184 InitCommonControls();
185
186 ShowWindow(hWnd, nCmdShow);
187 UpdateWindow(hWnd);
188
189 while(GetMessage(&msg, NULL, 0, 0))
190 {
191 TranslateMessage(&msg);
192 DispatchMessage(&msg);
193 }
194
195 DeleteObject(hFont);
196
197 return msg.wParam;
198 }
199
200 /***********************************************************************
201 * Main Window Procedure
202 ***********************************************************************/
WndProc(HWND hWnd,UINT Message,WPARAM wParam,LPARAM lParam)203 LRESULT CALLBACK WndProc(HWND hWnd, UINT Message,
204 WPARAM wParam, LPARAM lParam)
205 {
206 extern HDC hDC;
207 extern HINSTANCE hInstance;
208 extern HFONT hFont;
209 extern HWND hToolBar;
210 extern HMENU hMenuGer,hMenuEng;
211 extern HCURSOR waitcur;
212
213 extern FR_INT4 LANG;
214
215 extern int ifmode;
216 extern int iffile;
217
218 extern char cstore[];
219 extern char cbcall[];
220 extern char cbpref[];
221 extern char callbrow[];
222 extern char cbhelp[];
223 extern char cmess[];
224 extern char *comli;
225
226 HMENU hMenu;
227
228 PAINTSTRUCT ps;
229
230 static int ixClient,iyClient;
231
232 int imess,iret,ipara1=0,ipara2=0;
233
234 size_t laenge;
235
236 /*----------------------------------------------------------------------
237 * Los gehts
238 *---------------------------------------------------------------------*/
239 switch (Message)
240 {
241 /*----------------------------------------------------------------------
242 * case WM_CREATE
243 *---------------------------------------------------------------------*/
244 case WM_CREATE:
245 /*======================================================================
246 * hInstance kommen lassen
247 *=====================================================================*/
248 #ifdef FR_XWIN64
249 hInstance= (HINSTANCE)GetWindowLongPtr(hWnd,GWLP_HINSTANCE);
250 #endif
251 #ifdef FR_XWIN32
252 hInstance= (HINSTANCE)GetWindowLong(hWnd,GWL_HINSTANCE);
253 #endif
254
255 /*======================================================================
256 * Wartecursor anlegen
257 *=====================================================================*/
258 waitcur= LoadCursor(hInstance,MAKEINTRESOURCE(CUR_Z88G));
259
260 /*======================================================================
261 * Sprache feststellen
262 *=====================================================================*/
263 iret= lan88g();
264 if(iret != 0)
265 {
266 ale88g(iret);
267 PostQuitMessage(0);
268 return(1);
269 }
270
271 hMenuGer= LoadMenu(hInstance,"GERMAN");
272 hMenuEng= LoadMenu(hInstance,"ENGLISH");
273
274 if(LANG == 1) SetMenu(hWnd,hMenuGer);
275 if(LANG == 2) SetMenu(hWnd,hMenuEng);
276
277 /*===========================================================================
278 * IFFLAG setzen
279 *==========================================================================*/
280 if(iffile == IDM_NAST) IFFLAG = 2;
281
282 /*===========================================================================
283 * ICFLAG setzen
284 *==========================================================================*/
285 if(ifmode == IDM_VOLU) ICFLAG = 1;
286
287 /*======================================================================
288 * Toolbar
289 *=====================================================================*/
290 hToolBar= InitToolBar(hWnd);
291
292 /*======================================================================
293 * Commandline auswerten
294 *=====================================================================*/
295 if( (strstr(comli,"-nastran"))!= NULL)
296 {
297 ipara1= 1;
298 IFFLAG= 2;
299 }
300 if( (strstr(comli,"-cosmos"))!= NULL)
301 {
302 ipara1= 1;
303 IFFLAG= 1;
304 }
305
306 if( (strstr(comli,"-volume"))!= NULL)
307 {
308 ipara2= 1;
309 ICFLAG= 1;
310 }
311 if( (strstr(comli,"-pstress"))!= NULL)
312 {
313 ipara2= 1;
314 ICFLAG= 2;
315 }
316 if( (strstr(comli,"-plate"))!= NULL)
317 {
318 ipara2= 1;
319 ICFLAG= 3;
320 }
321 if( (strstr(comli,"-torus"))!= NULL)
322 {
323 ipara2= 1;
324 ICFLAG= 4;
325 }
326 if( (strstr(comli,"-shell"))!= NULL)
327 {
328 ipara2= 1;
329 ICFLAG= 6;
330 }
331
332 if(ipara1 == 1 && ipara2 == 1)
333 PostMessage(hWnd,WM_COMMAND,IDM_GO,0);
334
335 return 0; /* Ende WM_CREATE */
336
337 /*----------------------------------------------------------------------
338 * case WM_INITMENU
339 *---------------------------------------------------------------------*/
340 case WM_INITMENU:
341 hMenu= GetMenu(hWnd); /* muss rein */
342
343 CheckMenuItem(hMenu,IDM_NAST, MF_UNCHECKED | MF_BYCOMMAND);
344 CheckMenuItem(hMenu,IDM_COSM, MF_UNCHECKED | MF_BYCOMMAND);
345 CheckMenuItem(hMenu,iffile, MF_CHECKED | MF_BYCOMMAND);
346
347 CheckMenuItem(hMenu,IDM_VOLU, MF_UNCHECKED | MF_BYCOMMAND);
348 CheckMenuItem(hMenu,IDM_SHEI, MF_UNCHECKED | MF_BYCOMMAND);
349 CheckMenuItem(hMenu,IDM_PLAT, MF_UNCHECKED | MF_BYCOMMAND);
350 CheckMenuItem(hMenu,IDM_TORU, MF_UNCHECKED | MF_BYCOMMAND);
351 CheckMenuItem(hMenu,ifmode, MF_CHECKED | MF_BYCOMMAND);
352 return 0;
353
354 /*----------------------------------------------------------------------
355 * case WM_MOVE
356 *---------------------------------------------------------------------*/
357 case WM_MOVE:
358 return 0;
359
360 /*----------------------------------------------------------------------
361 * case WM_SIZE
362 *---------------------------------------------------------------------*/
363 case WM_SIZE:
364 iyClient= HIWORD(lParam);
365 ixClient= LOWORD(lParam);
366 return 0;
367
368 /*----------------------------------------------------------------------
369 * WM_NOTIFY
370 *---------------------------------------------------------------------*/
371 case WM_NOTIFY:
372 {
373 LPNMHDR pnmh= (LPNMHDR) lParam;
374 LPSTR pReply;
375
376 if(pnmh->code == TTN_NEEDTEXT)
377 {
378 LPTOOLTIPTEXT lpttt= (LPTOOLTIPTEXT) lParam;
379
380 switch(lpttt->hdr.idFrom)
381 {
382 case ITC_GO:
383 if(LANG == 1) pReply= "Berechne";
384 if(LANG == 2) pReply= "Run";
385 break;
386
387 case ITC_NAST:
388 if(LANG == 1) pReply= "Konvertiere NASTRAN-Datei Z88G.NAS";
389 if(LANG == 2) pReply= "Convert the NASTRAN file Z88G.NAS";
390 break;
391
392 case ITC_COSM:
393 if(LANG == 1) pReply= "Konvertiere COSMOS-Datei Z88G.COS";
394 if(LANG == 2) pReply= "Convert the COSMOS file Z88G.COS";
395 break;
396
397 case ITC_VOLU:
398 if(LANG == 1) pReply=
399 "Konvertiere in Volumenelemente, bei NASTRAN auch mit Fl�chenlast";
400 if(LANG == 2) pReply=
401 "Convert into Volumes, NASTRAN files support surface loads";
402 break;
403
404 case ITC_SHEI:
405 if(LANG == 1) pReply= "Konvertiere in Scheibenelemente";
406 if(LANG == 2) pReply= "Convert into Plane Stress Elements";
407 break;
408
409 case ITC_PLAT:
410 if(LANG == 1) pReply= "Konvertiere in Plattenelemente";
411 if(LANG == 2) pReply= "Convert into Plate Elements";
412 break;
413
414 case ITC_TORU:
415 if(LANG == 1) pReply= "Konvertiere in Toruselemente";
416 if(LANG == 2) pReply= "Convert into Torus Elements";
417 break;
418
419 case ITC_SHEL:
420 if(LANG == 1) pReply= "Konvertiere in Schalenelemente";
421 if(LANG == 2) pReply= "Convert into Shell Elements";
422 break;
423
424
425 case ITC_HELP:
426 if(LANG == 1) pReply= "OnLine-Hilfe fuer 3D-Konverter";
427 if(LANG == 2) pReply= "OnLine Help for 3D converter";
428 break;
429
430 case ITC_XIT:
431 if(LANG == 1) pReply= "Beende";
432 if(LANG == 2) pReply= "Exit";
433 break;
434
435 }
436 lstrcpy(lpttt->szText,pReply);
437 }
438 return 0; /* sehr wichtig */
439 }
440
441 /*----------------------------------------------------------------------
442 * case WM_COMMAND
443 *---------------------------------------------------------------------*/
444 case WM_COMMAND:
445 switch (LOWORD(wParam))
446 {
447
448 /*======================================================================
449 * COMMAND : Wer ist es
450 *=====================================================================*/
451 case IDM_WER:
452 if(LANG == 1) strcpy(cmess,
453 "3D-Konverter Z88G fuer Windows\n\
454 Version 15OS\n\
455 Copyright Univ.-Prof.Dr.-Ing. Frank Rieg,\n\
456 Universitaet Bayreuth, 2017\n\
457 Alle Rechte vorbehalten\n");
458
459 if(LANG == 2) strcpy(cmess,
460 "3D Converter Z88G for Windows\n\
461 Version 15OS\n\
462 Copyright Prof.Dr. Frank Rieg,\n\
463 University of Bayreuth, Germany 2017\n\
464 All rights reserved\n");
465
466 #ifdef FR_XQUAD
467 sprintf(cbytes,"Floats: %d Bytes\n",(int)sizeof(long double));
468 strcat(cmess,cbytes);
469 #endif
470 #ifdef FR_XDOUB
471 sprintf(cbytes,"Floats: %d Bytes\n",(int)sizeof(double));
472 strcat(cmess,cbytes);
473 #endif
474 #ifdef FR_XINT
475 sprintf(cbytes,"Integers: %d Bytes\n",(int)sizeof(int));
476 strcat(cmess,cbytes);
477 #endif
478 #ifdef FR_XLONG
479 sprintf(cbytes,"Integers: %d Bytes\n",(int)sizeof(long));
480 strcat(cmess,cbytes);
481 #endif
482 #ifdef FR_XLOLO
483 sprintf(cbytes,"Integers: %d Bytes\n",(int)sizeof(long long));
484 strcat(cmess,cbytes);
485 #endif
486 sprintf(cbytes,"Pointers: %d Bytes\n",(int)sizeof(pp));
487 strcat(cmess,cbytes);
488
489 MessageBox(NULL,cmess,"Z88G", MB_OK | MB_ICONINFORMATION);
490 return 0;
491
492 /*======================================================================
493 * COMMAND : Xit
494 *=====================================================================*/
495 case IDM_XIT:
496 case ITC_XIT:
497 PostQuitMessage(0);
498 return 0;
499
500 /*======================================================================
501 * COMMAND : Hilfe
502 *=====================================================================*/
503 case ITC_HELP:
504 fcfg= fopen(cfg,"r"); /* Z88COM.CFG oeffnen */
505 if(fcfg == NULL)
506 {
507 if(LANG == 1) strcpy(cmess,
508 "Datei Z88COM.CFG nicht vorhanden oder zerschossen !");
509
510 if(LANG == 2) strcpy(cmess,
511 "File Z88COM.CFG not available or destroyed !");
512 MessageBox(NULL,cmess,"Z88G", MB_OK | MB_ICONHAND);
513 }
514
515 rewind(fcfg);
516
517 fgets(cstore,128,fcfg);
518 fgets(cstore,128,fcfg);
519
520 fgets(cstore,128,fcfg);
521 laenge= strlen(cstore);
522 strncpy(cbpref,cstore,laenge-1);
523 strcat (cbpref,"\0");
524
525 fgets(cstore,128,fcfg);
526 laenge= strlen(cstore);
527 strncpy(cbcall,cstore,laenge-1);
528 strcat (cbcall,"\0");
529
530 fclose(fcfg);
531
532 strcpy(callbrow,cbcall);
533 strcat(callbrow," ");
534 strcat(callbrow,cbpref);
535 if(LANG == 1) strcat(callbrow,"z88mang.pdf");
536 if(LANG == 2) strcat(callbrow,"z88mane.pdf");
537 imess= WinExec(callbrow,SW_SHOW);
538 if(imess < 33)
539 {
540 wlog88g(0L,LOG_NOACROBAT);
541 ale88g(AL_NOACROBAT);
542 }
543 return 0;
544
545 /*======================================================================
546 * COMMAND : Filetyp aus Menue
547 *=====================================================================*/
548 case IDM_NAST:
549 case IDM_COSM:
550 hMenu= GetMenu(hWnd);
551 CheckMenuItem(hMenu,iffile,MF_UNCHECKED | MF_BYCOMMAND);
552 iffile= LOWORD(wParam);
553 CheckMenuItem(hMenu,iffile,MF_CHECKED | MF_BYCOMMAND);
554
555 if (iffile == IDM_COSM)
556 {
557 IFFLAG = 1;
558 SendMessage(hToolBar,TB_CHECKBUTTON,
559 (WPARAM)ITC_COSM,(LPARAM) MAKELONG(TRUE,0) );
560 SendMessage(hToolBar,TB_CHECKBUTTON,
561 (WPARAM)ITC_NAST,(LPARAM) MAKELONG(FALSE,0) );
562 }
563
564 else if(iffile == IDM_NAST)
565 {
566 IFFLAG = 2;
567 SendMessage(hToolBar,TB_CHECKBUTTON,
568 (WPARAM)ITC_COSM,(LPARAM) MAKELONG(FALSE,0) );
569 SendMessage(hToolBar,TB_CHECKBUTTON,
570 (WPARAM)ITC_NAST,(LPARAM) MAKELONG(TRUE,0) );
571 }
572
573 else MessageBox(NULL,"No File !","Z88G", MB_OK | MB_ICONHAND);
574 InvalidateRect(hWnd,NULL,TRUE);
575 return 0;
576
577 /*======================================================================
578 * COMMAND : Filetyp aus Toolbar
579 *=====================================================================*/
580 case ITC_COSM:
581 IFFLAG = 1;
582 iffile = IDM_COSM;
583 InvalidateRect(hWnd,NULL,TRUE);
584 return 0;
585
586 case ITC_NAST:
587 IFFLAG = 2;
588 iffile = IDM_NAST;
589 InvalidateRect(hWnd,NULL,TRUE);
590 return 0;
591
592 /*======================================================================
593 * COMMAND : Mode aus Menue
594 *=====================================================================*/
595 case IDM_VOLU:
596 case IDM_SHEI:
597 case IDM_PLAT:
598 case IDM_TORU:
599 case IDM_SHEL:
600 hMenu= GetMenu(hWnd);
601 CheckMenuItem(hMenu,ifmode,MF_UNCHECKED | MF_BYCOMMAND);
602 ifmode= LOWORD(wParam);
603 CheckMenuItem(hMenu,ifmode,MF_CHECKED | MF_BYCOMMAND);
604
605 if (ifmode == IDM_VOLU)
606 {
607 ICFLAG = 1;
608 SendMessage(hToolBar,TB_CHECKBUTTON,
609 (WPARAM)ITC_VOLU,(LPARAM) MAKELONG(TRUE,0) );
610 SendMessage(hToolBar,TB_CHECKBUTTON,
611 (WPARAM)ITC_SHEI,(LPARAM) MAKELONG(FALSE,0) );
612 SendMessage(hToolBar,TB_CHECKBUTTON,
613 (WPARAM)ITC_PLAT,(LPARAM) MAKELONG(FALSE,0) );
614 SendMessage(hToolBar,TB_CHECKBUTTON,
615 (WPARAM)ITC_TORU,(LPARAM) MAKELONG(FALSE,0) );
616 SendMessage(hToolBar,TB_CHECKBUTTON,
617 (WPARAM)ITC_SHEL,(LPARAM) MAKELONG(FALSE,0) );
618 }
619
620 else if(ifmode == IDM_SHEI)
621 {
622 ICFLAG = 2;
623 SendMessage(hToolBar,TB_CHECKBUTTON,
624 (WPARAM)ITC_VOLU,(LPARAM) MAKELONG(FALSE,0) );
625 SendMessage(hToolBar,TB_CHECKBUTTON,
626 (WPARAM)ITC_SHEI,(LPARAM) MAKELONG(TRUE,0) );
627 SendMessage(hToolBar,TB_CHECKBUTTON,
628 (WPARAM)ITC_PLAT,(LPARAM) MAKELONG(FALSE,0) );
629 SendMessage(hToolBar,TB_CHECKBUTTON,
630 (WPARAM)ITC_TORU,(LPARAM) MAKELONG(FALSE,0) );
631 SendMessage(hToolBar,TB_CHECKBUTTON,
632 (WPARAM)ITC_SHEL,(LPARAM) MAKELONG(FALSE,0) );
633 }
634
635 else if(ifmode == IDM_PLAT)
636 {
637 ICFLAG = 3;
638 SendMessage(hToolBar,TB_CHECKBUTTON,
639 (WPARAM)ITC_VOLU,(LPARAM) MAKELONG(FALSE,0) );
640 SendMessage(hToolBar,TB_CHECKBUTTON,
641 (WPARAM)ITC_SHEI,(LPARAM) MAKELONG(FALSE,0) );
642 SendMessage(hToolBar,TB_CHECKBUTTON,
643 (WPARAM)ITC_PLAT,(LPARAM) MAKELONG(TRUE,0) );
644 SendMessage(hToolBar,TB_CHECKBUTTON,
645 (WPARAM)ITC_TORU,(LPARAM) MAKELONG(FALSE,0) );
646 SendMessage(hToolBar,TB_CHECKBUTTON,
647 (WPARAM)ITC_SHEL,(LPARAM) MAKELONG(FALSE,0) );
648 }
649
650 else if(ifmode == IDM_TORU)
651 {
652 ICFLAG = 4;
653 SendMessage(hToolBar,TB_CHECKBUTTON,
654 (WPARAM)ITC_VOLU,(LPARAM) MAKELONG(FALSE,0) );
655 SendMessage(hToolBar,TB_CHECKBUTTON,
656 (WPARAM)ITC_SHEI,(LPARAM) MAKELONG(FALSE,0) );
657 SendMessage(hToolBar,TB_CHECKBUTTON,
658 (WPARAM)ITC_PLAT,(LPARAM) MAKELONG(FALSE,0) );
659 SendMessage(hToolBar,TB_CHECKBUTTON,
660 (WPARAM)ITC_TORU,(LPARAM) MAKELONG(TRUE,0) );
661 SendMessage(hToolBar,TB_CHECKBUTTON,
662 (WPARAM)ITC_SHEL,(LPARAM) MAKELONG(FALSE,0) );
663 }
664
665 else if(ifmode == IDM_SHEL)
666 {
667 ICFLAG = 6;
668 SendMessage(hToolBar,TB_CHECKBUTTON,
669 (WPARAM)ITC_VOLU,(LPARAM) MAKELONG(FALSE,0) );
670 SendMessage(hToolBar,TB_CHECKBUTTON,
671 (WPARAM)ITC_SHEI,(LPARAM) MAKELONG(FALSE,0) );
672 SendMessage(hToolBar,TB_CHECKBUTTON,
673 (WPARAM)ITC_PLAT,(LPARAM) MAKELONG(FALSE,0) );
674 SendMessage(hToolBar,TB_CHECKBUTTON,
675 (WPARAM)ITC_TORU,(LPARAM) MAKELONG(FALSE,0) );
676 SendMessage(hToolBar,TB_CHECKBUTTON,
677 (WPARAM)ITC_SHEL,(LPARAM) MAKELONG(TRUE,0) );
678 }
679
680 else MessageBox(NULL,"No Mode !","Z88G", MB_OK | MB_ICONHAND);
681 InvalidateRect(hWnd,NULL,TRUE);
682 return 0;
683
684 /*======================================================================
685 * COMMAND : Mode aus Toolbar
686 *=====================================================================*/
687 case ITC_VOLU:
688 ICFLAG = 1;
689 ifmode = IDM_VOLU;
690 InvalidateRect(hWnd,NULL,TRUE);
691 return 0;
692
693 case ITC_SHEI:
694 ICFLAG = 2;
695 ifmode = IDM_SHEI;
696 InvalidateRect(hWnd,NULL,TRUE);
697 return 0;
698
699 case ITC_PLAT:
700 ICFLAG = 3;
701 ifmode = IDM_PLAT;
702 InvalidateRect(hWnd,NULL,TRUE);
703 return 0;
704
705 case ITC_TORU:
706 ICFLAG = 4;
707 ifmode = IDM_TORU;
708 InvalidateRect(hWnd,NULL,TRUE);
709 return 0;
710
711 case ITC_SHEL:
712 ICFLAG = 6;
713 ifmode = IDM_SHEL;
714 InvalidateRect(hWnd,NULL,TRUE);
715 return 0;
716
717 /*======================================================================
718 * COMMAND : Go
719 *=====================================================================*/
720 case IDM_GO:
721 case ITC_GO:
722 SetCursor(waitcur);
723 ShowCursor(TRUE);
724
725 hDC= GetDC(hWnd);
726 hFont= EzCreateFont(hDC,"Times New Roman",120,0,2,TRUE);
727 SelectObject(hDC,hFont);
728 SetBkColor(hDC,RGB(255,255,255));
729
730 laenge= strlen(comli);
731 TextOut(hDC,10,30,comli,laenge);
732
733 /*----------------------------------------------------------------------
734 * Umsetzen
735 *---------------------------------------------------------------------*/
736 if(IFFLAG == 1) iret= cosm88();
737 if(IFFLAG == 2)
738 {
739 if(ICFLAG == 1) iret= dnas88();
740 else iret= nast88();
741 }
742 if(iret != 0)
743 {
744 ale88g(iret);
745 PostQuitMessage(0);
746 return(1);
747
748 }
749
750 wlog88g(0L,LOG_Z88DONE);
751 wrim88g(0L,TX_Z88DONE);
752
753 /*----------------------------------------------------------------------
754 * Ende Case Go
755 *---------------------------------------------------------------------*/
756 ReleaseDC(hWnd,hDC);
757 SetCursor(LoadCursor(NULL,IDC_ARROW));
758 if(LANG == 1) strcpy(cmess,"3D Konverter Z88G gelaufen");
759 if(LANG == 2) strcpy(cmess,"3D converter Z88G done");
760 MessageBox(NULL,cmess,"Z88G", MB_OK | MB_ICONINFORMATION);
761 PostQuitMessage(0);
762 return 0; /* end case GO */
763
764 default:
765 return DefWindowProc(hWnd, Message, wParam, lParam);
766 } /* end switch command */
767
768 /*----------------------------------------------------------------------
769 * case WM_PAINT
770 *---------------------------------------------------------------------*/
771 case WM_PAINT:
772 memset(&ps, 0x00, sizeof(PAINTSTRUCT));
773 hDC = BeginPaint(hWnd, &ps);
774
775 SetBkMode(hDC, TRANSPARENT);
776
777 EndPaint(hWnd, &ps);
778 return 0;
779
780 /*----------------------------------------------------------------------
781 * case WM_CLOSE
782 *---------------------------------------------------------------------*/
783 case WM_CLOSE:
784 PostQuitMessage(0);
785 return 0;
786
787 /*----------------------------------------------------------------------
788 * case WM_DESTROY
789 *---------------------------------------------------------------------*/
790 case WM_DESTROY:
791 PostQuitMessage(0);
792 return 0;
793
794 default:
795 return DefWindowProc(hWnd, Message, wParam, lParam);
796 }
797 }
798
799