/* * DoLoadSpyConfig - allow user to save spy config */ void DoLoadSpyConfig( void ) { char fname[_MAX_PATH]; if( !GetFileName( "*.ini", FILE_OPEN, fname ) ) { return; } LoadSpyConfig( fname ); } /* DoLoadSpyConfig */
/* * spyInit - initialization */ static BOOL spyInit( HANDLE currinst, HANDLE previnst, int cmdshow ) { WNDCLASS wc; HANDLE memhdl; WORD i; i=i; memhdl = memhdl; /* shut up the compiler for non-NT version */ JDialogInit(); Instance = currinst; ResInstance = currinst; if( !InitGblStrings() ) { return( FALSE ); } SpyMenu = LoadMenu( ResInstance, "SPYMENU" ); #ifdef __WATCOMC__ _STACKLOW = 0; #endif MemStart(); HandleMessageInst = MakeProcInstance( (FARPROC) HandleMessage, Instance ); HintWndInit( Instance, NULL, 0 ); /* * set up window class */ if( !previnst ) { wc.style = 0L; wc.lpfnWndProc = SpyWindowProc; wc.cbClsExtra = 0; wc.cbWndExtra = sizeof( LONG_PTR ); wc.hInstance = Instance; wc.hIcon = LoadIcon( ResInstance, "APPLICON" ); wc.hCursor = LoadCursor( (HANDLE)NULL, IDC_ARROW); #ifdef __NT__ wc.hbrBackground = NULL; #else wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); #endif wc.lpszMenuName = NULL; wc.lpszClassName = SPY_CLASS_NAME; if( !RegisterClass( &wc ) ) { return( FALSE ); } #ifdef USE_SNAP_WINDOW if( !RegisterSnapClass( Instance ) ) { return( FALSE ); } #endif } #ifndef NOUSE3D CvrCtl3DInit( Instance ); CvrCtl3dRegister( Instance ); CvrCtl3dAutoSubclass( Instance ); #endif /* * now make the main window */ LoadSpyConfig( NULL ); SpyMainWindow = CreateWindow( SPY_CLASS_NAME, /* Window class name */ SpyName, /* Window caption */ WS_OVERLAPPEDWINDOW, /* Window style */ SpyMainWndInfo.xpos, /* Initial x position */ SpyMainWndInfo.ypos, /* Initial y position */ SpyMainWndInfo.xsize, /* Initial x size */ SpyMainWndInfo.ysize, /* Initial y size */ (HWND)NULL, /* Parent window handle */ (HMENU)SpyMenu, /* Window menu handle */ Instance, /* Program instance handle */ NULL ); /* Create parameters */ if( SpyMainWindow == NULL ) { return( FALSE ); } MyTask = GetWindowTask( SpyMainWindow ); ShowWindow( SpyMainWindow, cmdshow ); UpdateWindow( SpyMainWindow ); InitMessages(); return( TRUE ); } /* spyInit */