Thread: Suppress LoadLibraryEx error message?

  1. #1
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708

    Suppress LoadLibraryEx error message?

    When I use the LoadLibraryEx API to load a PE file and it fails for whatever reason, it sends a message box to the user rather than simply returning NULL. I looked around to see if there was a flag that could be used to supress this behavior, but haven't found one.

    Any ideas?

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    Ah, got it:

    Code:
    	
    SetErrorMode( SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX );
    It is a global setting, unfortunately (within the context of the program, that is), but luckily that isn't going to be a problem, in this case.

Popular pages Recent additions subscribe to a feed
Website Security Test