Esempio n. 1
0
BOOL	EdSplash_Init (void)
{
    char	mySplashWindowClassName [256];
    int		myResult;
    WNDCLASSEX	myWindowClass;
    
    // Get the class name
    EdGUI_LoadString (IDS_SPLASH_WINDOW_NAME, mySplashWindowClassName, 
	sizeof (mySplashWindowClassName));
		     
    //
    // Register the editor window class
    //
    myWindowClass.cbSize = 	  sizeof (myWindowClass);
    // Set window class to redraw when window size changes
    myWindowClass.style = 	  CS_OWNDC;
    // Procedure to be called with messages for this window class
    myWindowClass.lpfnWndProc =   MySplashWindowProcedure;
    // The extra space in class struct
    myWindowClass.cbClsExtra = 	  0;
    // The extra space in window struct for the pointer to text data
    // and editor window
    myWindowClass.cbWndExtra = 	  WINDOW_EXTRA_MEMORY;
    // The application's handle
    myWindowClass.hInstance = 	  gProgram.applicationInstance;
    // Set the icon for this window class
    myWindowClass.hIcon = 	  LoadIcon (gProgram.applicationInstance, 
    					    MAKEINTRESOURCE (APP_ICON));
    // Set the cursor for this window class
    myWindowClass.hCursor = 	  LoadCursor (NULL, IDC_ARROW);
    // Set the background colour for this window
    myWindowClass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH);
    // Set the menu for this window class
    myWindowClass.lpszMenuName =  NULL;
    // Name of the window class
    myWindowClass.lpszClassName = mySplashWindowClassName; 
    // Set the icon for this class.
    myWindowClass.hIconSm = 	  LoadIcon (gProgram.applicationInstance, 
    					    MAKEINTRESOURCE (APP_SMALL_ICON));
    
    myResult = RegisterClassEx (&myWindowClass);
    if (myResult == 0)
    {
    	EdFail_Warn (IDS_REGISTERCLASSFAIL, __FILE__, __LINE__, 
    			  GetLastError ());
    	return FALSE;
    }
    
    return TRUE;
} // EdSplash_Init
Esempio n. 2
0
BOOL	EdFail_Init (void)
{
    int	cnt;
    
    for (cnt = 0 ; cnt < NUM_PROGRESS_MESSAGES ; cnt++)
    {
    	stProgressMessage [cnt] = malloc (MESSAGE_BUFFER_SIZE);
    	if (stProgressMessage [cnt] == NULL)
    	{
    	    EdFail_Warn (IDS_OUTOFMEMORY, __FILE__, __LINE__, 0);
            return FALSE;
    	}
    	stProgressMessage [cnt][0] = 0;
    }

#ifndef TPROLOG    
    EdCrash_Init ();
#endif // #ifndef TPROLOG
    return TRUE;
} // EdFail_Init
Esempio n. 3
0
BOOL	EdSearch_Init (void)
{
    /*************************************/
    /* Initialize find/replace structure */
    /*************************************/
    ZeroMemory (&stFindReplace, sizeof (FINDREPLACE));
    stFindReplace.lStructSize = sizeof (FINDREPLACE);
    stFindReplace.lpstrFindWhat = stFindWhat;
    stFindReplace.wFindWhatLen = FIND_STRING_LEN;
    stFindReplace.lpstrReplaceWith = stReplaceWith;
    stFindReplace.wReplaceWithLen = FIND_STRING_LEN;
    stFindReplace.lpfnHook = MyFindDialogProcedure;
    stFindReplace.Flags = FR_DOWN | FR_MATCHCASE | FR_ENABLEHOOK;
    
    EdSearch_FindReplaceMessage = RegisterWindowMessage (FINDMSGSTRING);
    if (EdSearch_FindReplaceMessage == 0)
    {
    	EdFail_Warn (IDS_REGISTERWINDOWMESSAGEFAIL, __FILE__, __LINE__, 
    			  GetLastError ());
    	return FALSE;
    }
    
    return TRUE;
} // EdSearch_Init