OCC22250 Windows lost focus with DRAWEXE launched in 'virtual windows' mode
[occt.git] / src / Draw / Draw_Main.hxx
CommitLineData
7fd59977 1// File: Draw_Main.hxx
2// Created: Thu Dec 30 10:40:39 1999
3// Author: data exchange team
4// <det@burnax.nnov.matra-dtv.fr>
5
6// Defines common framework for declaration of main/WinMain functions
7// for executbales on UNIX and WNT that extends DRAW Test Harness.
8
9// In order to create executable in DRAW environment, in the executable
10// the following line should be added:
11// DRAW_MAIN
12
13#ifndef Draw_Main_HeaderFile
14#define Draw_Main_HeaderFile
15
16#ifndef _Standard_TypeDef_HeaderFile
17#include <Standard_TypeDef.hxx>
18#endif
19
20#include <Draw_Appli.hxx>
21#include <Standard_PCharacter.hxx>
22
23typedef void (*FDraw_InitAppli)(Draw_Interpretor&);
24
25#ifndef WNT
26Standard_EXPORT Standard_Integer _main_ (Standard_Integer argc,
27 Standard_PCharacter argv[],
28 const FDraw_InitAppli Draw_InitAppli);
29#else
30#include <windows.h>
31Standard_EXPORT Standard_Integer _WinMain_ (HINSTANCE hInstance,
32 HINSTANCE hPrevinstance,
33 LPSTR lpCmdLine,
34 Standard_Integer nCmdShow,
35 const FDraw_InitAppli Draw_InitAppli);
36
37Standard_EXPORT Standard_Integer _main_ (int argc,
38 char* argv[],
39 char* envp[],
40 const FDraw_InitAppli Draw_InitAppli);
41#endif
42
43// Declarations of macros DRAW_MAIN to be used in executables instead of explicit main/WinMain
44#ifndef WNT
45// main()
46#define DRAW_MAIN int main (Standard_Integer argc, char* argv[])\
47{return _main_ (argc, argv, Draw_InitAppli);}
48#else
49// WinMain() and main()
50#define DRAW_MAIN Standard_Integer PASCAL WinMain (HINSTANCE hInstance, HINSTANCE hPrevinstance, LPSTR lpCmdLine, Standard_Integer nCmdShow)\
51{return _WinMain_ (hInstance, hPrevinstance, lpCmdLine, nCmdShow, Draw_InitAppli);}\
52\
53int main (int argc, char* argv[], char* envp[])\
54{return _main_ (argc, argv, envp, Draw_InitAppli);}
55#endif
56
57
58#endif