cleanup
This commit is contained in:
@@ -8,21 +8,21 @@
|
|||||||
// this will not work on 95 and NT because of EnumDisplayDevices
|
// this will not work on 95 and NT because of EnumDisplayDevices
|
||||||
RString GetPrimaryVideoName()
|
RString GetPrimaryVideoName()
|
||||||
{
|
{
|
||||||
typedef BOOL (WINAPI* pfnEnumDisplayDevices)(PVOID,DWORD,PDISPLAY_DEVICE,DWORD);
|
typedef BOOL (WINAPI* pfnEnumDisplayDevices)(PVOID,DWORD,PDISPLAY_DEVICE,DWORD);
|
||||||
pfnEnumDisplayDevices EnumDisplayDevices;
|
pfnEnumDisplayDevices EnumDisplayDevices;
|
||||||
HINSTANCE hInstUser32;
|
HINSTANCE hInstUser32;
|
||||||
|
|
||||||
hInstUser32 = LoadLibrary( "User32.DLL" );
|
hInstUser32 = LoadLibrary( "User32.DLL" );
|
||||||
if( !hInstUser32 )
|
if( !hInstUser32 )
|
||||||
return RString();
|
return RString();
|
||||||
|
|
||||||
// VC6 don't have a stub to static link with, so link dynamically.
|
// VC6 don't have a stub to static link with, so link dynamically.
|
||||||
EnumDisplayDevices = (pfnEnumDisplayDevices)GetProcAddress(hInstUser32,"EnumDisplayDevicesA");
|
EnumDisplayDevices = (pfnEnumDisplayDevices)GetProcAddress(hInstUser32,"EnumDisplayDevicesA");
|
||||||
if( EnumDisplayDevices == NULL )
|
if( EnumDisplayDevices == NULL )
|
||||||
{
|
{
|
||||||
FreeLibrary(hInstUser32);
|
FreeLibrary(hInstUser32);
|
||||||
return RString();
|
return RString();
|
||||||
}
|
}
|
||||||
|
|
||||||
RString sPrimaryDeviceName;
|
RString sPrimaryDeviceName;
|
||||||
for( int i=0; true; ++i )
|
for( int i=0; true; ++i )
|
||||||
@@ -39,7 +39,7 @@ RString GetPrimaryVideoName()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FreeLibrary( hInstUser32 );
|
FreeLibrary( hInstUser32 );
|
||||||
return sPrimaryDeviceName;
|
return sPrimaryDeviceName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user