You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(42) |
Sep
(42) |
Oct
(57) |
Nov
(12) |
Dec
(47) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(14) |
Feb
(4) |
Mar
(52) |
Apr
(13) |
May
(89) |
Jun
(38) |
Jul
(5) |
Aug
(32) |
Sep
(68) |
Oct
(27) |
Nov
(2) |
Dec
(13) |
2004 |
Jan
(3) |
Feb
(6) |
Mar
(3) |
Apr
(1) |
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: BJ H. <par...@us...> - 2004-06-10 14:29:23
|
Log Message: ----------- i was frustrated, here's the real fix Modified Files: -------------- /cvsroot/decaldev/source/DecalFilters: CharacterStats.cpp Revision Data ------------- Index: CharacterStats.cpp =================================================================== RCS file: /cvsroot/decaldev/source/DecalFilters/CharacterStats.cpp,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- CharacterStats.cpp 10 Jun 2004 14:10:51 -0000 1.51 +++ CharacterStats.cpp 10 Jun 2004 14:29:17 -0000 1.52 @@ -247,8 +247,15 @@ *(--szLf) = 0; // seems ac uses /r/n, but strstr for /r didn't work in testing if (*(--szLf) == '.') *szLf = 0; + + //check for spaces (eff u dt!!!) + szLf = strstr(Server, " "); + if (szLf) + *szLf = 0; } - + else //something went wrong, put "Unknown" + strncpy(Server, "Unknown\0", 8); + break; } @@ -1321,6 +1328,7 @@ if( !(*Server) ) return E_FAIL; + /* //DIE!! if( strncmp( Server, "DARKTIDE", 8 ) == 0 ) *pVal = T2BSTR( Server ); @@ -1342,7 +1350,8 @@ *pVal = T2BSTR( Server ); else *pVal = T2BSTR("Unknown"); - + */ + *pVal = T2BSTR(Server); return S_OK; } |
From: BJ H. <par...@us...> - 2004-06-10 14:11:00
|
Log Message: ----------- screw you whoever added that if..else in get_Server!!! Modified Files: -------------- /cvsroot/decaldev/source/DecalFilters: CharacterStats.cpp Revision Data ------------- Index: CharacterStats.cpp =================================================================== RCS file: /cvsroot/decaldev/source/DecalFilters/CharacterStats.cpp,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- CharacterStats.cpp 14 Apr 2004 15:30:41 -0000 1.50 +++ CharacterStats.cpp 10 Jun 2004 14:10:51 -0000 1.51 @@ -751,7 +751,8 @@ pMessage->get_Member (_variant_t ("records"), &vRecords); _ASSERTE (vRecords.vt == VT_DISPATCH); - std::map< DWORD, cAllegianceInfo * > AllegMap; + //std::map< DWORD, cAllegianceInfo * > AllegMap; + std::vector<cAllegianceInfo *> AllegInfo; for(int i = 0; i < (vRecordCount.bVal); i++) { @@ -792,23 +793,45 @@ tpai->Leadership = vLeader.iVal; tpai->Unknown = vUnknown.dblVal; strncpy( tpai->Name, OLE2A( vName.bstrVal ), sizeof( tpai->Name ) ); - - AllegMap.insert( std::make_pair( vGUID.lVal, tpai ) ); + + //AllegMap.insert( std::make_pair( vGUID.lVal, tpai ) ); + AllegInfo.push_back(tpai); } - std::map< DWORD, cAllegianceInfo * >::iterator i = AllegMap.find( GUID ); + //std::map< DWORD, cAllegianceInfo * >::iterator i = AllegMap.find( GUID ); // Solo player, get outta here - if( i == AllegMap.end() ) + //if( i == AllegMap.end() ) + if ( AllegInfo.size() == 0 ) break; - //the player - cAllegianceInfo *p = i->second; - memcpy( &MyAlleg, p, sizeof( cAllegianceInfo ) ); - delete p; - AllegMap.erase( GUID ); + //we now 'know' that the monarch is the first entry, always + //std::map< DWORD, cAllegianceInfo * >::iterator i2 = AllegMap.begin(); + std::vector<cAllegianceInfo *>::iterator j = AllegInfo.begin(); + if ( (*j)->GUID != GUID ) //i'm not the monarch, so find out who is + { + if ( (*(j + 1))->GUID != GUID ) //i'm not a direct either + { + memcpy(&Monarch, *j, sizeof(cAllegianceInfo)); + //OutputDebugString(Monarch.Name); + delete *j; + j = AllegInfo.erase( j ); // this is my patron now + } + memcpy( &Patron, *j, sizeof( cAllegianceInfo ) ); + //OutputDebugString(Patron.Name); + delete *j; + j = AllegInfo.erase( j ); + } + // we've taken care of any possible patron & monarch, + // so i'm all that's left + memcpy(&MyAlleg, *j, sizeof(cAllegianceInfo)); + //OutputDebugString(MyAlleg.Name); + delete *j; + j = AllegInfo.erase( j ); + //check for patron + /* i = AllegMap.find( MyAlleg.TreeParent ); if ( i != AllegMap.end() ) { @@ -828,17 +851,19 @@ AllegMap.erase( i ); } } + */ //The remainder *should* all be vassals - //while( AllegMap.size() > 0 ) - //{ - for( i = AllegMap.begin(); i != AllegMap.end(); ++i ) - { + while( AllegInfo.size() > 0 ) + { + //for( i = AllegInfo.begin(); i != AllegInfo.end(); ++i ) + //{ // Patron /* if( i->second->GUID == MyAlleg.TreeParent ) { memcpy( &Patron, i->second, sizeof( cAllegianceInfo ) ); + OutputDebugString("Got Patron\n"); delete i->second; i = AllegMap.erase( i ); @@ -849,18 +874,19 @@ //Vassal //just leaving the sanity check in place here - if (i->second->TreeParent == GUID) - { - memcpy( &Vassals[VassalCount], i->second, sizeof( cAllegianceInfo ) ); + //if ((*i)->TreeParent == GUID) + //{ + memcpy( &Vassals[VassalCount], *j, sizeof( cAllegianceInfo ) ); + //OutputDebugString(Vassals[VassalCount].Name); VassalCount++; - delete i->second; - i = AllegMap.erase( i ); + delete *j; + j = AllegInfo.erase( j ); - continue; - } - } - //} + //continue; + //} + //} + } // only remnant should be monarch //p = AllegMap.begin()->second; @@ -1295,6 +1321,7 @@ if( !(*Server) ) return E_FAIL; + //DIE!! if( strncmp( Server, "DARKTIDE", 8 ) == 0 ) *pVal = T2BSTR( Server ); else if( stricmp( Server, "FROSTFELL" ) == 0 ) @@ -1311,6 +1338,8 @@ *pVal = T2BSTR( Server ); else if( stricmp( Server, "WINTERSEBB" ) == 0 ) *pVal = T2BSTR( Server ); + else if( stricmp( Server, "VERDANTINE" ) == 0 ) + *pVal = T2BSTR( Server ); else *pVal = T2BSTR("Unknown"); |
From: BJ H. <par...@us...> - 2004-04-14 15:30:52
|
Log Message: ----------- Changed Allegiance info around a bit, should be more reliable Modified Files: -------------- /cvsroot/decaldev/source/DecalFilters: CharacterStats.cpp Revision Data ------------- Index: CharacterStats.cpp =================================================================== RCS file: /cvsroot/decaldev/source/DecalFilters/CharacterStats.cpp,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- CharacterStats.cpp 1 Mar 2004 19:08:09 -0000 1.49 +++ CharacterStats.cpp 14 Apr 2004 15:30:41 -0000 1.50 @@ -802,16 +802,40 @@ if( i == AllegMap.end() ) break; + //the player cAllegianceInfo *p = i->second; memcpy( &MyAlleg, p, sizeof( cAllegianceInfo ) ); delete p; AllegMap.erase( GUID ); - while( AllegMap.size() > 1 ) + //check for patron + i = AllegMap.find( MyAlleg.TreeParent ); + if ( i != AllegMap.end() ) { + memcpy( &Patron, i->second, sizeof( cAllegianceInfo ) ); + delete i->second; + AllegMap.erase( i ); + } + + //check for a monarch + if ( Patron.GUID != 0 ) + { + i = AllegMap.find( Patron.TreeParent ); + if ( i != AllegMap.end() ) + { + memcpy( &Monarch, i->second, sizeof( cAllegianceInfo ) ); + delete i->second; + AllegMap.erase( i ); + } + } + + //The remainder *should* all be vassals + //while( AllegMap.size() > 0 ) + //{ for( i = AllegMap.begin(); i != AllegMap.end(); ++i ) { // Patron + /* if( i->second->GUID == MyAlleg.TreeParent ) { memcpy( &Patron, i->second, sizeof( cAllegianceInfo ) ); @@ -821,9 +845,11 @@ continue; } + */ //Vassal - else if (i->second->TreeParent == GUID) + //just leaving the sanity check in place here + if (i->second->TreeParent == GUID) { memcpy( &Vassals[VassalCount], i->second, sizeof( cAllegianceInfo ) ); VassalCount++; @@ -834,12 +860,12 @@ continue; } } - } + //} // only remnant should be monarch - p = AllegMap.begin()->second; - memcpy( &Monarch, p, sizeof( cAllegianceInfo ) ); - delete p; + //p = AllegMap.begin()->second; + //memcpy( &Monarch, p, sizeof( cAllegianceInfo ) ); + //delete p; break; } |
From: Jeffrey D. <ha...@us...> - 2004-03-10 19:38:18
|
Log Message: ----------- If Not in xml.. be a bit more graceful about dying.. Modified Files: -------------- /cvsroot/decaldev/source/DecalFilters: IdentifyQueue.cpp Revision Data ------------- Index: IdentifyQueue.cpp =================================================================== RCS file: /cvsroot/decaldev/source/DecalFilters/IdentifyQueue.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- IdentifyQueue.cpp 1 Mar 2004 19:08:09 -0000 1.18 +++ IdentifyQueue.cpp 10 Mar 2004 19:12:15 -0000 1.19 @@ -32,8 +32,11 @@ long lRequestIDMemloc; if( m_pHooks->QueryMemLoc( _bstr_t( "ItemEventAppraise" ), &lRequestIDMemloc ) == S_OK ) { - m_pfRequestFunc = reinterpret_cast< RequestPtr >( lRequestIDMemloc ); - return S_OK; + if( lRequestIDMemloc != 0 ) + { + m_pfRequestFunc = reinterpret_cast< RequestPtr >( lRequestIDMemloc ); + return S_OK; + } } } |
From: Drakier D. <dra...@us...> - 2004-03-02 22:49:14
|
Log Message: ----------- moved another line into its proper code block (and removed some un-needed comments) Modified Files: -------------- /cvsroot/decaldev/source/DenAgent: ExportDlg.cpp Revision Data ------------- Index: ExportDlg.cpp =================================================================== RCS file: /cvsroot/decaldev/source/DenAgent/ExportDlg.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- ExportDlg.cpp 1 Mar 2004 19:08:10 -0000 1.5 +++ ExportDlg.cpp 2 Mar 2004 22:29:14 -0000 1.6 @@ -115,7 +115,6 @@ if ( ::SendMessage( GetDlgItem( IDC_CHKCLSID )->m_hWnd, BM_GETCHECK, 0, 0 ) ) szOutput += "clsid"; szOutput += "\r\n"; - //::SendMessage( GetDlgItem( IDC_EDITEXPORT )->m_hWnd, WM_SETTEXT, 0, (LPARAM)szOutput.c_str() ); AppendExportText(szOutput.c_str()); // Go through all the groups exporting their sub-lists @@ -189,7 +188,6 @@ szOutput += "<No CLSID>"; } szOutput += "\r\n"; - //::SendMessage( GetDlgItem( IDC_EDITEXPORT )->m_hWnd, WM_SETTEXT, 0, (LPARAM)szOutput.c_str() ); AppendExportText(szOutput.c_str()); } } @@ -377,7 +375,6 @@ szOutput += "Microsoft Win32s\r\n"; break; } - //::SendMessage( GetDlgItem( IDC_EDITEXPORT )->m_hWnd, WM_SETTEXT, 0, (LPARAM)szOutput.c_str() ); AppendExportText(szOutput.c_str()); // Drakier: Check the Protected Storage @@ -402,12 +399,10 @@ } } key.Close(); + AppendExportText(szOutput.c_str()); } - //::SendMessage( GetDlgItem( IDC_EDITEXPORT )->m_hWnd, WM_SETTEXT, 0, (LPARAM)szOutput.c_str() ); - AppendExportText(szOutput.c_str()); // Drakier: Get the Injection Mode - if( key.Create( HKEY_LOCAL_MACHINE, _T( "SOFTWARE\\Decal" )) == ERROR_SUCCESS ) { DWORD dwViewMode; @@ -428,7 +423,6 @@ key.Close(); AppendExportText(szOutput.c_str()); } - //::SendMessage( GetDlgItem( IDC_EDITEXPORT )->m_hWnd, WM_SETTEXT, 0, (LPARAM)szOutput.c_str() ); // Drakier: Get the Runtime versions (if installed). szOutput = "\r\nRuntime Libraries\r\n"; @@ -631,7 +625,6 @@ } ::FreeLibrary(hLib); AppendExportText(szOutput.c_str()); - //::SendMessage( GetDlgItem( IDC_EDITEXPORT )->m_hWnd, WM_SETTEXT, 0, (LPARAM)szOutput.c_str() ); // Drakier: Get the MSXML Versions szOutput = "\r\nMicrosoft XML Libraries\r\n"; @@ -679,7 +672,6 @@ } ::FreeLibrary(hLib); AppendExportText(szOutput.c_str()); - //::SendMessage( GetDlgItem( IDC_EDITEXPORT )->m_hWnd, WM_SETTEXT, 0, (LPARAM)szOutput.c_str() ); // Drakier: Get the Compat Mode Layers and display them. if (key.Open( HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\Layers" ) == ERROR_SUCCESS) |
From: Jeffrey D. <ha...@us...> - 2004-03-01 19:43:40
|
Log Message: ----------- Project Updates Added Files: ----------- /cvsroot/decaldev/source: Installer.nsi Revision Data ------------- --- NEW FILE: Installer.nsi --- ; Script generated with the Venis Install Wizard ; Define your application name !define APPNAME "Decal" !define APPNAMEANDVERSION "Decal 2.6.1.0" ; Main Install settings Name "${APPNAMEANDVERSION}" InstallDir "$PROGRAMFILES\Decal" InstallDirRegKey HKLM "Software\${APPNAME}" "" OutFile "Decal2610.exe" ; Use compression SetCompressor LZMA ; Modern interface settings !include "MUI.nsh" !define MUI_ABORTWARNING !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_FINISH !insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_INSTFILES ; Set languages (first is default language) !insertmacro MUI_LANGUAGE "English" !insertmacro MUI_RESERVEFILE_LANGDLL Section "" DecalCoreSection ; Set Section properties SetOverwrite on ; Set Section Files and Shortcuts SetOutPath "$INSTDIR\" File "Release\Switch-Active.bmp" File "Release\Switch-Inactive.bmp" File "Release\Switchbar Disabled.bmp" File "Release\Switchbar Template.bmp" File "Release\Tab-Active.bmp" File "Release\Tab-Inactive.bmp" File "Release\Decal.dll" File "Release\DecalControls.dll" File "Release\DecalDat.dll" File "Release\DecalFilters.dll" File "Release\DecalInput.dll" File "Release\DecalNet.dll" File "Release\DenAgent.exe" File "Release\ForceLibrary.dll" File "Release\Inject.dll" File "Release\LobbyHook.dll" File "Release\MapObject.bmp" File "Release\PlainText.dll" SetOutPath "$SYSDIR\" File "Release\LobbyHook.dll" RegDLL "$INSTDIR\Decal.dll" RegDLL "$INSTDIR\Inject.dll" RegDLL "$INSTDIR\DecalControls.dll" RegDLL "$INSTDIR\DecalDat.dll" RegDLL "$INSTDIR\DecalNet.dll" RegDLL "$INSTDIR\DecalFilters.dll" RegDLL "$INSTDIR\DecalInput.dll" RegDLL "$INSTDIR\PlainText.dll" SectionEnd Section "Desktop Shortcut" DesktopSection CreateShortCut "$DESKTOP\Decal Agent.lnk" "$INSTDIR\DenAgent.exe" SectionEnd Section "Start Menu Entry" SMSection CreateDirectory "$SMPROGRAMS\Decal" CreateShortCut "$SMPROGRAMS\Decal\Decal Agent.lnk" "$INSTDIR\DenAgent.exe" CreateShortCut "$SMPROGRAMS\Decal\Uninstall.lnk" "$INSTDIR\uninstall.exe" SectionEnd Section "Quick Launch Shortcut" QLSection CreateShortCut "$QUICKLAUNCH\Decal Agent.lnk" "$INSTDIR\DenAgent.exe" SectionEnd Section -FinishSection WriteRegStr HKLM "Software\${APPNAME}" "" "$INSTDIR" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayName" "${APPNAME}" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "UninstallString" "$INSTDIR\uninstall.exe" WriteUninstaller "$INSTDIR\uninstall.exe" SectionEnd ; Modern install component descriptions !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_DESCRIPTION_TEXT ${Section1} "" !insertmacro MUI_FUNCTION_DESCRIPTION_END ;Uninstall section Section Uninstall ;Remove from registry... DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" DeleteRegKey HKLM "SOFTWARE\${APPNAME}" ; Delete self Delete "$INSTDIR\uninstall.exe" ; Delete Shortcuts Delete "$DESKTOP\Decal.lnk" Delete "$SMPROGRAMS\Decal\Decal.lnk" Delete "$SMPROGRAMS\Decal\Uninstall.lnk" ; Unregister DLLS UnRegDLL "$INSTDIR\Decal.dll" UnRegDLL "$INSTDIR\Inject.dll" UnRegDLL "$INSTDIR\DecalControls.dll" UnRegDLL "$INSTDIR\DecalDat.dll" UnRegDLL "$INSTDIR\DecalNet.dll" UnRegDLL "$INSTDIR\DecalFilters.dll" UnRegDLL "$INSTDIR\DecalInput.dll" UnRegDLL "$INSTDIR\PlainText.dll" ; Clean up Decal Delete "$INSTDIR\Decal.dll" Delete "$INSTDIR\DecalControls.dll" Delete "$INSTDIR\DecalDat.dll" Delete "$INSTDIR\DecalFilters.dll" Delete "$INSTDIR\DecalInput.dll" Delete "$INSTDIR\DecalNet.dll" Delete "$INSTDIR\DenAgent.exe" Delete "$INSTDIR\ForceLibrary.dll" Delete "$INSTDIR\Inject.dll" Delete "$INSTDIR\LobbyHook.dll" Delete "$INSTDIR\MapObject.bmp" Delete "$INSTDIR\PlainText.dll" Delete "$INSTDIR\Switch-Active.bmp" Delete "$INSTDIR\Switch-Inactive.bmp" Delete "$INSTDIR\Switchbar Disabled.bmp" Delete "$INSTDIR\Switchbar Template.bmp" Delete "$INSTDIR\Tab-Active.bmp" Delete "$INSTDIR\Tab-Inactive.bmp" ; Remove remaining directories RMDir "$SMPROGRAMS\Decal" RMDir "$INSTDIR\" SectionEnd ; eof |
From: Drakier D. <dra...@us...> - 2004-02-13 23:45:11
|
Log Message: ----------- Added MORE error checking... Modified Files: -------------- /cvsroot/decaldev/source/DenAgent: ExportDlg.cpp Revision Data ------------- Index: ExportDlg.cpp =================================================================== RCS file: /cvsroot/decaldev/source/DenAgent/ExportDlg.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ExportDlg.cpp 13 Feb 2004 00:08:07 -0000 1.3 +++ ExportDlg.cpp 13 Feb 2004 23:39:12 -0000 1.4 @@ -86,7 +86,10 @@ { USES_CONVERSION; std::string szDelim = ", "; - + // Set Cursor + HCURSOR hCurDefault = GetCursor(); + HCURSOR hCurWaiting = LoadCursor(NULL, IDC_WAIT); + SetCursor(hCurWaiting); // Drakier: Get plugins/filters/services/etc from decal cPluginGroup _groups[] = { @@ -112,7 +115,7 @@ if ( ::SendMessage( GetDlgItem( IDC_CHKCLSID )->m_hWnd, BM_GETCHECK, 0, 0 ) ) szOutput += "clsid"; szOutput += "\r\n"; - //::SendMessage( GetDlgItem( IDC_EDITEXPORT )->m_hWnd, WM_SETTEXT, 0, (LPARAM)szOutput.c_str() ); + //::SendMessage( GetDlgItem( IDC_EDITEXPORT )->m_hWnd, WM_SETTEXT, 0, (LPARAM)szOutput.c_str() ); AppendExportText(szOutput.c_str()); // Go through all the groups exporting their sub-lists @@ -128,17 +131,23 @@ szOutput = ""; CLSID clsid; CComBSTR strName; - CString strDLL; - CString strDLLVersion; + CString strDLL = ""; + CString strDLLVersion = ""; LPOLESTR szCLSID; hRes = pEnum->get_ComClass ( &clsid ); _ASSERTE ( SUCCEEDED ( hRes ) ); - if ( !CDenAgentApp::getCOMObjectDLL ( clsid, strDLL ) ) - strDLL = "<No DLL>"; - if ( !CDenAgentApp::getVersionString ( strDLL, strDLLVersion ) ) - strDLLVersion = _T( "<No Version>" ); + if (hRes == S_OK) + { + if ( CDenAgentApp::getCOMObjectDLL ( clsid, strDLL ) ) + { + if ( !CDenAgentApp::getVersionString ( strDLL, strDLLVersion ) ) + strDLLVersion = _T( "<No Version>" ); + } + else + strDLL = _T( "<No DLL>" ); + } szOutput += i->m_groupName; @@ -154,7 +163,10 @@ hRes = pEnum->get_FriendlyName( &strName ); _ASSERTE ( SUCCEEDED ( hRes ) ); szOutput += szDelim; - szOutput += OLE2T ( strName ); + if (hRes == S_OK) + szOutput += OLE2T ( strName ); + else + szOutput += "<No Name>"; szOutput += szDelim; szOutput += strDLLVersion; @@ -167,10 +179,14 @@ if ( ::SendMessage( GetDlgItem( IDC_CHKCLSID )->m_hWnd, BM_GETCHECK, 0, 0 ) ) { - StringFromCLSID(clsid, &szCLSID); szOutput += szDelim; - szOutput += OLE2T(szCLSID); - ::CoTaskMemFree ( szCLSID ); + if ( StringFromCLSID(clsid, &szCLSID) == S_OK ) + { + szOutput += OLE2T(szCLSID); + ::CoTaskMemFree ( szCLSID ); + } + else + szOutput += "<No CLSID>"; } szOutput += "\r\n"; //::SendMessage( GetDlgItem( IDC_EDITEXPORT )->m_hWnd, WM_SETTEXT, 0, (LPARAM)szOutput.c_str() ); @@ -407,6 +423,8 @@ szOutput += "NEW\r\n"; } } + else + szOutput += "Error Reading Key"; key.Close(); } //::SendMessage( GetDlgItem( IDC_EDITEXPORT )->m_hWnd, WM_SETTEXT, 0, (LPARAM)szOutput.c_str() ); @@ -423,13 +441,16 @@ else { char strDllFilePath[MAX_PATH] = {""}; - CString strDLLVersion; + CString strDLLVersion = ""; GetModuleFileName(hLib, strDllFilePath, MAX_PATH); if ( !CDenAgentApp::getVersionString ( strDllFilePath, strDLLVersion ) ) strDLLVersion = _T( "(No Version)" ); - szOutput += "Installed ("; - szOutput += strDLLVersion; - szOutput += ")\r\n"; + else + { + szOutput += "Installed ("; + szOutput += strDLLVersion; + szOutput += ")\r\n"; + } } ::FreeLibrary(hLib); AppendExportText(szOutput.c_str()); @@ -442,13 +463,16 @@ else { char strDllFilePath[MAX_PATH] = {""}; - CString strDLLVersion; + CString strDLLVersion = ""; GetModuleFileName(hLib, strDllFilePath, MAX_PATH); if ( !CDenAgentApp::getVersionString ( strDllFilePath, strDLLVersion ) ) strDLLVersion = _T( "(No Version)" ); - szOutput += "Installed ("; - szOutput += strDLLVersion; - szOutput += ")\r\n"; + else + { + szOutput += "Installed ("; + szOutput += strDLLVersion; + szOutput += ")\r\n"; + } } ::FreeLibrary(hLib); AppendExportText(szOutput.c_str()); @@ -461,13 +485,16 @@ else { char strDllFilePath[MAX_PATH] = {""}; - CString strDLLVersion; + CString strDLLVersion = ""; GetModuleFileName(hLib, strDllFilePath, MAX_PATH); if ( !CDenAgentApp::getVersionString ( strDllFilePath, strDLLVersion ) ) strDLLVersion = _T( "(No Version)" ); - szOutput += "Installed ("; - szOutput += strDLLVersion; - szOutput += ")\r\n"; + else + { + szOutput += "Installed ("; + szOutput += strDLLVersion; + szOutput += ")\r\n"; + } } ::FreeLibrary(hLib); AppendExportText(szOutput.c_str()); @@ -480,13 +507,16 @@ else { char strDllFilePath[MAX_PATH] = {""}; - CString strDLLVersion; + CString strDLLVersion = ""; GetModuleFileName(hLib, strDllFilePath, MAX_PATH); if ( !CDenAgentApp::getVersionString ( strDllFilePath, strDLLVersion ) ) strDLLVersion = _T( "(No Version)" ); - szOutput += "Installed ("; - szOutput += strDLLVersion; - szOutput += ")\r\n"; + else + { + szOutput += "Installed ("; + szOutput += strDLLVersion; + szOutput += ")\r\n"; + } } ::FreeLibrary(hLib); AppendExportText(szOutput.c_str()); @@ -499,13 +529,16 @@ else { char strDllFilePath[MAX_PATH] = {""}; - CString strDLLVersion; + CString strDLLVersion = ""; GetModuleFileName(hLib, strDllFilePath, MAX_PATH); if ( !CDenAgentApp::getVersionString ( strDllFilePath, strDLLVersion ) ) strDLLVersion = _T( "(No Version)" ); - szOutput += "Installed ("; - szOutput += strDLLVersion; - szOutput += ")\r\n"; + else + { + szOutput += "Installed ("; + szOutput += strDLLVersion; + szOutput += ")\r\n"; + } } ::FreeLibrary(hLib); AppendExportText(szOutput.c_str()); @@ -519,13 +552,16 @@ else { char strDllFilePath[MAX_PATH] = {""}; - CString strDLLVersion; + CString strDLLVersion = ""; GetModuleFileName(hLib, strDllFilePath, MAX_PATH); if ( !CDenAgentApp::getVersionString ( strDllFilePath, strDLLVersion ) ) strDLLVersion = _T( "(No Version)" ); - szOutput += "Installed ("; - szOutput += strDLLVersion; - szOutput += ")\r\n"; + else + { + szOutput += "Installed ("; + szOutput += strDLLVersion; + szOutput += ")\r\n"; + } } ::FreeLibrary(hLib); AppendExportText(szOutput.c_str()); @@ -538,13 +574,16 @@ else { char strDllFilePath[MAX_PATH] = {""}; - CString strDLLVersion; + CString strDLLVersion = ""; GetModuleFileName(hLib, strDllFilePath, MAX_PATH); if ( !CDenAgentApp::getVersionString ( strDllFilePath, strDLLVersion ) ) strDLLVersion = _T( "(No Version)" ); - szOutput += "Installed ("; - szOutput += strDLLVersion; - szOutput += ")\r\n"; + else + { + szOutput += "Installed ("; + szOutput += strDLLVersion; + szOutput += ")\r\n"; + } } ::FreeLibrary(hLib); AppendExportText(szOutput.c_str()); @@ -557,13 +596,16 @@ else { char strDllFilePath[MAX_PATH] = {""}; - CString strDLLVersion; + CString strDLLVersion = ""; GetModuleFileName(hLib, strDllFilePath, MAX_PATH); if ( !CDenAgentApp::getVersionString ( strDllFilePath, strDLLVersion ) ) strDLLVersion = _T( "(No Version)" ); - szOutput += "Installed ("; - szOutput += strDLLVersion; - szOutput += ")\r\n"; + else + { + szOutput += "Installed ("; + szOutput += strDLLVersion; + szOutput += ")\r\n"; + } } ::FreeLibrary(hLib); AppendExportText(szOutput.c_str()); @@ -576,13 +618,16 @@ else { char strDllFilePath[MAX_PATH] = {""}; - CString strDLLVersion; + CString strDLLVersion = ""; GetModuleFileName(hLib, strDllFilePath, MAX_PATH); if ( !CDenAgentApp::getVersionString ( strDllFilePath, strDLLVersion ) ) strDLLVersion = _T( "(No Version)" ); - szOutput += "Installed ("; - szOutput += strDLLVersion; - szOutput += ")\r\n"; + else + { + szOutput += "Installed ("; + szOutput += strDLLVersion; + szOutput += ")\r\n"; + } } ::FreeLibrary(hLib); AppendExportText(szOutput.c_str()); @@ -599,13 +644,16 @@ else { char strDllFilePath[MAX_PATH] = {""}; - CString strDLLVersion; + CString strDLLVersion = ""; GetModuleFileName(hLib, strDllFilePath, MAX_PATH); if ( !CDenAgentApp::getVersionString ( strDllFilePath, strDLLVersion ) ) strDLLVersion = _T( "(No Version)" ); - szOutput += "Installed ("; - szOutput += strDLLVersion; - szOutput += ")\r\n"; + else + { + szOutput += "Installed ("; + szOutput += strDLLVersion; + szOutput += ")\r\n"; + } } ::FreeLibrary(hLib); AppendExportText(szOutput.c_str()); @@ -618,13 +666,16 @@ else { char strDllFilePath[MAX_PATH] = {""}; - CString strDLLVersion; + CString strDLLVersion = ""; GetModuleFileName(hLib, strDllFilePath, MAX_PATH); if ( !CDenAgentApp::getVersionString ( strDllFilePath, strDLLVersion ) ) strDLLVersion = _T( "(No Version)" ); - szOutput += "Installed ("; - szOutput += strDLLVersion; - szOutput += ")\r\n"; + else + { + szOutput += "Installed ("; + szOutput += strDLLVersion; + szOutput += ")\r\n"; + } } ::FreeLibrary(hLib); AppendExportText(szOutput.c_str()); @@ -672,6 +723,9 @@ } key.Close(); + // Set Cursor back... + SetCursor(hCurDefault); + // Display information if (::MessageBox(NULL, "Would you like to export the data to the clipboard?", "Export Data...", MB_YESNO | MB_ICONQUESTION) == IDYES ) { |
From: Drakier D. <dra...@us...> - 2004-02-13 00:13:21
|
Log Message: ----------- added file versions to DLL files. Modified Files: -------------- /cvsroot/decaldev/source/DenAgent: ExportDlg.cpp Revision Data ------------- Index: ExportDlg.cpp =================================================================== RCS file: /cvsroot/decaldev/source/DenAgent/ExportDlg.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ExportDlg.cpp 12 Feb 2004 22:17:00 -0000 1.2 +++ ExportDlg.cpp 13 Feb 2004 00:08:07 -0000 1.3 @@ -421,8 +421,18 @@ if( hLib == NULL ) szOutput += "Not Installed\r\n"; else - szOutput += "Installed\r\n"; + { + char strDllFilePath[MAX_PATH] = {""}; + CString strDLLVersion; + GetModuleFileName(hLib, strDllFilePath, MAX_PATH); + if ( !CDenAgentApp::getVersionString ( strDllFilePath, strDLLVersion ) ) + strDLLVersion = _T( "(No Version)" ); + szOutput += "Installed ("; + szOutput += strDLLVersion; + szOutput += ")\r\n"; + } ::FreeLibrary(hLib); + AppendExportText(szOutput.c_str()); // msvcp 7.0 Runtime szOutput = "[msvcr70.dll]\t: "; @@ -430,100 +440,195 @@ if( hLib == NULL ) szOutput += "Not Installed\r\n"; else - szOutput += "Installed\r\n"; + { + char strDllFilePath[MAX_PATH] = {""}; + CString strDLLVersion; + GetModuleFileName(hLib, strDllFilePath, MAX_PATH); + if ( !CDenAgentApp::getVersionString ( strDllFilePath, strDLLVersion ) ) + strDLLVersion = _T( "(No Version)" ); + szOutput += "Installed ("; + szOutput += strDLLVersion; + szOutput += ")\r\n"; + } ::FreeLibrary(hLib); + AppendExportText(szOutput.c_str()); + // msvcr 7.0 Runtime - szOutput += "[msvcp70.dll]\t: "; + szOutput = "[msvcp70.dll]\t: "; hLib = ::LoadLibrary( "msvcp70.dll" ); if( hLib == NULL ) szOutput += "Not Installed\r\n"; else - szOutput += "Installed\r\n"; + { + char strDllFilePath[MAX_PATH] = {""}; + CString strDLLVersion; + GetModuleFileName(hLib, strDllFilePath, MAX_PATH); + if ( !CDenAgentApp::getVersionString ( strDllFilePath, strDLLVersion ) ) + strDLLVersion = _T( "(No Version)" ); + szOutput += "Installed ("; + szOutput += strDLLVersion; + szOutput += ")\r\n"; + } ::FreeLibrary(hLib); + AppendExportText(szOutput.c_str()); // msvcp 7.1 Runtime - szOutput += "[msvcr71.dll]\t: "; + szOutput = "[msvcr71.dll]\t: "; hLib = ::LoadLibrary( "msvcr71.dll" ); if( hLib == NULL ) szOutput += "Not Installed\r\n"; else - szOutput += "Installed\r\n"; + { + char strDllFilePath[MAX_PATH] = {""}; + CString strDLLVersion; + GetModuleFileName(hLib, strDllFilePath, MAX_PATH); + if ( !CDenAgentApp::getVersionString ( strDllFilePath, strDLLVersion ) ) + strDLLVersion = _T( "(No Version)" ); + szOutput += "Installed ("; + szOutput += strDLLVersion; + szOutput += ")\r\n"; + } ::FreeLibrary(hLib); + AppendExportText(szOutput.c_str()); + // msvcr 7.1 Runtime - szOutput += "[msvcp71.dll]\t: "; + szOutput = "[msvcp71.dll]\t: "; hLib = ::LoadLibrary( "msvcp71.dll" ); if( hLib == NULL ) szOutput += "Not Installed\r\n"; else - szOutput += "Installed\r\n"; + { + char strDllFilePath[MAX_PATH] = {""}; + CString strDLLVersion; + GetModuleFileName(hLib, strDllFilePath, MAX_PATH); + if ( !CDenAgentApp::getVersionString ( strDllFilePath, strDLLVersion ) ) + strDLLVersion = _T( "(No Version)" ); + szOutput += "Installed ("; + szOutput += strDLLVersion; + szOutput += ")\r\n"; + } ::FreeLibrary(hLib); + AppendExportText(szOutput.c_str()); // Haz - mfc+atl // mfc 7.0 runtime - szOutput += "[mfc70.dll]\t: "; + szOutput = "[mfc70.dll]\t: "; hLib = ::LoadLibrary( "mfc70.dll" ); if( hLib == NULL ) szOutput += "Not Installed\r\n"; else - szOutput += "Installed\r\n"; + { + char strDllFilePath[MAX_PATH] = {""}; + CString strDLLVersion; + GetModuleFileName(hLib, strDllFilePath, MAX_PATH); + if ( !CDenAgentApp::getVersionString ( strDllFilePath, strDLLVersion ) ) + strDLLVersion = _T( "(No Version)" ); + szOutput += "Installed ("; + szOutput += strDLLVersion; + szOutput += ")\r\n"; + } ::FreeLibrary(hLib); + AppendExportText(szOutput.c_str()); // mfc 7.1 runtime - szOutput += "[mfc71.dll]\t: "; + szOutput = "[mfc71.dll]\t: "; hLib = ::LoadLibrary( "mfc71.dll" ); if( hLib == NULL ) szOutput += "Not Installed\r\n"; else - szOutput += "Installed\r\n"; + { + char strDllFilePath[MAX_PATH] = {""}; + CString strDLLVersion; + GetModuleFileName(hLib, strDllFilePath, MAX_PATH); + if ( !CDenAgentApp::getVersionString ( strDllFilePath, strDLLVersion ) ) + strDLLVersion = _T( "(No Version)" ); + szOutput += "Installed ("; + szOutput += strDLLVersion; + szOutput += ")\r\n"; + } ::FreeLibrary(hLib); + AppendExportText(szOutput.c_str()); // atl 7.0 runtime - szOutput += "[atl70.dll]\t\t: "; + szOutput = "[atl70.dll]\t\t: "; hLib = ::LoadLibrary( "atl70.dll" ); if( hLib == NULL ) szOutput += "Not Installed\r\n"; else - szOutput += "Installed\r\n"; + { + char strDllFilePath[MAX_PATH] = {""}; + CString strDLLVersion; + GetModuleFileName(hLib, strDllFilePath, MAX_PATH); + if ( !CDenAgentApp::getVersionString ( strDllFilePath, strDLLVersion ) ) + strDLLVersion = _T( "(No Version)" ); + szOutput += "Installed ("; + szOutput += strDLLVersion; + szOutput += ")\r\n"; + } ::FreeLibrary(hLib); + AppendExportText(szOutput.c_str()); // atl 7.1 runtime - szOutput += "[atl71.dll]\t\t: "; + szOutput = "[atl71.dll]\t\t: "; hLib = ::LoadLibrary( "atl71.dll" ); if( hLib == NULL ) szOutput += "Not Installed\r\n"; else - szOutput += "Installed\r\n"; + { + char strDllFilePath[MAX_PATH] = {""}; + CString strDLLVersion; + GetModuleFileName(hLib, strDllFilePath, MAX_PATH); + if ( !CDenAgentApp::getVersionString ( strDllFilePath, strDLLVersion ) ) + strDLLVersion = _T( "(No Version)" ); + szOutput += "Installed ("; + szOutput += strDLLVersion; + szOutput += ")\r\n"; + } ::FreeLibrary(hLib); - - //::SendMessage( GetDlgItem( IDC_EDITEXPORT )->m_hWnd, WM_SETTEXT, 0, (LPARAM)szOutput.c_str() ); AppendExportText(szOutput.c_str()); - szOutput = ""; - + //::SendMessage( GetDlgItem( IDC_EDITEXPORT )->m_hWnd, WM_SETTEXT, 0, (LPARAM)szOutput.c_str() ); // Drakier: Get the MSXML Versions - szOutput += "\r\nMicrosoft XML Libraries\r\n"; - + szOutput = "\r\nMicrosoft XML Libraries\r\n"; + AppendExportText(szOutput.c_str()); // msxml3 - szOutput += "[msxml3.dll]\t: "; + szOutput = "[msxml3.dll]\t: "; hLib = ::LoadLibrary( "msxml3.dll" ); if( hLib == NULL ) szOutput += "Not Installed\r\n"; else - szOutput += "Installed\r\n"; + { + char strDllFilePath[MAX_PATH] = {""}; + CString strDLLVersion; + GetModuleFileName(hLib, strDllFilePath, MAX_PATH); + if ( !CDenAgentApp::getVersionString ( strDllFilePath, strDLLVersion ) ) + strDLLVersion = _T( "(No Version)" ); + szOutput += "Installed ("; + szOutput += strDLLVersion; + szOutput += ")\r\n"; + } ::FreeLibrary(hLib); + AppendExportText(szOutput.c_str()); // msxml4 - szOutput += "[msxml4.dll]\t: "; + szOutput = "[msxml4.dll]\t: "; hLib = ::LoadLibrary( "msxml4.dll" ); if( hLib == NULL ) szOutput += "Not Installed\r\n"; else - szOutput += "Installed\r\n"; + { + char strDllFilePath[MAX_PATH] = {""}; + CString strDLLVersion; + GetModuleFileName(hLib, strDllFilePath, MAX_PATH); + if ( !CDenAgentApp::getVersionString ( strDllFilePath, strDLLVersion ) ) + strDLLVersion = _T( "(No Version)" ); + szOutput += "Installed ("; + szOutput += strDLLVersion; + szOutput += ")\r\n"; + } ::FreeLibrary(hLib); - - //::SendMessage( GetDlgItem( IDC_EDITEXPORT )->m_hWnd, WM_SETTEXT, 0, (LPARAM)szOutput.c_str() ); AppendExportText(szOutput.c_str()); - szOutput = ""; + //::SendMessage( GetDlgItem( IDC_EDITEXPORT )->m_hWnd, WM_SETTEXT, 0, (LPARAM)szOutput.c_str() ); // Drakier: Get the Compat Mode Layers and display them. if (key.Open( HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\Layers" ) == ERROR_SUCCESS) @@ -553,7 +658,7 @@ if ( strstr(szValueName, "client.exe") != NULL ) { if (!bTitle) - szOutput += "\r\nApplication Compatibility\r\n"; + szOutput = "\r\nApplication Compatibility\r\n"; bTitle = TRUE; szOutput += szValueName; szOutput += ": "; @@ -562,13 +667,12 @@ } } } + AppendExportText(szOutput.c_str()); } } key.Close(); // Display information - //::SendMessage( GetDlgItem( IDC_EDITEXPORT )->m_hWnd, WM_SETTEXT, 0, (LPARAM)szOutput.c_str() ); - AppendExportText(szOutput.c_str()); if (::MessageBox(NULL, "Would you like to export the data to the clipboard?", "Export Data...", MB_YESNO | MB_ICONQUESTION) == IDYES ) { if(OpenClipboard()) |
From: Drakier D. <dra...@us...> - 2004-02-12 22:22:16
|
Log Message: ----------- Changed the "buffer" to use the TextBox and added an AppendExportText function. Modified Files: -------------- /cvsroot/decaldev/source/DenAgent: ExportDlg.cpp ExportDlg.h Revision Data ------------- Index: ExportDlg.cpp =================================================================== RCS file: /cvsroot/decaldev/source/DenAgent/ExportDlg.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ExportDlg.cpp 6 Feb 2004 17:39:03 -0000 1.1 +++ ExportDlg.cpp 12 Feb 2004 22:17:00 -0000 1.2 @@ -16,7 +16,6 @@ ///////////////////////////////////////////////////////////////////////////// // cExportDlg dialog - cExportDlg::cExportDlg(CWnd* pParent /*=NULL*/) : CDialog(cExportDlg::IDD, pParent) { @@ -65,10 +64,31 @@ int m_iconIndex; }; +void cExportDlg::AppendExportText(const char *szNewText) +{ + int dwOldTextLength =::SendMessage(GetDlgItem(IDC_EDITEXPORT)->m_hWnd, WM_GETTEXTLENGTH, 0, 0) + 1; + int dwNewTextLength = strlen(szNewText) + 1; + char *szOldText = new char[dwOldTextLength]; + memset(szOldText, 0, dwOldTextLength); + char *szBuffer = new char[dwOldTextLength + dwNewTextLength]; + memset(szBuffer, 0, dwOldTextLength + dwNewTextLength); + ::SendMessage(GetDlgItem(IDC_EDITEXPORT)->m_hWnd, WM_GETTEXT, dwOldTextLength, (LPARAM) szOldText); + if(dwOldTextLength > 0) + sprintf(szBuffer, "%s%s", szOldText, szNewText); + else + sprintf(szBuffer, "%s", szNewText); + ::SendMessage(GetDlgItem(IDC_EDITEXPORT)->m_hWnd, WM_SETTEXT, 0, (LPARAM) szBuffer); + delete[]szBuffer; + delete[]szOldText; +} + void cExportDlg::OnBnClickedBtnexport() { USES_CONVERSION; std::string szDelim = ", "; + + + // Drakier: Get plugins/filters/services/etc from decal cPluginGroup _groups[] = { { _T( "Plugins" ), _T( "Plugins" ), 4 }, { _T( "Network Filters" ), _T( "NetworkFilters" ), 1 }, @@ -80,6 +100,9 @@ int nCount = 0; std::string szOutput; + szOutput = ""; + ::SendMessage( GetDlgItem( IDC_EDITEXPORT )->m_hWnd,WM_SETTEXT, 0, (LPARAM)szOutput.c_str()); + szOutput += "type, "; if ( ::SendMessage( GetDlgItem( IDC_CHKENABLED )->m_hWnd, BM_GETCHECK, 0, 0 ) ) szOutput += "enabled, "; @@ -89,15 +112,20 @@ if ( ::SendMessage( GetDlgItem( IDC_CHKCLSID )->m_hWnd, BM_GETCHECK, 0, 0 ) ) szOutput += "clsid"; szOutput += "\r\n"; + //::SendMessage( GetDlgItem( IDC_EDITEXPORT )->m_hWnd, WM_SETTEXT, 0, (LPARAM)szOutput.c_str() ); + AppendExportText(szOutput.c_str()); + // Go through all the groups exporting their sub-lists for ( cPluginGroup *i = _groups; i != _end_groups; ++ i ) { CComPtr<IDecalEnum> pEnum; HRESULT hRes = m_pDecal->get_Configuration ( _bstr_t ( i->m_groupKey ), GUID_NULL, &pEnum ); _ASSERTE( SUCCEEDED ( hRes ) ); + // enum through all items in a group while ( pEnum->Next () == S_OK ) { + szOutput = ""; CLSID clsid; CComBSTR strName; CString strDLL; @@ -144,26 +172,422 @@ szOutput += OLE2T(szCLSID); ::CoTaskMemFree ( szCLSID ); } - szOutput += "\r\n"; + //::SendMessage( GetDlgItem( IDC_EDITEXPORT )->m_hWnd, WM_SETTEXT, 0, (LPARAM)szOutput.c_str() ); + AppendExportText(szOutput.c_str()); } } - ::SendMessage( GetDlgItem( IDC_EDITEXPORT )->m_hWnd, WM_SETTEXT, 0, (LPARAM)szOutput.c_str() ); + + // Drakier: Get the OS Version + szOutput = "\r\nOperating System:\r\n"; + const int BUFSIZE = 80; + OSVERSIONINFOEX osvi; + BOOL bOsVersionInfoEx; + + // Try calling GetVersionEx using the OSVERSIONINFOEX structure. + // If that fails, try using the OSVERSIONINFO structure. + ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX)); + osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); + + if( !(bOsVersionInfoEx = GetVersionEx ((OSVERSIONINFO *) &osvi)) ) + { + osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO); + GetVersionEx ( (OSVERSIONINFO *) &osvi); + } + + switch (osvi.dwPlatformId) + { + // Test for the Windows NT product family. + case VER_PLATFORM_WIN32_NT: + + // Test for the specific product family. + if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2 ) + szOutput += "Microsoft Windows Server 2003 family, "; + if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1 ) + szOutput += "Microsoft Windows XP "; + if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0 ) + szOutput += "Microsoft Windows 2000 "; + if ( osvi.dwMajorVersion <= 4 ) + szOutput += "Microsoft Windows NT "; + + // Test for specific product on Windows NT 4.0 SP6 and later. + if( bOsVersionInfoEx ) + { + // Test for the workstation type. + if ( osvi.wProductType == VER_NT_WORKSTATION ) + { + if( osvi.dwMajorVersion == 4 ) + szOutput += "Workstation 4.0 "; + else if( osvi.wSuiteMask & VER_SUITE_PERSONAL ) + szOutput += "Home Edition "; + else + szOutput += "Professional "; + } + + // Test for the server type. + else if ( osvi.wProductType == VER_NT_SERVER ) + { + if( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2 ) + { + if( osvi.wSuiteMask & VER_SUITE_DATACENTER ) + szOutput += "Datacenter Edition "; + else if( osvi.wSuiteMask & VER_SUITE_ENTERPRISE ) + szOutput += "Enterprise Edition "; + else if ( osvi.wSuiteMask == VER_SUITE_BLADE ) + szOutput += "Web Edition "; + else + szOutput += "Standard Edition "; + } + + else if( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0 ) + { + if( osvi.wSuiteMask & VER_SUITE_DATACENTER ) + szOutput += "Datacenter Server "; + else if( osvi.wSuiteMask & VER_SUITE_ENTERPRISE ) + szOutput += "Advanced Server "; + else + szOutput += "Server "; + } + + else // Windows NT 4.0 + { + if( osvi.wSuiteMask & VER_SUITE_ENTERPRISE ) + szOutput += "Server 4.0, Enterprise Edition "; + else + szOutput += "Server 4.0 "; + } + } + } + else // Test for specific product on Windows NT 4.0 SP5 and earlier + { + HKEY hKey; + char szProductType[BUFSIZE]; + DWORD dwBufLen=BUFSIZE; + LONG lRet; + + lRet = RegOpenKeyEx( HKEY_LOCAL_MACHINE, + "SYSTEM\\CurrentControlSet\\Control\\ProductOptions", + 0, KEY_QUERY_VALUE, &hKey ); + if( lRet == ERROR_SUCCESS ) + { + lRet = RegQueryValueEx( hKey, "ProductType", NULL, NULL, + (LPBYTE) szProductType, &dwBufLen); + if( (lRet == ERROR_SUCCESS) && (dwBufLen <= BUFSIZE) ) + { + RegCloseKey( hKey ); + + if ( lstrcmpi( "WINNT", szProductType) == 0 ) + szOutput += "Workstation "; + if ( lstrcmpi( "LANMANNT", szProductType) == 0 ) + szOutput += "Server "; + if ( lstrcmpi( "SERVERNT", szProductType) == 0 ) + szOutput += "Advanced Server "; + + szOutput += (char)osvi.dwMajorVersion; + szOutput += "."; + szOutput += (char)osvi.dwMinorVersion; + } + } + } + + // Display service pack (if any) and build number. + if( osvi.dwMajorVersion == 4 && + lstrcmpi( osvi.szCSDVersion, "Service Pack 6" ) == 0 ) + { + HKEY hKey; + LONG lRet; + + // Test for SP6 versus SP6a. + lRet = RegOpenKeyEx( HKEY_LOCAL_MACHINE, + "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Hotfix\\Q246009", + 0, KEY_QUERY_VALUE, &hKey ); + if( lRet == ERROR_SUCCESS ) + { + char szBuild[6]; //might make it a bit longer + memset(szBuild, 0, 6); + ltoa(osvi.dwBuildNumber & 0xFFFF, szBuild, 10); + + szOutput += "Service Pack 6a (Build "; + szOutput += szBuild; + szOutput += ")\r\n"; + } + else // Windows NT 4.0 prior to SP6a + { + char szBuild[6]; //might make it a bit longer + memset(szBuild, 0, 6); + ltoa(osvi.dwBuildNumber & 0xFFFF, szBuild, 10); + + szOutput += osvi.szCSDVersion; + szOutput += " (Build "; + szOutput += szBuild; + szOutput += ")\r\n"; + } + RegCloseKey( hKey ); + } + else // Windows NT 3.51 and earlier or Windows 2000 and later + { + char szBuild[6]; //might make it a bit longer + memset(szBuild, 0, 6); + ltoa(osvi.dwBuildNumber & 0xFFFF, szBuild, 10); + + szOutput += osvi.szCSDVersion; + szOutput += " (Build "; + szOutput += szBuild; + szOutput += ")\r\n"; + } + break; + + // Test for the Windows 95 product family. + case VER_PLATFORM_WIN32_WINDOWS: + if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 0) + { + szOutput += "Microsoft Windows 95 "; + if ( osvi.szCSDVersion[1] == 'C' || osvi.szCSDVersion[1] == 'B' ) + szOutput += "OSR2 "; + } + if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 10) + { + szOutput += "Microsoft Windows 98 "; + if ( osvi.szCSDVersion[1] == 'A' ) + szOutput += "SE "; + } + if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 90) + { + szOutput += "Microsoft Windows Millennium Edition\r\n"; + } + break; + + case VER_PLATFORM_WIN32s: + szOutput += "Microsoft Win32s\r\n"; + break; + } + //::SendMessage( GetDlgItem( IDC_EDITEXPORT )->m_hWnd, WM_SETTEXT, 0, (LPARAM)szOutput.c_str() ); + AppendExportText(szOutput.c_str()); + + // Drakier: Check the Protected Storage + RegKey key; + if ( key.Open( HKEY_LOCAL_MACHINE, _T( "SYSTEM\\CurrentControlSet\\Services\\ProtectedStorage" ) ) == ERROR_SUCCESS ) + { + DWORD dwStartMode; + szOutput = "\r\n[Protected Storage Service] : "; + if ( key.QueryDWORDValue( "Start", dwStartMode ) == ERROR_SUCCESS ) + { + switch (dwStartMode) + { + case 2: //automatic + szOutput += "Automatic\r\n"; + break; + case 3: // manual + szOutput += "Manual\r\n"; + break; + case 4: // disabled + szOutput += "Disabled\r\n"; + break; + } + } + key.Close(); + } + //::SendMessage( GetDlgItem( IDC_EDITEXPORT )->m_hWnd, WM_SETTEXT, 0, (LPARAM)szOutput.c_str() ); + AppendExportText(szOutput.c_str()); + + // Drakier: Get the Injection Mode + + if( key.Create( HKEY_LOCAL_MACHINE, _T( "SOFTWARE\\Decal" )) == ERROR_SUCCESS ) + { + DWORD dwViewMode; + szOutput = "\r\n[Injection Method] : "; + if( key.QueryDWORDValue( "OldInjection", dwViewMode )== ERROR_SUCCESS ) + { + if (dwViewMode == 1) + { + szOutput += "OLD\r\n"; + } + else + { + szOutput += "NEW\r\n"; + } + } + key.Close(); + } + //::SendMessage( GetDlgItem( IDC_EDITEXPORT )->m_hWnd, WM_SETTEXT, 0, (LPARAM)szOutput.c_str() ); + AppendExportText(szOutput.c_str()); + + // Drakier: Get the Runtime versions (if installed). + szOutput = "\r\nRuntime Libraries\r\n"; + AppendExportText(szOutput.c_str()); + // Visual Basic 6 Runtimes + szOutput = "[msvbvm60.dll]\t: "; + HMODULE hLib = ::LoadLibrary( "msvbvm60.dll" ); + if( hLib == NULL ) + szOutput += "Not Installed\r\n"; + else + szOutput += "Installed\r\n"; + ::FreeLibrary(hLib); + + // msvcp 7.0 Runtime + szOutput = "[msvcr70.dll]\t: "; + hLib = ::LoadLibrary( "msvcr70.dll" ); + if( hLib == NULL ) + szOutput += "Not Installed\r\n"; + else + szOutput += "Installed\r\n"; + ::FreeLibrary(hLib); + // msvcr 7.0 Runtime + szOutput += "[msvcp70.dll]\t: "; + hLib = ::LoadLibrary( "msvcp70.dll" ); + if( hLib == NULL ) + szOutput += "Not Installed\r\n"; + else + szOutput += "Installed\r\n"; + ::FreeLibrary(hLib); + + // msvcp 7.1 Runtime + szOutput += "[msvcr71.dll]\t: "; + hLib = ::LoadLibrary( "msvcr71.dll" ); + if( hLib == NULL ) + szOutput += "Not Installed\r\n"; + else + szOutput += "Installed\r\n"; + ::FreeLibrary(hLib); + // msvcr 7.1 Runtime + szOutput += "[msvcp71.dll]\t: "; + hLib = ::LoadLibrary( "msvcp71.dll" ); + if( hLib == NULL ) + szOutput += "Not Installed\r\n"; + else + szOutput += "Installed\r\n"; + ::FreeLibrary(hLib); + + // Haz - mfc+atl + // mfc 7.0 runtime + szOutput += "[mfc70.dll]\t: "; + hLib = ::LoadLibrary( "mfc70.dll" ); + if( hLib == NULL ) + szOutput += "Not Installed\r\n"; + else + szOutput += "Installed\r\n"; + ::FreeLibrary(hLib); + + // mfc 7.1 runtime + szOutput += "[mfc71.dll]\t: "; + hLib = ::LoadLibrary( "mfc71.dll" ); + if( hLib == NULL ) + szOutput += "Not Installed\r\n"; + else + szOutput += "Installed\r\n"; + ::FreeLibrary(hLib); + + // atl 7.0 runtime + szOutput += "[atl70.dll]\t\t: "; + hLib = ::LoadLibrary( "atl70.dll" ); + if( hLib == NULL ) + szOutput += "Not Installed\r\n"; + else + szOutput += "Installed\r\n"; + ::FreeLibrary(hLib); + + // atl 7.1 runtime + szOutput += "[atl71.dll]\t\t: "; + hLib = ::LoadLibrary( "atl71.dll" ); + if( hLib == NULL ) + szOutput += "Not Installed\r\n"; + else + szOutput += "Installed\r\n"; + ::FreeLibrary(hLib); + + //::SendMessage( GetDlgItem( IDC_EDITEXPORT )->m_hWnd, WM_SETTEXT, 0, (LPARAM)szOutput.c_str() ); + AppendExportText(szOutput.c_str()); + szOutput = ""; + + + // Drakier: Get the MSXML Versions + szOutput += "\r\nMicrosoft XML Libraries\r\n"; + + // msxml3 + szOutput += "[msxml3.dll]\t: "; + hLib = ::LoadLibrary( "msxml3.dll" ); + if( hLib == NULL ) + szOutput += "Not Installed\r\n"; + else + szOutput += "Installed\r\n"; + ::FreeLibrary(hLib); + + // msxml4 + szOutput += "[msxml4.dll]\t: "; + hLib = ::LoadLibrary( "msxml4.dll" ); + if( hLib == NULL ) + szOutput += "Not Installed\r\n"; + else + szOutput += "Installed\r\n"; + ::FreeLibrary(hLib); + + //::SendMessage( GetDlgItem( IDC_EDITEXPORT )->m_hWnd, WM_SETTEXT, 0, (LPARAM)szOutput.c_str() ); + AppendExportText(szOutput.c_str()); + szOutput = ""; + + // Drakier: Get the Compat Mode Layers and display them. + if (key.Open( HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\Layers" ) == ERROR_SUCCESS) + { + RegKey hkItem; + DWORD dwIndex = 0; + DWORD dwValues = NULL; + BOOL bTitle = FALSE; + + // Enum regkey for AppCompatFlags checking for client.exe + ::RegQueryInfoKey(key, NULL, NULL, NULL, NULL, NULL, NULL, &dwValues, NULL, NULL, NULL, NULL); + if (dwValues) + { + HRESULT retCode = ERROR_SUCCESS; + for (dwIndex = 0; dwIndex < dwValues; dwIndex++) + { + DWORD dwValueNameLen = 255; + DWORD dwValueDataLen = 10; + TCHAR szValueName[255]; + BYTE szValueData[10]; + //TCHAR szValueData[10]; + DWORD dwType; + + retCode = ::RegEnumValue ( key, dwIndex, szValueName, &dwValueNameLen, NULL, &dwType, szValueData, &dwValueDataLen ); + if ( retCode == ERROR_SUCCESS) + { + if ( strstr(szValueName, "client.exe") != NULL ) + { + if (!bTitle) + szOutput += "\r\nApplication Compatibility\r\n"; + bTitle = TRUE; + szOutput += szValueName; + szOutput += ": "; + szOutput += (char *)szValueData; + szOutput += "\r\n"; + } + } + } + } + } + key.Close(); + + // Display information + //::SendMessage( GetDlgItem( IDC_EDITEXPORT )->m_hWnd, WM_SETTEXT, 0, (LPARAM)szOutput.c_str() ); + AppendExportText(szOutput.c_str()); if (::MessageBox(NULL, "Would you like to export the data to the clipboard?", "Export Data...", MB_YESNO | MB_ICONQUESTION) == IDYES ) { if(OpenClipboard()) { - char *pszData = (char*)szOutput.c_str(); + DWORD dwTextLength = ::SendMessage( GetDlgItem( IDC_EDITEXPORT )->m_hWnd, WM_GETTEXTLENGTH, 0, 0) + 1; + char *szCBText = new char[dwTextLength]; + memset(szCBText, 0, dwTextLength); + ::SendMessage( GetDlgItem( IDC_EDITEXPORT )->m_hWnd, WM_GETTEXT, dwTextLength, (LPARAM)szCBText ); HGLOBAL hData; LPVOID pData; EmptyClipboard(); - hData = GlobalAlloc(GMEM_DDESHARE|GMEM_MOVEABLE,strlen(pszData) + 1); + hData = GlobalAlloc(GMEM_DDESHARE|GMEM_MOVEABLE,strlen(szCBText) + 1); pData = GlobalLock(hData); - strcpy((LPSTR)pData, pszData); + strcpy((LPSTR)pData, szCBText); GlobalUnlock(hData); SetClipboardData(CF_TEXT, hData); CloseClipboard(); + delete[] szCBText; } else ::MessageBox(NULL, "Error opening clipboard!", "Error...", MB_OK | MB_ICONERROR); Index: ExportDlg.h =================================================================== RCS file: /cvsroot/decaldev/source/DenAgent/ExportDlg.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ExportDlg.h 6 Feb 2004 17:39:03 -0000 1.1 +++ ExportDlg.h 12 Feb 2004 22:17:00 -0000 1.2 @@ -45,6 +45,7 @@ DECLARE_MESSAGE_MAP() public: void SetDecal(IDecal* pDecal); + void AppendExportText(const char* szNewText); CComPtr<IDecal> m_pDecal; afx_msg void OnBnClickedBtnexport(); }; |
From: BJ H. <par...@us...> - 2004-02-09 18:05:43
|
Log Message: ----------- Fix for network string changes Modified Files: -------------- /cvsroot/decaldev/source/DecalNet: MessageLoaders.cpp Revision Data ------------- Index: MessageLoaders.cpp =================================================================== RCS file: /cvsroot/decaldev/source/DecalNet/MessageLoaders.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- MessageLoaders.cpp 12 Apr 2002 01:07:34 -0000 1.2 +++ MessageLoaders.cpp 9 Feb 2004 18:02:30 -0000 1.3 @@ -138,22 +138,34 @@ if( ( reinterpret_cast< BYTE * >( pvData ) + wField ) > reinterpret_cast< BYTE * >( pvEnd ) ) return false; - if( *( reinterpret_cast< char * >( pvData ) + wLength - 1 ) != '\0' ) + // Strings are no longer NULL-Terminated in the stream + //if( *( reinterpret_cast< char * >( pvData ) + wLength - 1 ) != '\0' ) // This string is not NULL terminated - return false; + // return false; // Anything else just makes the string ugly, but won't lead to a memory // overrun, so let them play return true; } - virtual void getValue( void *pvData, LPVARIANT pDest ) - { - USES_CONVERSION; + virtual void getValue( void *pvData, LPVARIANT pDest ) + { + pDest->vt = VT_BSTR; - pDest->vt = VT_BSTR; - pDest->bstrVal = A2BSTR( reinterpret_cast< char * >( reinterpret_cast< BYTE * >( pvData ) + sizeof( WORD ) ) ); - } + USES_CONVERSION; + WORD wLength = *(WORD *) pvData; + + // Save the byte where we're going to insert our null terminator :P + char *szString = (char *) (((BYTE*) pvData) + sizeof( WORD )); + BYTE byteSaved = szString[ wLength ]; + szString[ wLength ] = 0; + + // this is way more efficient then a new, memcpy, and delete. go us + pDest->bstrVal = A2BSTR( szString ); + + // put byte back :) + szString[ wLength ] = byteSaved; + } }; long cFieldLoader::getNumber( void *pvData ) |
From: Drakier D. <dra...@us...> - 2004-02-06 17:41:47
|
Log Message: ----------- Added Export Dlg and start of Export functionality Modified Files: -------------- /cvsroot/decaldev/source/DenAgent: DenAgent.rc DenAgentDlg.cpp DenAgentDlg.h resource.h Added Files: ----------- /cvsroot/decaldev/source/DenAgent: ExportDlg.cpp ExportDlg.h Revision Data ------------- --- NEW FILE: ExportDlg.cpp --- // ExportDlg.cpp : implementation file // #include "stdafx.h" #include "DenAgent.h" #include "ExportDlg.h" #include "DenAgentDlg.h" #include <strstream> #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // cExportDlg dialog cExportDlg::cExportDlg(CWnd* pParent /*=NULL*/) : CDialog(cExportDlg::IDD, pParent) { //{{AFX_DATA_INIT(cExportDlg) //}}AFX_DATA_INIT } cExportDlg::~cExportDlg() { m_pDecal.Release(); } void cExportDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); } BEGIN_MESSAGE_MAP(cExportDlg, CDialog) //{{AFX_MSG_MAP(cExportDlg) ON_BN_CLICKED(IDC_BTNEXPORT, OnBnClickedBtnexport) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // cExportDlg message handlers BOOL cExportDlg::OnInitDialog() { CDialog::OnInitDialog(); ::SendMessage( GetDlgItem( IDC_CHKENABLED )->m_hWnd, BM_SETCHECK, TRUE, 0 ); ::SendMessage( GetDlgItem( IDC_CHKLOC )->m_hWnd, BM_SETCHECK, FALSE, 0 ); ::SendMessage( GetDlgItem( IDC_CHKCLSID )->m_hWnd, BM_SETCHECK, TRUE, 0 ); UpdateData(FALSE); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } struct cPluginGroup { LPCTSTR m_groupName, m_groupKey; int m_iconIndex; }; void cExportDlg::OnBnClickedBtnexport() { USES_CONVERSION; std::string szDelim = ", "; cPluginGroup _groups[] = { { _T( "Plugins" ), _T( "Plugins" ), 4 }, { _T( "Network Filters" ), _T( "NetworkFilters" ), 1 }, { _T( "File Filters" ), _T( "FileFilters" ), 1 }, { _T( "Services" ), _T( "Services" ), 0 }, { _T( "Surrogates" ), _T( "Surrogates" ), 3 }, { _T( "Input Actions" ), _T( "InputActions" ), 2 } }, *_end_groups = _groups + sizeof ( _groups ) / sizeof ( cPluginGroup ); int nCount = 0; std::string szOutput; szOutput += "type, "; if ( ::SendMessage( GetDlgItem( IDC_CHKENABLED )->m_hWnd, BM_GETCHECK, 0, 0 ) ) szOutput += "enabled, "; szOutput += "name, version, "; if ( ::SendMessage( GetDlgItem( IDC_CHKLOC )->m_hWnd, BM_GETCHECK, 0, 0 ) ) szOutput += "location, "; if ( ::SendMessage( GetDlgItem( IDC_CHKCLSID )->m_hWnd, BM_GETCHECK, 0, 0 ) ) szOutput += "clsid"; szOutput += "\r\n"; for ( cPluginGroup *i = _groups; i != _end_groups; ++ i ) { CComPtr<IDecalEnum> pEnum; HRESULT hRes = m_pDecal->get_Configuration ( _bstr_t ( i->m_groupKey ), GUID_NULL, &pEnum ); _ASSERTE( SUCCEEDED ( hRes ) ); while ( pEnum->Next () == S_OK ) { CLSID clsid; CComBSTR strName; CString strDLL; CString strDLLVersion; LPOLESTR szCLSID; hRes = pEnum->get_ComClass ( &clsid ); _ASSERTE ( SUCCEEDED ( hRes ) ); if ( !CDenAgentApp::getCOMObjectDLL ( clsid, strDLL ) ) strDLL = "<No DLL>"; if ( !CDenAgentApp::getVersionString ( strDLL, strDLLVersion ) ) strDLLVersion = _T( "<No Version>" ); szOutput += i->m_groupName; if ( ::SendMessage( GetDlgItem( IDC_CHKENABLED )->m_hWnd, BM_GETCHECK, 0, 0 ) ) { VARIANT_BOOL bEnabled; hRes = pEnum->get_Enabled ( &bEnabled ); _ASSERTE ( SUCCEEDED ( hRes ) ); szOutput += szDelim; szOutput += bEnabled?"1":"0"; } hRes = pEnum->get_FriendlyName( &strName ); _ASSERTE ( SUCCEEDED ( hRes ) ); szOutput += szDelim; szOutput += OLE2T ( strName ); szOutput += szDelim; szOutput += strDLLVersion; if ( ::SendMessage( GetDlgItem( IDC_CHKLOC )->m_hWnd, BM_GETCHECK, 0, 0 ) ) { szOutput += szDelim; szOutput += strDLL; } if ( ::SendMessage( GetDlgItem( IDC_CHKCLSID )->m_hWnd, BM_GETCHECK, 0, 0 ) ) { StringFromCLSID(clsid, &szCLSID); szOutput += szDelim; szOutput += OLE2T(szCLSID); ::CoTaskMemFree ( szCLSID ); } szOutput += "\r\n"; } } ::SendMessage( GetDlgItem( IDC_EDITEXPORT )->m_hWnd, WM_SETTEXT, 0, (LPARAM)szOutput.c_str() ); if (::MessageBox(NULL, "Would you like to export the data to the clipboard?", "Export Data...", MB_YESNO | MB_ICONQUESTION) == IDYES ) { if(OpenClipboard()) { char *pszData = (char*)szOutput.c_str(); HGLOBAL hData; LPVOID pData; EmptyClipboard(); hData = GlobalAlloc(GMEM_DDESHARE|GMEM_MOVEABLE,strlen(pszData) + 1); pData = GlobalLock(hData); strcpy((LPSTR)pData, pszData); GlobalUnlock(hData); SetClipboardData(CF_TEXT, hData); CloseClipboard(); } else ::MessageBox(NULL, "Error opening clipboard!", "Error...", MB_OK | MB_ICONERROR); } } void cExportDlg::SetDecal(IDecal* pDecal) { m_pDecal = pDecal; }--- NEW FILE: ExportDlg.h --- #include "afxwin.h" #if !defined(AFX_EXPORTDLG_H__F2DBFC10_6835_494D_9A03_B97D9068BAF9__INCLUDED_) #define AFX_EXPORTDLG_H__F2DBFC10_6835_494D_9A03_B97D9068BAF9__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include <Decal.h> // ExportDlg.h : header file // ///////////////////////////////////////////////////////////////////////////// // cExportDlg dialog class cExportDlg : public CDialog { // Construction public: cExportDlg(CWnd* pParent = NULL); // standard constructor ~cExportDlg(); // Dialog Data //{{AFX_DATA(cExportDlg) enum { IDD = IDD_EXPORT }; //}}AFX_DATA // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(cExportDlg) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL // Implementation protected: // Generated message map functions //{{AFX_MSG(cExportDlg) virtual BOOL OnInitDialog(); //}}AFX_MSG DECLARE_MESSAGE_MAP() public: void SetDecal(IDecal* pDecal); CComPtr<IDecal> m_pDecal; afx_msg void OnBnClickedBtnexport(); }; //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_ExportDlg_H__F2DBFC10_6835_494D_9A03_B97D9068BAF9__INCLUDED_) Index: DenAgent.rc =================================================================== RCS file: /cvsroot/decaldev/source/DenAgent/DenAgent.rc,v retrieving revision 1.79 retrieving revision 1.80 diff -u -d -r1.79 -r1.80 --- DenAgent.rc 6 Feb 2004 15:58:35 -0000 1.79 +++ DenAgent.rc 6 Feb 2004 17:39:03 -0000 1.80 @@ -81,6 +81,7 @@ LVS_NOCOLUMNHEADER | WS_TABSTOP,7,30,194,140, WS_EX_CLIENTEDGE PUSHBUTTON "Remove",IDC_DELETE,208,83,50,14 + PUSHBUTTON "Export",IDC_EXPORT,208,128,50,16 END IDD_ADDREMOVE DIALOGEX 0, 0, 301, 171 @@ -210,6 +211,25 @@ LTEXT "Total Progress:",IDC_STATUST,5,67,50,8 END +IDD_EXPORT DIALOGEX 0, 0, 231, 186 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | + WS_SYSMENU +CAPTION "Export Decal List" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + GROUPBOX "Export",IDC_STATIC,7,7,140,26 + CONTROL "Enabled",IDC_CHKENABLED,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,17,17,41,8 + CONTROL "Location",IDC_CHKLOC,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,61,17,41,8 + CONTROL "CLSID",IDC_CHKCLSID,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,106,17,34,8 + PUSHBUTTON "&Export",IDC_BTNEXPORT,151,11,69,20 + EDITTEXT IDC_EDITEXPORT,7,37,217,142,ES_MULTILINE | + ES_AUTOHSCROLL | ES_READONLY | ES_WANTRETURN | + WS_VSCROLL | WS_HSCROLL +END + ///////////////////////////////////////////////////////////////////////////// // @@ -330,6 +350,14 @@ TOPMARGIN, 7 BOTTOMMARGIN, 79 END + + IDD_EXPORT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 224 + TOPMARGIN, 7 + BOTTOMMARGIN, 179 + END END #endif // APSTUDIO_INVOKED Index: DenAgentDlg.cpp =================================================================== RCS file: /cvsroot/decaldev/source/DenAgent/DenAgentDlg.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- DenAgentDlg.cpp 15 Oct 2003 19:46:52 -0000 1.37 +++ DenAgentDlg.cpp 6 Feb 2004 17:39:03 -0000 1.38 @@ -6,12 +6,14 @@ #include "DenAgentDlg.h" #include "DownloaderDlg.h" #include "OptionsDlg.h" +#include "ExportDlg.h" #include "TrayWnd.h" #include "AutoUpdate.h" #include "..\Inject\InjectApi.h" #include "AddRemoveDlg.h" +#include ".\denagentdlg.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -54,6 +56,7 @@ ON_WM_LBUTTONUP() //}}AFX_MSG_MAP ON_BN_CLICKED(IDC_DELETE, OnBnClickedDelete) + ON_BN_CLICKED(IDC_EXPORT, OnBnClickedExport) END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// @@ -335,8 +338,8 @@ if (key.QueryStringValue( _T( "DecalDirectory" ), szURLDirectory, &dwSize ) != ERROR_SUCCESS) { - ::_tcscpy(szURLDirectory, "http://decaldev.sourceforge.net"); - key.SetStringValue("DecalDirectory", "http://decaldev.sourceforge.net"); + ::_tcscpy(szURLDirectory, "http://decal.acdev.org"); + key.SetStringValue("DecalDirectory", "http://decal.acdev.org"); } dwSize = MAX_PATH; @@ -589,6 +592,10 @@ if( szXML != "" ) bSuccess = m_pDoc->loadXML( _bstr_t( szXML.c_str() ) ); + + szXML = " "; + for( int i = 0; i < 2500; ++i ) + szXML += "DIRL"; } if( !bSuccess ) @@ -828,4 +835,10 @@ //refresh loadPluginList(); } -} \ No newline at end of file +} +void CDenAgentDlg::OnBnClickedExport() +{ + cExportDlg dlg; + dlg.SetDecal(m_pDecal); + dlg.DoModal(); +} Index: DenAgentDlg.h =================================================================== RCS file: /cvsroot/decaldev/source/DenAgent/DenAgentDlg.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- DenAgentDlg.h 20 Mar 2003 22:57:21 -0000 1.14 +++ DenAgentDlg.h 6 Feb 2004 17:39:03 -0000 1.15 @@ -91,6 +91,7 @@ DECLARE_MESSAGE_MAP() public: afx_msg void OnBnClickedDelete(); + afx_msg void OnBnClickedExport(); }; //{{AFX_INSERT_LOCATION}} Index: resource.h =================================================================== RCS file: /cvsroot/decaldev/source/DenAgent/resource.h,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- resource.h 10 Dec 2003 19:57:30 -0000 1.25 +++ resource.h 6 Feb 2004 17:39:03 -0000 1.26 @@ -26,6 +26,7 @@ #define IDD_DOWNLOADER 143 #define IDB_GROUPS 145 #define IDC_CURSOR1 147 +#define IDD_EXPORT 152 #define IDC_PLUGINS 1001 #define IDC_REFRESH 1002 #define IDC_CHANGE_DIR 1005 @@ -54,6 +55,7 @@ #define IDC_VIEWALPHA_SPIN 1024 #define IDC_EDIT1 1028 #define IDC_CUSTOM_FONT_EDIT 1028 +#define IDC_EDITEXPORT 1028 #define IDC_BLENDINGSOFTWARE 1030 #define IDC_BLENDINGGDIPLUS 1031 #define IDC_MESSAGES_TEXT 1031 @@ -75,13 +77,18 @@ #define IDC_DELETE 1050 #define IDC_BUTTON1 1051 #define IDC_FORMATHELP 1051 +#define IDC_BTNEXPORT 1051 +#define IDC_EXPORT 1051 #define IDC_COMBO 1052 #define IDC_FORMATCLR 1052 #define IDC_FORMATSTR 1053 #define IDC_CHECK1 1054 #define IDC_OLDINJECT 1054 +#define IDC_CHKENABLED 1054 #define IDC_DUALLOG 1055 +#define IDC_CHKLOC 1055 #define IDC_WINDOWED 1056 +#define IDC_CHKCLSID 1056 #define IDC_BUTTON2 1057 #define IDC_PATCHHELP 1057 #define IDC_NOMOVIES 1058 @@ -95,7 +102,7 @@ // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 152 +#define _APS_NEXT_RESOURCE_VALUE 153 #define _APS_NEXT_COMMAND_VALUE 32776 #define _APS_NEXT_CONTROL_VALUE 1061 #define _APS_NEXT_SYMED_VALUE 105 |
From: BJ H. <par...@us...> - 2004-02-06 16:01:19
|
Log Message: ----------- Fixed the spin controls Modified Files: -------------- /cvsroot/decaldev/source/DenAgent: DenAgent.rc Revision Data ------------- Index: DenAgent.rc =================================================================== RCS file: /cvsroot/decaldev/source/DenAgent/DenAgent.rc,v retrieving revision 1.78 retrieving revision 1.79 diff -u -d -r1.78 -r1.79 --- DenAgent.rc 10 Dec 2003 19:57:30 -0000 1.78 +++ DenAgent.rc 6 Feb 2004 15:58:35 -0000 1.79 @@ -1,7 +1,6 @@ // Microsoft Visual C++ generated resource script. // #include "resource.h" -#include "..\Include\DecalVersion.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// @@ -131,19 +130,21 @@ BEGIN DEFPUSHBUTTON "OK",IDOK,155,200,50,14 PUSHBUTTON "Cancel",IDCANCEL,214,200,50,14 - GROUPBOX "View Options",IDC_STATIC,7,7,257,157 - CTEXT "Bar Alpha",IDC_STATIC,17,20,35,8,SS_CENTERIMAGE - CONTROL "Spin1",IDC_BARALPHA_SPIN,"msctls_updown32", - UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | - UDS_ARROWKEYS,47,16,11,14 EDITTEXT IDC_BARALPHA,59,16,45,14,ES_CENTER | ES_AUTOHSCROLL | + ES_NUMBER | WS_GROUP + CONTROL "",IDC_BARALPHA_SPIN,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,93,16,11, + 14 + EDITTEXT IDC_VIEWALPHA,59,31,45,14,ES_CENTER | ES_AUTOHSCROLL | ES_NUMBER - CTEXT "View Alpha",IDC_STATIC,19,34,35,8,SS_CENTERIMAGE CONTROL "Spin2",IDC_VIEWALPHA_SPIN,"msctls_updown32", UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | - UDS_ARROWKEYS,47,31,11,14 - EDITTEXT IDC_VIEWALPHA,59,31,45,14,ES_CENTER | ES_AUTOHSCROLL | - ES_NUMBER + UDS_ARROWKEYS,93,31,11,14 + GROUPBOX "View Options",IDC_STATIC,7,7,257,157 + CTEXT "Bar Alpha",IDC_STATIC,17,20,35,8,SS_CENTERIMAGE | NOT + WS_GROUP + CTEXT "View Alpha",IDC_STATIC,19,34,35,8,SS_CENTERIMAGE | NOT + WS_GROUP CTEXT "0 is Transparent - 255 is Opaque",IDC_STATIC,21,46,106, 9 CONTROL "Use Hardware Mode",IDC_BLENDINGGDIPLUS,"Button", @@ -185,8 +186,8 @@ COMBOBOX IDC_DOCKPOS,159,135,92,43,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP GROUPBOX "Decal Update URL",IDC_STATIC,7,166,257,28 - LTEXT "http://decaldev.sourceforge.net",IDC_PLUGINDIR,14,178, - 169,8,SS_CENTERIMAGE + LTEXT "http://decal.acdev.org",IDC_PLUGINDIR,14,178,169,8, + SS_CENTERIMAGE PUSHBUTTON "Change",IDC_CHANGE_DIR,208,175,50,14 CONTROL "Start on Bootup",IDC_CHECK_AUTOSTART,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,14,202,63,12 @@ -216,8 +217,8 @@ // VS_VERSION_INFO VERSIONINFO - FILEVERSION DECAL_MAJOR,DECAL_MINOR,DECAL_BUGFIX,DECAL_RELEASE - PRODUCTVERSION DECAL_MAJOR,DECAL_MINOR,DECAL_BUGFIX,DECAL_RELEASE + FILEVERSION 2,6,0,4 + PRODUCTVERSION 2,6,0,4 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -234,12 +235,12 @@ BEGIN VALUE "Comments", "DenAgent is the program that manages Decal settings" VALUE "FileDescription", "DenAgent MFC Application" - VALUE "FileVersion", DECAL_VERSION_STRING + VALUE "FileVersion", "2, 6, 0, 4" VALUE "InternalName", "DenAgent" VALUE "LegalCopyright", "Copyright (C) 2000, 2001" VALUE "OriginalFilename", "DenAgent.EXE" VALUE "ProductName", "DenAgent Application" - VALUE "ProductVersion", DECAL_VERSION_STRING + VALUE "ProductVersion", "2, 6, 0, 4" END END BLOCK "VarFileInfo" |
From: Tracy B. <ar...@us...> - 2004-01-28 00:26:41
|
Log Message: ----------- Added Maximized Mode for Sidebar Mode Modified Files: -------------- /cvsroot/decaldev/source/Inject: BarLayer.cpp Revision Data ------------- Index: BarLayer.cpp =================================================================== RCS file: /cvsroot/decaldev/source/Inject/BarLayer.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- BarLayer.cpp 8 Jan 2004 23:14:15 -0000 1.19 +++ BarLayer.cpp 28 Jan 2004 00:25:37 -0000 1.20 @@ -15,6 +15,9 @@ const int CHATBAR_SIZE = 101; const int CHATBAR_MAX_SIZE = 259; const int LOOT_SIZE = 101; +const int BUTTON_SIZE = 16; +const int MINBAR_SIZE = 20; +int MAXBAR_SIZE = 100; // Drakier: Added constants for docking position const int DOCK_TOP = 0; @@ -80,8 +83,9 @@ if( key.QueryDWORDValue( "BarDock", (DWORD &)m_nBarDock ) != ERROR_SUCCESS ) m_nBarDock = DOCK_TOP; - if (m_nBarDock != DOCK_TOP) - m_nMinMax = eStateMin; + // Drakier: TESTING for Min/Max Side Dock + //if (m_nBarDock != DOCK_TOP) + //m_nMinMax = eStateMin; // Ok, first create the 4 background controls LayerParams lpChild; @@ -102,8 +106,6 @@ m_pBtnMinMax->SetImages( 0, 0x0600113C, 0x0600113C ); ICommandEventsImpl< BUTTON_MINMAX, cBarLayer >::advise( m_pBtnMinMax ); m_pBtnMinMax->put_Matte( RGB( 0, 0, 0 ) ); - - } { @@ -189,7 +191,7 @@ m_pBtnMinMax->SetImages( 0, 0x0600113C, 0x0600113C ); else m_pBtnMinMax->SetImages( 0, 0x0600113B, 0x0600113B ); - + //::MessageBox( NULL, _T( "Here" ), _T( "[Inject.dll] cBarLayer::onCreate" ), MB_OK ); } @@ -207,6 +209,13 @@ { _ASSERTE( pCanvas != NULL ); + SIZE sz; + m_pPlugin->GetScreenSize( &sz ); + if ( sz.cx <= 1024 ) + MAXBAR_SIZE = 80; + else + MAXBAR_SIZE = 100; + ClipParams p; pCanvas->GetClipParams( &p ); @@ -260,7 +269,10 @@ dragBarRect.top = 3; dragBarRect.left = 4; dragBarRect.bottom = 4; - dragBarRect.right = 19; + if (m_nMinMax == eStateMin) // Minimized + dragBarRect.right = MINBAR_SIZE - 4; + else // Maximized + dragBarRect.right = MAXBAR_SIZE - 4; pCanvas->Fill(&dragBarRect, RGB(214, 173, 140)); @@ -280,7 +292,10 @@ dragBarRect.top = m_nBarLength - 4; dragBarRect.left = 4; dragBarRect.bottom = m_nBarLength - 3; - dragBarRect.right = 19; + if (m_nMinMax == eStateMin) // Minimized + dragBarRect.right = MINBAR_SIZE - 4; + else // Maximized + dragBarRect.right = MAXBAR_SIZE - 4; pCanvas->Fill(&dragBarRect, RGB(165, 82, 57)); @@ -417,12 +432,19 @@ { rc.left = 0; rc.top = m_nBarStartPos; - rc.right = 23; rc.bottom = m_nBarStartPos + m_nBarLength; + if (m_nMinMax == eStateMin) // Minimized + rc.right = MINBAR_SIZE; + else // Maximized + rc.right = MAXBAR_SIZE; } else if (m_nBarDock == DOCK_RIGHT) // Right Dock { - rc.left = m_nScreenWidth - 23; + if (m_nMinMax == eStateMin) // Minimized + rc.left = m_nScreenWidth - MINBAR_SIZE; + else // Maximized + rc.left = m_nScreenWidth - MAXBAR_SIZE; + rc.top = m_nBarStartPos; rc.right = m_nScreenWidth; rc.bottom = m_nBarStartPos + m_nBarLength; @@ -440,119 +462,61 @@ // { 12, 3, 28, 19 } if (m_nBarDock != DOCK_TOP) // Side Dock { - //rc.left = 3; - //rc.top = 12; - //rc.right = 19; - //rc.bottom = 28; - - rc.left = -12; - rc.top = -12; - rc.right = -2; - rc.bottom = -2; + rc.left = 3; + rc.top = 12; + rc.right = rc.left + BUTTON_SIZE; + rc.bottom = rc.top + BUTTON_SIZE; } else // Top Dock { rc.left = 12; rc.top = 3; - rc.right = 28; - rc.bottom = 19; + rc.right = rc.left + BUTTON_SIZE; + rc.bottom = rc.top + BUTTON_SIZE; } CComPtr< ILayerSite > pMinMaxSite; m_pSite->get_Child( eBtnMinMax, ePositionByID, &pMinMaxSite ); pMinMaxSite->put_Position( &rc ); - - // Now do the backwards - if (m_nBarDock != DOCK_TOP) // Side Dock - { - //rc.left = 3; - //rc.top = 30; - //rc.right = 19; - //rc.bottom = 46; - - rc.left = 3; - rc.top = 12; - rc.right = 19; - rc.bottom = 28; - } - else // Top Dock - { - rc.left = 30; - rc.top = 3; - rc.right = 46; - rc.bottom = 19; - } - CComPtr< ILayerSite > pBackwardsSite; - m_pSite->get_Child( eBtnBackwards, ePositionByID, &pBackwardsSite ); - pBackwardsSite->put_Position( &rc ); - - // Drakier: this is a change because of the new LENGTH system - - // Now do the forwards - if (m_nBarDock != DOCK_TOP) // Side Dock - { - rc.left = 3; - rc.top = m_nBarLength - 46; - rc.right = 19; - rc.bottom = m_nBarLength - 30; - } - else // Top Dock - { - rc.left = m_nBarLength - 46; - rc.top = 3; - rc.right = m_nBarLength - 30; - rc.bottom = 19; - } - CComPtr< ILayerSite > pFwdSite; - m_pSite->get_Child( eBtnForwards, ePositionByID, &pFwdSite ); - pFwdSite->put_Position( &rc ); - + // Now do the dock cycle if (m_nBarDock != DOCK_TOP) // Side Dock - { - rc.left = 3; - rc.top = m_nBarLength - 28; - rc.right = 19; - rc.bottom = m_nBarLength - 12; + { + if (m_nMinMax == eStateMin) // minimized + { + rc.left = 3; + rc.top = m_nBarLength - 28; + rc.right = rc.left + BUTTON_SIZE; + rc.bottom = rc.top + BUTTON_SIZE; + } + else + { + rc.left = MAXBAR_SIZE - ( BUTTON_SIZE + 3 ); + rc.top = 12; + rc.right = rc.left + BUTTON_SIZE; + rc.bottom = rc.top + BUTTON_SIZE; + } } else // Top Dock { rc.left = m_nBarLength - 28; rc.top = 3; - rc.right = m_nBarLength - 12; - rc.bottom = 19; + rc.right = rc.left + BUTTON_SIZE; + rc.bottom = rc.top + BUTTON_SIZE; } CComPtr< ILayerSite > pDockCycleSite; m_pSite->get_Child( eBtnDockCycle, ePositionByID, &pDockCycleSite ); pDockCycleSite->put_Position( &rc ); - + // Now the pager - CComPtr< ILayerSite > pPagerSite; - m_pSite->get_Child( ePager, ePositionByID, &pPagerSite ); - - if (m_nBarDock != DOCK_TOP) // Side Dock - { - rc.left = 1; - //rc.top = 50; - rc.top = 30; - rc.right = 22; - rc.bottom = m_nBarLength - 48; - } - else // Top Dock - { - rc.left = 50; - rc.top = 1; - rc.right = m_nBarLength - 48; - rc.bottom = 22; - } - pPagerSite->put_Position( &rc ); - + CComPtr< ILayerSite > pPagerSite; + m_pSite->get_Child( ePager, ePositionByID, &pPagerSite ); + m_offsets.clear(); - + long nChildren; long nOffset = 0; long nDesired; - long nChildren; pPagerSite->get_ChildCount( &nChildren ); - + for( long nChild = 0; nChild < nChildren; ++ nChild ) { ViewParams pParams; @@ -573,16 +537,23 @@ pBarNative->put_Params(&pParams); if (m_nBarDock != DOCK_TOP) // Side Dock - { - nDesired = 20; + { + if (m_nMinMax == eStateMin) // Minimized + { + rc.right = MINBAR_SIZE - 2; + } + else // Maximized + { + rc.right = MAXBAR_SIZE - 2; + } + nDesired = 20; // Button Height rc.left = 0; - rc.top = nOffset; - rc.right = 21; + rc.top = nOffset; rc.bottom = nOffset + nDesired; } else // Top Dock { - // We always give bars their desired size + // We always give bars their desired size (Width) pBarNative->get_RenderWidth( &nDesired ); rc.left = nOffset; rc.top = 0; @@ -595,11 +566,146 @@ nOffset += nDesired + 2; } + // Calc ViewSlots for SideDock Maximized Up/Down Visibility + long nTotalBtnHeight; + // nOffset is total button height + nTotalBtnHeight = nOffset; + + bool showPosBtns; + //showPosBtns = (nTotalBtnHeight > m_nBarLength); + + if (m_nBarDock != DOCK_TOP) // Side Dock + { + rc.left = 1; + if (m_nMinMax == eStateMin) // minimized + { + showPosBtns = ( nTotalBtnHeight > ( m_nBarLength - 58 ) ); // Viewable Height + if ( showPosBtns ) + { + rc.top = 50; + rc.bottom = m_nBarLength - 48; + } + else + { + rc.top = 30; + rc.bottom = m_nBarLength - 28; + } + rc.right = MINBAR_SIZE - 1; + } + else // maximized + { + showPosBtns = ( nTotalBtnHeight > ( m_nBarLength - 44 ) ); // Viewable Height + rc.top = 30; + rc.right = MAXBAR_SIZE - 1; + rc.bottom = m_nBarLength - 12; + } + } + else // Top Dock + { + showPosBtns = ( nTotalBtnHeight > ( m_nBarLength - 58 ) ); //Max Viewable Width + if ( showPosBtns ) + { + rc.left = 50; + rc.right = m_nBarLength - 48; + } + else + { + rc.left = 30; + rc.right = m_nBarLength - 28; + } + rc.top = 1; + rc.bottom = 22; + } + pPagerSite->put_Position( &rc ); + + // Now do the backwards + if ( showPosBtns ) + { + if (m_nBarDock != DOCK_TOP) // Side Dock + { + if (m_nMinMax == eStateMin) // minimized + { + rc.left = 3; + rc.top = 30; + rc.right = rc.left + BUTTON_SIZE; + rc.bottom = rc.top + BUTTON_SIZE; + } + else + { + rc.top = 12; + rc.left = (MAXBAR_SIZE / 2) - 17; + rc.right = rc.left + BUTTON_SIZE; + rc.bottom = rc.top + BUTTON_SIZE; + } + } + else // Top Dock + { + rc.left = 30; + rc.top = 3; + rc.right = rc.left + BUTTON_SIZE; + rc.bottom = rc.top + BUTTON_SIZE; + } + } + else + { + rc.left = -30; + rc.top = -30; + rc.right = rc.left + BUTTON_SIZE; + rc.bottom = rc.top + BUTTON_SIZE; + } + CComPtr< ILayerSite > pBackwardsSite; + m_pSite->get_Child( eBtnBackwards, ePositionByID, &pBackwardsSite ); + pBackwardsSite->put_Position( &rc ); + + // Drakier: this is a change because of the new LENGTH system + + // Now do the forwards + if ( showPosBtns ) + { + if (m_nBarDock != DOCK_TOP) // Side Dock + { + if (m_nMinMax == eStateMin) // minimized + { + rc.left = 3; + rc.top = m_nBarLength - 46; + rc.right = rc.left + BUTTON_SIZE; + rc.bottom = rc.top + BUTTON_SIZE; + } + else + { + rc.top = 12; + rc.left = (MAXBAR_SIZE / 2) + 1; + rc.right = rc.left + BUTTON_SIZE; + rc.bottom = rc.top + BUTTON_SIZE; + } + } + else // Top Dock + { + rc.left = m_nBarLength - 46; + rc.top = 3; + rc.right = rc.left + BUTTON_SIZE; + rc.bottom = rc.top + BUTTON_SIZE; + } + } + else + { + rc.left = -30; + rc.top = -30; + rc.right = rc.left + BUTTON_SIZE; + rc.bottom = rc.top + BUTTON_SIZE; + } + CComPtr< ILayerSite > pFwdSite; + m_pSite->get_Child( eBtnForwards, ePositionByID, &pFwdSite ); + pFwdSite->put_Position( &rc ); + /* Drakier: Testing if un-needed // Check if the position is wrong now if( m_nPosition >= m_offsets.size() ) m_nPosition = m_offsets.size() - 1; */ + if ( !showPosBtns ) + m_nPosition = 0; + POINT pt = { ( m_nPosition <= 0 ) ? 0 : m_offsets[ m_nPosition ], 0 }; if (m_nBarDock != DOCK_TOP) // Side Dock @@ -626,7 +732,7 @@ case eBtnForwards: if (m_nBarDock != DOCK_TOP) // Side Dock { - if( !m_bLocked && ( m_nPosition < ( m_offsets.size() - 1 ) ) ) + if( !m_bLocked && ( m_offsets.size() > 0 ) && ( ( m_nPosition + 1 ) < m_offsets.size() ) ) { m_bLocked = TRUE; m_nPosition++; @@ -638,7 +744,7 @@ } else // Top Dock { - if( !m_bLocked && ( m_nPosition < ( m_offsets.size() - 1 ) ) ) + if( !m_bLocked && ( m_offsets.size() > 0 ) && ( ( m_nPosition + 1 ) < m_offsets.size() ) ) { //m_bLocked = TRUE; m_nPosition++; @@ -797,7 +903,9 @@ { m_pBtnForwards->SetImages( 0, 0x0600125E, 0x0600125F ); m_pBtnBackwards->SetImages( 0, 0x06001261, 0x06001262 ); - m_nMinMax = eStateMin; + //m_nMinMax = eStateMin; + if( key.QueryDWORDValue( "BarState", m_nMinMax ) != ERROR_SUCCESS ) + m_nMinMax = eStateMax; } else { @@ -809,6 +917,7 @@ key.SetDWORDValue("BarDock", m_nBarDock); + m_pPager->FinishCommand; Reformat(); } |
From: BJ H. <par...@us...> - 2004-01-09 21:53:05
|
Log Message: ----------- Crash bug in onTerm Modified Files: -------------- /cvsroot/decaldev/source/DecalFilters: World.cpp Revision Data ------------- Index: World.cpp =================================================================== RCS file: /cvsroot/decaldev/source/DecalFilters/World.cpp,v retrieving revision 1.56 retrieving revision 1.57 diff -u -d -r1.56 -r1.57 --- World.cpp 18 Sep 2003 02:55:31 -0000 1.56 +++ World.cpp 9 Jan 2004 21:53:02 -0000 1.57 @@ -323,19 +323,19 @@ { IACHooksEventsImpl<HookDestroyObj, cWorld>::unadvise(m_pHooks) ; - if( m_pHooks != NULL ) + if( m_pHooks.p != NULL ) { m_pHooks.Release() ; - m_pHooks = NULL ; + //m_pHooks = NULL ; } m_HookIsSet = false ; } - if( m_pDecal != NULL ) + if( m_pDecal.p != NULL ) { m_pDecal.Release() ; - m_pDecal = NULL ; + //m_pDecal = NULL ; } // cleanup our bstr mess... @@ -369,11 +369,7 @@ SysFreeString(strfireProt) ; SysFreeString(stracidProt) ; SysFreeString(strelectricalProt) ; - SysFreeString(strlandblock); - SysFreeString(strOffset); - SysFreeString(strStackCount); - SysFreeString(strstackCount); - SysFreeString(strvalue); + SysFreeString( strlandblock ); SysFreeString( strOffset ); SysFreeString( strStackCount ); |
From: Jeffrey D. <ha...@us...> - 2004-01-08 23:14:17
|
Log Message: ----------- Drak's view hindrances Modified Files: -------------- /cvsroot/decaldev/source/Inject: BarLayer.cpp Panel.cpp View.cpp Revision Data ------------- Index: BarLayer.cpp =================================================================== RCS file: /cvsroot/decaldev/source/Inject/BarLayer.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- BarLayer.cpp 23 Dec 2003 00:51:44 -0000 1.18 +++ BarLayer.cpp 8 Jan 2004 23:14:15 -0000 1.19 @@ -572,8 +572,6 @@ pParams.state = m_nMinMax; pBarNative->put_Params(&pParams); - // We always give bars their desired size - pBarNative->get_RenderWidth( &nDesired ); if (m_nBarDock != DOCK_TOP) // Side Dock { nDesired = 20; @@ -584,6 +582,8 @@ } else // Top Dock { + // We always give bars their desired size + pBarNative->get_RenderWidth( &nDesired ); rc.left = nOffset; rc.top = 0; rc.right = nOffset + nDesired; @@ -640,7 +640,7 @@ { if( !m_bLocked && ( m_nPosition < ( m_offsets.size() - 1 ) ) ) { - m_bLocked = TRUE; + //m_bLocked = TRUE; m_nPosition++; *pnX = m_offsets[ m_nPosition ]; *pnY = 0; @@ -667,7 +667,7 @@ { if( !m_bLocked && m_nPosition > 0 ) { - m_bLocked = TRUE; + //m_bLocked = TRUE; m_nPosition--; *pnX = m_offsets[ m_nPosition ]; *pnY = 0; Index: Panel.cpp =================================================================== RCS file: /cvsroot/decaldev/source/Inject/Panel.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- Panel.cpp 5 Oct 2003 18:00:41 -0000 1.17 +++ Panel.cpp 8 Jan 2004 23:14:15 -0000 1.18 @@ -8,7 +8,7 @@ enum ePanelChildren { - eViewFirst = 1000 + eViewFirst = 1000 }; cPanel::cPanel() @@ -26,89 +26,89 @@ void cPanel::hideView() { - m_pSite->Invalidate(); + m_pSite->Invalidate(); - if( m_nActiveView == -1 ) - // No active view currently - return; + if( m_nActiveView == -1 ) + // No active view currently + return; - CComPtr< ILayerSite > pActive; - m_pSite->get_Child( m_nActiveView, ePositionByID, &pActive ); + CComPtr< ILayerSite > pActive; + m_pSite->get_Child( m_nActiveView, ePositionByID, &pActive ); - static RECT rcHide = { 0, 0, 0, 0 }; - pActive->put_Position( &rcHide ); + static RECT rcHide = { 0, 0, 0, 0 }; + pActive->put_Position( &rcHide ); - if( m_pSink.p != NULL ) - m_pSink->PanelDeactivate( m_nActiveView ); + if( m_pSink.p != NULL ) + m_pSink->PanelDeactivate( m_nActiveView ); - m_nActiveView = -1; + m_nActiveView = -1; } void cPanel::onCreate() { - CComPtr< IPluginSite > pPlugin; - m_pSite->get_PluginSite( &pPlugin ); + CComPtr< IPluginSite > pPlugin; + m_pSite->get_PluginSite( &pPlugin ); - pPlugin->LoadBitmapPortal( 0x0600126F, &m_pBackground ); - pPlugin->LoadBitmapPortal( 0x06001277, &m_pBorder ); - BSTR bstrFontName; - pPlugin->get_FontName(&bstrFontName); - pPlugin->CreateFont( bstrFontName /*_bstr_t( _T( "Times New Roman" ) )*/, 15, eFontBold, &m_pTitle ); + pPlugin->LoadBitmapPortal( 0x0600126F, &m_pBackground ); + pPlugin->LoadBitmapPortal( 0x06001277, &m_pBorder ); + BSTR bstrFontName; + pPlugin->get_FontName(&bstrFontName); + pPlugin->CreateFont( bstrFontName /*_bstr_t( _T( "Times New Roman" ) )*/, 15, eFontBold, &m_pTitle ); - // Create the Button - CComPtr< IButton > pRollup; + // Create the Button + CComPtr< IButton > pRollup; - HRESULT hRes = ::CoCreateInstance( CLSID_Button, NULL, CLSCTX_INPROC_SERVER, IID_IButton, - reinterpret_cast< void ** >( &pRollup ) ); + HRESULT hRes = ::CoCreateInstance( CLSID_Button, NULL, CLSCTX_INPROC_SERVER, IID_IButton, + reinterpret_cast< void ** >( &pRollup ) ); - _ASSERTE( SUCCEEDED( hRes ) ); + _ASSERTE( SUCCEEDED( hRes ) ); - CComPtr< ILayer > pBtnLayer; - pRollup->QueryInterface( &pBtnLayer ); + CComPtr< ILayer > pBtnLayer; + pRollup->QueryInterface( &pBtnLayer ); - LayerParams lp = { 1, { 180 - 16, 0, 180, 16 }, eRenderClipped }; - m_pSite->CreateChild( &lp, pBtnLayer ); + LayerParams lp = { 1, { 180 - 16, 0, 180, 16 }, eRenderClipped }; + m_pSite->CreateChild( &lp, pBtnLayer ); - pRollup->put_Matte( RGB( 0, 0, 0 ) ); - pRollup->SetImages( 0, 0x0600113C, 0x0600113B ); - ICommandEventsImpl< BUTTON_CLOSE, cPanel >::advise( pRollup ); + pRollup->put_Matte( RGB( 0, 0, 0 ) ); + pRollup->SetImages( 0, 0x0600113C, 0x0600113B ); + ICommandEventsImpl< BUTTON_CLOSE, cPanel >::advise( pRollup ); - // Create the Increment Button - hRes = ::CoCreateInstance( CLSID_Button, NULL, CLSCTX_INPROC_SERVER, IID_IButton, - reinterpret_cast< void ** >( &m_pButtonInc ) ); + // Create the Increment Button + hRes = ::CoCreateInstance( CLSID_Button, NULL, CLSCTX_INPROC_SERVER, IID_IButton, + reinterpret_cast< void ** >( &m_pButtonInc ) ); - _ASSERTE( SUCCEEDED( hRes ) ); + _ASSERTE( SUCCEEDED( hRes ) ); - CComPtr< ILayer > pBtnIncLayer; - m_pButtonInc->QueryInterface( &pBtnIncLayer ); + CComPtr< ILayer > pBtnIncLayer; + m_pButtonInc->QueryInterface( &pBtnIncLayer ); - LayerParams lpInc = { 2, { 180 - 32, 0, 180 - 32 + 16, 16 }, eRenderClipped }; - m_pSite->CreateChild( &lpInc, pBtnIncLayer ); + LayerParams lpInc = { 2, { 180 - 32, 0, 180 - 32 + 16, 16 }, eRenderClipped }; + m_pSite->CreateChild( &lpInc, pBtnIncLayer ); - m_pButtonInc->put_Matte( RGB( 0, 0, 0 ) ); - m_pButtonInc->SetImages( 0, 0x06001298, 0x06001299 ); + m_pButtonInc->put_Matte( RGB( 0, 0, 0 ) ); + m_pButtonInc->SetImages( 0, 0x06001298, 0x06001299 ); - ICommandEventsImpl< BUTTON_INC, cPanel >::advise( m_pButtonInc ); + ICommandEventsImpl< BUTTON_INC, cPanel >::advise( m_pButtonInc ); - // Create the Decrement Button - hRes = ::CoCreateInstance( CLSID_Button, NULL, CLSCTX_INPROC_SERVER, IID_IButton, - reinterpret_cast< void ** >( &m_pButtonDec ) ); + // Create the Decrement Button + hRes = ::CoCreateInstance( CLSID_Button, NULL, CLSCTX_INPROC_SERVER, IID_IButton, + reinterpret_cast< void ** >( &m_pButtonDec ) ); - _ASSERTE( SUCCEEDED( hRes ) ); + _ASSERTE( SUCCEEDED( hRes ) ); - CComPtr< ILayer > pBtnDecLayer; - m_pButtonDec->QueryInterface( &pBtnDecLayer ); + CComPtr< ILayer > pBtnDecLayer; + m_pButtonDec->QueryInterface( &pBtnDecLayer ); - LayerParams lpDec = { 3, { 180 - 48, 0, 180 - 48 + 16, 16 }, eRenderClipped }; - m_pSite->CreateChild( &lpDec, pBtnDecLayer ); + LayerParams lpDec = { 3, { 180 - 48, 0, 180 - 48 + 16, 16 }, eRenderClipped }; + m_pSite->CreateChild( &lpDec, pBtnDecLayer ); - m_pButtonDec->put_Matte( RGB( 0, 0, 0 ) ); - m_pButtonDec->SetImages( 0, 0x06001295, 0x06001296 ); + m_pButtonDec->put_Matte( RGB( 0, 0, 0 ) ); + m_pButtonDec->SetImages( 0, 0x06001295, 0x06001296 ); - ICommandEventsImpl< BUTTON_DEC, cPanel >::advise( m_pButtonDec ); + ICommandEventsImpl< BUTTON_DEC, cPanel >::advise( m_pButtonDec ); - // Set this layer not transparent to be transparent - m_pSite->put_Transparent( VARIANT_FALSE ); + // Set this layer not transparent to be transparent + m_pSite->put_Transparent( VARIANT_FALSE ); RegKey key; key.Create( HKEY_LOCAL_MACHINE, _T( "SOFTWARE\\Decal" ) ); @@ -119,278 +119,278 @@ void cPanel::onDestroy() { - m_pBorder.Release(); - m_pBackground.Release(); - m_pTitle.Release(); - m_pButtonInc.Release(); - m_pButtonDec.Release(); + m_pBorder.Release(); + m_pBackground.Release(); + m_pTitle.Release(); + m_pButtonInc.Release(); + m_pButtonDec.Release(); } STDMETHODIMP cPanel::Render( ICanvas *pCanvas ) { - RECT rc; - m_pSite->get_Position( &rc ); + RECT rc; + m_pSite->get_Position( &rc ); - SIZE szBorder; - m_pBorder->get_Size( &szBorder ); + SIZE szBorder; + m_pBorder->get_Size( &szBorder ); - // Draw the background - RECT rc_pat = { 0, 0, rc.right - rc.left, rc.bottom - rc.top }; - static POINT pt_pat = { 0, 0 }; + // Draw the background + RECT rc_pat = { 0, 0, rc.right - rc.left, rc.bottom - rc.top }; + static POINT pt_pat = { 0, 0 }; if( ! m_bTransparent ) m_pBackground->PatBlt( pCanvas, &rc_pat, &pt_pat ); - // Draw the borders - RECT rc_border_top = { 0, 0, rc.right - rc.left, szBorder.cy }, - rc_border_bottom = { 0, rc.bottom - rc.top - szBorder.cy, - rc.right - rc.left, rc.bottom - rc.top }; + // Draw the borders + RECT rc_border_top = { 0, 0, rc.right - rc.left, szBorder.cy }, + rc_border_bottom = { 0, rc.bottom - rc.top - szBorder.cy, + rc.right - rc.left, rc.bottom - rc.top }; - pCanvas->Fill( &rc_border_top, RGB( 0, 0, 0 ) ); - m_pBorder->PatBlt( pCanvas, &rc_border_top, &pt_pat ); - pCanvas->Fill( &rc_border_bottom, RGB( 0, 0, 0 ) ); - m_pBorder->PatBlt( pCanvas, &rc_border_bottom, &pt_pat ); + pCanvas->Fill( &rc_border_top, RGB( 0, 0, 0 ) ); + m_pBorder->PatBlt( pCanvas, &rc_border_top, &pt_pat ); + pCanvas->Fill( &rc_border_bottom, RGB( 0, 0, 0 ) ); + m_pBorder->PatBlt( pCanvas, &rc_border_bottom, &pt_pat ); - // Draw the title text - if( _bstr_t(m_pVP->label).length() > 0 ) - { - POINT ptText = { 24, szBorder.cy + 5 }; - m_pTitle->DrawText( &ptText, m_pVP->label, 0, pCanvas ); - } + // Draw the title text + if( _bstr_t(m_pVP->label).length() > 0 ) + { + POINT ptText = { 24, szBorder.cy + 5 }; + m_pTitle->DrawText( &ptText, m_pVP->label, 0, pCanvas ); + } - if( m_pVP->icon != 0 ) - { - CComPtr< IPluginSite > pPlugin; - m_pSite->get_PluginSite( &pPlugin ); + if( m_pVP->icon != 0 ) + { + CComPtr< IPluginSite > pPlugin; + m_pSite->get_PluginSite( &pPlugin ); - CComPtr< IIconCache > pIconCache; - static SIZE szIcon = { 16, 16 }; - pPlugin->GetIconCache( &szIcon, &pIconCache ); + CComPtr< IIconCache > pIconCache; + static SIZE szIcon = { 16, 16 }; + pPlugin->GetIconCache( &szIcon, &pIconCache ); - static POINT pt = { 4, szBorder.cy + 4 }; - pIconCache->DrawIcon( &pt, m_pVP->icon, m_pVP->iconLibrary, pCanvas ); - } + static POINT pt = { 4, szBorder.cy + 4 }; + pIconCache->DrawIcon( &pt, m_pVP->icon, m_pVP->iconLibrary, pCanvas ); + } - _ASSERTMEM( _CrtCheckMemory( ) ); + _ASSERTMEM( _CrtCheckMemory( ) ); - return S_OK; + return S_OK; } STDMETHODIMP cPanel::Reformat() { - // Reset the size - CComPtr< IPluginSite > pPlugin; - m_pSite->get_PluginSite( &pPlugin ); + // Reset the size + CComPtr< IPluginSite > pPlugin; + m_pSite->get_PluginSite( &pPlugin ); - SIZE szScreen; - pPlugin->GetScreenSize( &szScreen ); + SIZE szScreen; + pPlugin->GetScreenSize( &szScreen ); - RECT rc = { m_pVP->left, m_pVP->top, m_pVP->left + m_pVP->width, m_pVP->top + m_pVP->height }; + RECT rc = { m_pVP->left, m_pVP->top, m_pVP->left + m_pVP->width, m_pVP->top + m_pVP->height }; - m_pSite->put_Position( &rc ); + m_pSite->put_Position( &rc ); - RECT rcCloseBtn = { m_pVP->width - 16, 0, m_pVP->width, 16 }; - CComPtr< ILayerSite > pCloseBtnLS; - m_pSite->get_Child(1, ePositionByID, &pCloseBtnLS); + RECT rcCloseBtn = { m_pVP->width - 16, 0, m_pVP->width, 16 }; + CComPtr< ILayerSite > pCloseBtnLS; + m_pSite->get_Child(1, ePositionByID, &pCloseBtnLS); - pCloseBtnLS->put_Position(&rcCloseBtn); - - RECT rcIncBtn = { m_pVP->width - 32, 0, m_pVP->width - 32 + 16, 16 }; - CComPtr< ILayerSite > pButtonInc; - m_pSite->get_Child(2, ePositionByID, &pButtonInc); - pButtonInc->put_Position( &rcIncBtn ); + pCloseBtnLS->put_Position(&rcCloseBtn); + + RECT rcIncBtn = { m_pVP->width - 32, 0, m_pVP->width - 32 + 16, 16 }; + CComPtr< ILayerSite > pButtonInc; + m_pSite->get_Child(2, ePositionByID, &pButtonInc); + pButtonInc->put_Position( &rcIncBtn ); - RECT rcDecBtn = { m_pVP->width - 48, 0, m_pVP->width - 48 + 16, 16 }; - CComPtr< ILayerSite > pButtonDec; - m_pSite->get_Child(3, ePositionByID, &pButtonDec); - pButtonDec->put_Position( &rcDecBtn ); + RECT rcDecBtn = { m_pVP->width - 48, 0, m_pVP->width - 48 + 16, 16 }; + CComPtr< ILayerSite > pButtonDec; + m_pSite->get_Child(3, ePositionByID, &pButtonDec); + pButtonDec->put_Position( &rcDecBtn ); - if( m_nActiveView != -1 ) - { - // Position the active view - SIZE szBorder; - m_pBorder->get_Size( &szBorder ); + if( m_nActiveView != -1 ) + { + // Position the active view + SIZE szBorder; + m_pBorder->get_Size( &szBorder ); - CComPtr< ILayerSite > pActive; - m_pSite->get_Child( m_nActiveView, ePositionByID, &pActive ); + CComPtr< ILayerSite > pActive; + m_pSite->get_Child( m_nActiveView, ePositionByID, &pActive ); - RECT rcChild = { 0, 24 + szBorder.cy, m_pVP->width, m_pVP->height - szBorder.cy }; - pActive->put_Position( &rcChild ); - } + RECT rcChild = { 0, 24 + szBorder.cy, m_pVP->width, m_pVP->height - szBorder.cy }; + pActive->put_Position( &rcChild ); + } - return S_OK; + return S_OK; } STDMETHODIMP cPanel::AddView(long nViewID, ILayer *pLayer) { - _ASSERTE( pLayer != NULL ); + _ASSERTE( pLayer != NULL ); - LayerParams p = { nViewID, { 0, 0, 0, 0 }, eRenderClipped }; + LayerParams p = { nViewID, { 0, 0, 0, 0 }, eRenderClipped }; - // Set up the layer - note that it is not visible - return m_pSite->CreateChild( &p, pLayer ); + // Set up the layer - note that it is not visible + return m_pSite->CreateChild( &p, pLayer ); } STDMETHODIMP cPanel::ActivateView(long nViewID, ViewParams *pParams, long *pView) { - // Hide the current view by resizing to 0,0 - hideView(); + // Hide the current view by resizing to 0,0 + hideView(); - m_pVP = pParams; + m_pVP = pParams; - m_pcView = (cView*)pView; + m_pcView = (cView*)pView; VARIANT_BOOL isTransparent=VARIANT_FALSE ; if (m_pcView) m_pcView->get_Transparent(&isTransparent) ; put_Transparent(isTransparent) ; - if( m_pVP->alpha == -1 ) - m_pSite->put_Alpha( m_Alpha ); - else - m_pSite->put_Alpha( m_pVP->alpha ); + if( m_pVP->alpha == -1 ) + m_pSite->put_Alpha( m_Alpha ); + else + m_pSite->put_Alpha( m_pVP->alpha ); #ifdef _DEBUG - // Make sure the child exists - CComPtr< ILayerSite > pChildSite; - _ASSERTE( SUCCEEDED( m_pSite->get_Child( nViewID, ePositionByID, &pChildSite ) ) ); + // Make sure the child exists + CComPtr< ILayerSite > pChildSite; + _ASSERTE( SUCCEEDED( m_pSite->get_Child( nViewID, ePositionByID, &pChildSite ) ) ); #endif - // Locate the child - m_nActiveView = nViewID; + // Locate the child + m_nActiveView = nViewID; - // Trick it into reformatting next frame - static RECT rcBig = { 0, 0, 1, 1 }; - m_pSite->put_Position( &rcBig ); + // Trick it into reformatting next frame + static RECT rcBig = { 0, 0, 1, 1 }; + m_pSite->put_Position( &rcBig ); - // Pop us to the front - m_pSite->moveToFront(); + // Pop us to the front + m_pSite->moveToFront(); return S_OK; } STDMETHODIMP cPanel::RemoveView( long nViewID ) { - if( nViewID == m_nActiveView ) - // If this is the current view, run and hide - Deactivate(); + if( nViewID == m_nActiveView ) + // If this is the current view, run and hide + Deactivate(); - CComPtr< ILayerSite > pChildSite; - HRESULT hRes = m_pSite->get_Child( nViewID, ePositionByID, &pChildSite ); - _ASSERTE( SUCCEEDED( hRes ) ); - if( SUCCEEDED( hRes ) ) + CComPtr< ILayerSite > pChildSite; + HRESULT hRes = m_pSite->get_Child( nViewID, ePositionByID, &pChildSite ); + _ASSERTE( SUCCEEDED( hRes ) ); + if( SUCCEEDED( hRes ) ) pChildSite->Destroy(); - else - return E_FAIL; + else + return E_FAIL; return S_OK; } void cPanel::onCloseAccepted(long nID) { - // We should only be getting commands from the button - _ASSERTE( nID == 1 ); + // We should only be getting commands from the button + _ASSERTE( nID == 1 ); - Deactivate(); + Deactivate(); } void cPanel::onAlphaInc(long nID) { - // We should only be getting commands from the button - _ASSERTE( nID == 2 ); + // We should only be getting commands from the button + _ASSERTE( nID == 2 ); - if(m_pVP->alpha == -1 ) - { - m_pVP->alpha = m_Alpha + 5; - m_pSite->put_Alpha( m_pVP->alpha ); - } - else - { - m_pVP->alpha += 5; - - if( m_pVP->alpha > 255 ) - m_pVP->alpha = 255; - - m_pSite->put_Alpha( m_pVP->alpha ); - } + if(m_pVP->alpha == -1 ) + { + m_pVP->alpha = m_Alpha + 5; + m_pSite->put_Alpha( m_pVP->alpha ); + } + else + { + m_pVP->alpha += 5; + + if( m_pVP->alpha > 255 ) + m_pVP->alpha = 255; + + m_pSite->put_Alpha( m_pVP->alpha ); + } } void cPanel::onAlphaDec(long nID) { - // We should only be getting commands from the button - _ASSERTE( nID == 3 ); + // We should only be getting commands from the button + _ASSERTE( nID == 3 ); - if(m_pVP->alpha == -1 ) - { - m_pVP->alpha = m_Alpha - 5; - m_pSite->put_Alpha( m_pVP->alpha ); - } - else - { - m_pVP->alpha -= 5; - - if( m_pVP->alpha < 0 ) - m_pVP->alpha = 0; - - m_pSite->put_Alpha( m_pVP->alpha ); - } + if(m_pVP->alpha == -1 ) + { + m_pVP->alpha = m_Alpha - 5; + m_pSite->put_Alpha( m_pVP->alpha ); + } + else + { + m_pVP->alpha -= 5; + + if( m_pVP->alpha < 0 ) + m_pVP->alpha = 0; + + m_pSite->put_Alpha( m_pVP->alpha ); + } } STDMETHODIMP cPanel::get_ActiveView(long *pVal) { - _ASSERTE( pVal != NULL ); + _ASSERTE( pVal != NULL ); - *pVal = m_nActiveView; + *pVal = m_nActiveView; - return S_OK; + return S_OK; } STDMETHODIMP cPanel::LoadView(long nViewID, IView *pView, IUnknown *pSchema) { - _ASSERTE( pView != NULL ); - _ASSERTE( pSchema != NULL ); + _ASSERTE( pView != NULL ); + _ASSERTE( pSchema != NULL ); - long nAssigned; + long nAssigned; - // Set up the layer - note that it is not visible - return pView->LoadControl( m_pSite, nViewID, pSchema, &nAssigned ); + // Set up the layer - note that it is not visible + return pView->LoadControl( m_pSite, nViewID, pSchema, &nAssigned ); } STDMETHODIMP cPanel::LoadViewEx(long nViewID, IView *pView, IUnknown *pSchema, long lViewFlags) { - _ASSERTE( pView != NULL ); - _ASSERTE( pSchema != NULL ); + _ASSERTE( pView != NULL ); + _ASSERTE( pSchema != NULL ); - long nAssigned; + long nAssigned; - if( lViewFlags & eTransparent ) - m_bTransparent = true; + if( lViewFlags & eTransparent ) + m_bTransparent = true; - // Set up the layer - note that it is not visible - return pView->LoadControl( m_pSite, nViewID, pSchema, &nAssigned ); + // Set up the layer - note that it is not visible + return pView->LoadControl( m_pSite, nViewID, pSchema, &nAssigned ); } STDMETHODIMP cPanel::Deactivate() { - if( m_nActiveView == -1 ) - // No active view currently - return S_OK; + if( m_nActiveView == -1 ) + // No active view currently + return S_OK; - // Hide the current view by resizing to 0,0 - hideView(); + // Hide the current view by resizing to 0,0 + hideView(); - // Hide the entire panel - static RECT rcHide = { 0, 0, 0, 0 }; - m_pSite->put_Position( &rcHide ); + // Hide the entire panel + static RECT rcHide = { 0, 0, 0, 0 }; + m_pSite->put_Position( &rcHide ); - m_nActiveView = -1; + m_nActiveView = -1; return S_OK; } STDMETHODIMP cPanel::putref_Sink(IPanelSink *newVal) { - m_pSink = newVal; + m_pSink = newVal; return S_OK; } @@ -478,6 +478,55 @@ { m_pVP->left = ptm.x-m_DeltaX; m_pVP->top = ptm.y-m_DeltaY; + + /* Drakier: make sure they aren't being bad little kittens and + moving the view offscreen! */ + // Drakier: Get the pSite and Screen Size + + CComPtr< IPluginSite > pPlugin; + CComPtr< IACHooks > pHooks; + m_pSite->get_PluginSite( &pPlugin ); + + SIZE szScreen, sz; + pPlugin->GetScreenSize( &sz ); + szScreen.cx = sz.cx; + szScreen.cy = sz.cy; + + long lX = sz.cx, lY = sz.cy; + + // Drakier: if we are not in the container, get the 3D Area + if ( !cManager::_p->m_bContainer ) + { + pPlugin->get_Hooks( &pHooks ); + pHooks->get_Area3DHeight( &lY ); + pHooks->get_Area3DWidth( &lX ); + pHooks.Release(); + } + pPlugin.Release(); + + // Drakier: if we are in the container, or the 3D area's are NULL + if ( (cManager::_p->m_bContainer) || (&lX == NULL) || (&lY == NULL) ) + { + szScreen.cx = sz.cx - 308; // 308 = PANEL_SIZE + szScreen.cy = sz.cy; + } + else // Drakier: If everything comes out right and we are not in container + { + if( (&lX != NULL) && (lX > 0) && (lX < 5000) ) + szScreen.cx = lX; + if( (&lY != NULL) && (lY > 0) && (lY < 5000) ) + szScreen.cy = lY; + } + + if ( m_pVP->left < 0 ) + m_pVP->left = 0; + if ( m_pVP->top < 0 ) + m_pVP->top = 0; + if ( (m_pVP->left + m_pVP->width) > szScreen.cx ) + m_pVP->left = szScreen.cx - m_pVP->width; + if ( (m_pVP->top + m_pVP->height) > szScreen.cy ) + m_pVP->top = szScreen.cy - m_pVP->height; + bUpdate = true; } else @@ -561,7 +610,7 @@ break; } } - return S_OK; + return S_OK; } STDMETHODIMP cPanel::get_Transparent(VARIANT_BOOL *pVal) Index: View.cpp =================================================================== RCS file: /cvsroot/decaldev/source/Inject/View.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- View.cpp 23 Dec 2003 00:51:44 -0000 1.32 +++ View.cpp 8 Jan 2004 23:14:15 -0000 1.33 @@ -32,198 +32,198 @@ long cView::loadSchema( BSTR strSchema, IUnknown **ppRootControl ) { - USES_CONVERSION; + USES_CONVERSION; - _ASSERTE( strSchema != NULL ); + _ASSERTE( strSchema != NULL ); - // Create a new XML document and load this up - MSXML::IXMLDOMDocumentPtr pDoc; - pDoc.CreateInstance( __uuidof( MSXML::DOMDocument ), NULL, CLSCTX_INPROC_SERVER ); + // Create a new XML document and load this up + MSXML::IXMLDOMDocumentPtr pDoc; + pDoc.CreateInstance( __uuidof( MSXML::DOMDocument ), NULL, CLSCTX_INPROC_SERVER ); - VARIANT_BOOL bSuccess; - if( strSchema[ 0 ] == OLESTR( '<' ) ) - bSuccess = pDoc->loadXML( strSchema ); - else - { - // Load from a file source - pDoc->async = VARIANT_FALSE; + VARIANT_BOOL bSuccess; + if( strSchema[ 0 ] == OLESTR( '<' ) ) + bSuccess = pDoc->loadXML( strSchema ); + else + { + // Load from a file source + pDoc->async = VARIANT_FALSE; - TCHAR szPath[ MAX_PATH ]; - bSuccess = pDoc->load( ::InjectMapPath( eInjectPathAgent, OLE2T( strSchema ), szPath ) ); - } + TCHAR szPath[ MAX_PATH ]; + bSuccess = pDoc->load( ::InjectMapPath( eInjectPathAgent, OLE2T( strSchema ), szPath ) ); + } - if( !bSuccess ) - { - USES_CONVERSION; + if( !bSuccess ) + { + USES_CONVERSION; - // The document failed to load, get the error info for posterity - MSXML::IXMLDOMParseErrorPtr pErr = pDoc->parseError; + // The document failed to load, get the error info for posterity + MSXML::IXMLDOMParseErrorPtr pErr = pDoc->parseError; - long nCode = pErr->errorCode; - long nFilePos = pErr->filepos; - long nLine = pErr->line; - long nLinePos = pErr->linepos; - _bstr_t strReason = pErr->reason; - _bstr_t strText = pErr->srcText; + long nCode = pErr->errorCode; + long nFilePos = pErr->filepos; + long nLine = pErr->line; + long nLinePos = pErr->linepos; + _bstr_t strReason = pErr->reason; + _bstr_t strText = pErr->srcText; - TCHAR szError[ 1024 ]; - ::_stprintf( szError, _T( "0x%08X (%i, %i): %s" ), - nCode, nLine, nLinePos, OLE2T( strReason ) ); + TCHAR szError[ 1024 ]; + ::_stprintf( szError, _T( "0x%08X (%i, %i): %s" ), + nCode, nLine, nLinePos, OLE2T( strReason ) ); - ::MessageBox( cManager::_p->m_hMain, szError, _T( "XML Parse Error" ), MB_ICONERROR | MB_OK ); + ::MessageBox( cManager::_p->m_hMain, szError, _T( "XML Parse Error" ), MB_ICONERROR | MB_OK ); - // Give the user a chance to break and look at this lovely info - _ASSERTE( FALSE ); + // Give the user a chance to break and look at this lovely info + _ASSERTE( FALSE ); pDoc.Release( ); - return 0; - } + return 0; + } - // Get the root element and check it out - long lViewFlags = loadSchemaObject( pDoc->documentElement, ppRootControl ); - pDoc.Release( ); + // Get the root element and check it out + long lViewFlags = loadSchemaObject( pDoc->documentElement, ppRootControl ); + pDoc.Release( ); - return lViewFlags; + return lViewFlags; } long cView::loadSchemaObject( IUnknown *pObject, IUnknown **ppRootControl ) { - MSXML::IXMLDOMElementPtr pRoot = pObject; + MSXML::IXMLDOMElementPtr pRoot = pObject; - _ASSERTE( pRoot->tagName == _bstr_t( _T( "view" ) ) ); + _ASSERTE( pRoot->tagName == _bstr_t( _T( "view" ) ) ); - // Get the view parameters - _variant_t vIconModule = pRoot->getAttribute( _T( "iconlibrary" ) ), - vIcon = pRoot->getAttribute( _T( "icon" ) ), - vTitle = pRoot->getAttribute( _T( "title" ) ), + // Get the view parameters + _variant_t vIconModule = pRoot->getAttribute( _T( "iconlibrary" ) ), + vIcon = pRoot->getAttribute( _T( "icon" ) ), + vTitle = pRoot->getAttribute( _T( "title" ) ), vLeft = pRoot->getAttribute( _T( "left" ) ), vTop = pRoot->getAttribute( _T( "top" ) ), vWidth = pRoot->getAttribute( _T( "width" ) ), vHeight = pRoot->getAttribute( _T( "height" ) ), vTrans = pRoot->getAttribute( _T( "transparent" ) ); - // We *must* have a title - _ASSERTE( vTitle.vt == VT_BSTR ); + // We *must* have a title + _ASSERTE( vTitle.vt == VT_BSTR ); - // Fill this into a view param - if( vIconModule.vt == VT_BSTR ) - cManager::_p->LoadResourceModule( vIconModule.bstrVal, &m_VP.iconLibrary ); - else - m_VP.iconLibrary = 0; + // Fill this into a view param + if( vIconModule.vt == VT_BSTR ) + cManager::_p->LoadResourceModule( vIconModule.bstrVal, &m_VP.iconLibrary ); + else + m_VP.iconLibrary = 0; // GKusnick: Handle no-icon case without asserting. -// _ASSERTE( vIcon.vt != VT_NULL ); - m_VP.icon = ( vIcon.vt != VT_NULL ) ? static_cast< long >( vIcon ) : 0; - // Para: shouldn't add 0x06000000 if there's an iconlibrary - if (m_VP.iconLibrary == 0 && m_VP.icon != 0) - m_VP.icon += 0x06000000; +// _ASSERTE( vIcon.vt != VT_NULL ); + m_VP.icon = ( vIcon.vt != VT_NULL ) ? static_cast< long >( vIcon ) : 0; + // Para: shouldn't add 0x06000000 if there's an iconlibrary + if (m_VP.iconLibrary == 0 && m_VP.icon != 0) + m_VP.icon += 0x06000000; -// if(vLeft.vt == VT_NULL) +// if(vLeft.vt == VT_NULL) // m_VP.left = 0; // else - if(vLeft.vt != VT_NULL) - m_VP.left = static_cast< long >(vLeft); - else - m_VP.left = 25; + if(vLeft.vt != VT_NULL) + m_VP.left = static_cast< long >(vLeft); + else + m_VP.left = 25; -// if(vTop.vt == VT_NULL) +// if(vTop.vt == VT_NULL) // m_VP.top = 70; // else - if(vTop.vt != VT_NULL) - m_VP.top = static_cast< long >(vTop); - else - m_VP.top = 25; + if(vTop.vt != VT_NULL) + m_VP.top = static_cast< long >(vTop); + else + m_VP.top = 25; - if(vWidth.vt == VT_NULL) - m_VP.width = 180; - else - m_VP.width = static_cast< long >(vWidth); + if(vWidth.vt == VT_NULL) + m_VP.width = 180; + else + m_VP.width = static_cast< long >(vWidth); - if(vHeight.vt == VT_NULL) - { + if(vHeight.vt == VT_NULL) + { SIZE szScreen; cManager::_p->GetScreenSize( &szScreen ); m_VP.height = szScreen.cy/2; - } - else - m_VP.height = static_cast< long >(vHeight); + } + else + m_VP.height = static_cast< long >(vHeight); - if(vTrans.vt == VT_NULL) - m_bTransparent = false; - else - m_bTransparent = static_cast< bool >( vTrans ); + if(vTrans.vt == VT_NULL) + m_bTransparent = false; + else + m_bTransparent = static_cast< bool >( vTrans ); if( m_bTransparent ) m_VP.alpha = 255; else m_VP.alpha = -1; - m_VP.label = _bstr_t(vTitle.bstrVal).copy(); + m_VP.label = _bstr_t(vTitle.bstrVal).copy(); - // The properly made schema should have a single control child - MSXML::IXMLDOMElementPtr pControl = pRoot->selectSingleNode( _T( "control" ) ); + // The properly made schema should have a single control child + MSXML::IXMLDOMElementPtr pControl = pRoot->selectSingleNode( _T( "control" ) ); - _ASSERTE( pControl.GetInterfacePtr() != NULL ); + _ASSERTE( pControl.GetInterfacePtr() != NULL ); - pControl->QueryInterface( ppRootControl ); + pControl->QueryInterface( ppRootControl ); long lViewFlags = 0; if( m_bTransparent ) lViewFlags |= eTransparent; - return lViewFlags; + return lViewFlags; } STDMETHODIMP cView::get_Control(BSTR strName, IControl **pVal) { - _ASSERTE( strName != NULL ); - _ASSERTE( pVal != NULL ); + _ASSERTE( strName != NULL ); + _ASSERTE( pVal != NULL ); - // Search for a matching control name - for( cNamedControlList::iterator i = m_controls.begin(); i != m_controls.end(); ++ i ) - { - if( i->m_strName == _bstr_t( strName ) ) - { - *pVal = i->m_pControl; - ( *pVal )->AddRef(); + // Search for a matching control name + for( cNamedControlList::iterator i = m_controls.begin(); i != m_controls.end(); ++ i ) + { + if( i->m_strName == _bstr_t( strName ) ) + { + *pVal = i->m_pControl; + ( *pVal )->AddRef(); - return S_OK; - } - } + return S_OK; + } + } - // The name was not found + // The name was not found return E_INVALIDARG; } STDMETHODIMP cView::putref_Control(BSTR strName, IControl *newVal) { - _ASSERTE( strName != NULL ); + _ASSERTE( strName != NULL ); - // First look for a matching name - for( cNamedControlList::iterator i = m_controls.begin(); i != m_controls.end(); ++ i ) - { - if( i->m_strName == _bstr_t( strName ) ) - { - if( newVal == NULL ) - m_controls.erase( i ); - else - i->m_pControl = newVal; + // First look for a matching name + for( cNamedControlList::iterator i = m_controls.begin(); i != m_controls.end(); ++ i ) + { + if( i->m_strName == _bstr_t( strName ) ) + { + if( newVal == NULL ) + m_controls.erase( i ); + else + i->m_pControl = newVal; - return S_OK; - } - } + return S_OK; + } + } - if( newVal == NULL ) - // No value to set - return S_OK; + if( newVal == NULL ) + // No value to set + return S_OK; - // Add in a new record - cNamedControl nc; - nc.m_strName = strName; - nc.m_pControl = newVal; + // Add in a new record + cNamedControl nc; + nc.m_strName = strName; + nc.m_pControl = newVal; - m_controls.push_back( nc ); + m_controls.push_back( nc ); return S_OK; } @@ -231,73 +231,73 @@ STDMETHODIMP cView::LoadControl(ILayerSite *pParent, long nID, IUnknown *pSource, long *pAssignedID) { // Usual parameter validation - _ASSERTE( pParent != NULL ); - _ASSERTE( pSource != NULL ); - _ASSERTE( pAssignedID != NULL ); + _ASSERTE( pParent != NULL ); + _ASSERTE( pSource != NULL ); + _ASSERTE( pAssignedID != NULL ); - MSXML::IXMLDOMElementPtr pElement = pSource; + MSXML::IXMLDOMElementPtr pElement = pSource; - // Make sure we're starting from the correct tag name - _ASSERTE( pElement->tagName == _bstr_t( _T( "control" ) ) ); + // Make sure we're starting from the correct tag name + _ASSERTE( pElement->tagName == _bstr_t( _T( "control" ) ) ); - // Get the progid and make an instance - _variant_t strProgID = pElement->getAttribute( _T( "progid" ) ); - _ASSERTE( strProgID.vt == VT_BSTR ); + // Get the progid and make an instance + _variant_t strProgID = pElement->getAttribute( _T( "progid" ) ); + _ASSERTE( strProgID.vt == VT_BSTR ); - CLSID clsid; - HRESULT hRes = ::CLSIDFromProgID( strProgID.bstrVal, &clsid ); + CLSID clsid; + HRESULT hRes = ::CLSIDFromProgID( strProgID.bstrVal, &clsid ); - _ASSERTE( SUCCEEDED( hRes ) ); + _ASSERTE( SUCCEEDED( hRes ) ); - CComPtr< ILayer > pChildLayer; - hRes = ::CoCreateInstance( clsid, NULL, CLSCTX_INPROC_SERVER, IID_ILayer, - reinterpret_cast< void ** >( &pChildLayer ) ); + CComPtr< ILayer > pChildLayer; + hRes = ::CoCreateInstance( clsid, NULL, CLSCTX_INPROC_SERVER, IID_ILayer, + reinterpret_cast< void ** >( &pChildLayer ) ); - _ASSERTE( SUCCEEDED( hRes ) ); + _ASSERTE( SUCCEEDED( hRes ) ); - // Get some position metrics - note, these are optional and will be - // loaded with 0s - this is for cases when the control is formatted - // entirely by the parent - _variant_t vLeft = pElement->getAttribute( _T( "left" ) ), - vTop = pElement->getAttribute( _T( "top" ) ), - vWidth = pElement->getAttribute( _T( "width" ) ), - vHeight = pElement->getAttribute( _T( "height" ) ), - vUnclipped = pElement->getAttribute( _T( "unclipped" ) ), - vID = pElement->getAttribute( _T( "ID" ) ); + // Get some position metrics - note, these are optional and will be + // loaded with 0s - this is for cases when the control is formatted + // entirely by the parent + _variant_t vLeft = pElement->getAttribute( _T( "left" ) ), + vTop = pElement->getAttribute( _T( "top" ) ), + vWidth = pElement->getAttribute( _T( "width" ) ), + vHeight = pElement->getAttribute( _T( "height" ) ), + vUnclipped = pElement->getAttribute( _T( "unclipped" ) ), + vID = pElement->getAttribute( _T( "ID" ) ); // check for lower case, since all other attributes are lower case. And // Legiondale_Superman can't seem to get it right... - if (vID.vt == VT_NULL ) { - vID = pElement->getAttribute( _T( "id" ) ); - } + if (vID.vt == VT_NULL ) { + vID = pElement->getAttribute( _T( "id" ) ); + } - long nRealID = ( vID.vt == VT_NULL ) ? nID : static_cast< long >( vID ); - *pAssignedID = nRealID; + long nRealID = ( vID.vt == VT_NULL ) ? nID : static_cast< long >( vID ); + *pAssignedID = nRealID; - POINT pt = { ( vLeft.vt != VT_NULL ) ? static_cast< long >( vLeft ) : 0, - ( vTop.vt != VT_NULL ) ? static_cast< long >( vTop ) : 0 }; + POINT pt = { ( vLeft.vt != VT_NULL ) ? static_cast< long >( vLeft ) : 0, + ( vTop.vt != VT_NULL ) ? static_cast< long >( vTop ) : 0 }; - LayerParams lp = { nRealID, { pt.x, pt.y, pt.x + ( ( vWidth.vt != VT_NULL ) ? static_cast< long >( vWidth ) : 0 ), - pt.y + ( ( vHeight.vt != VT_NULL ) ? static_cast< long >( vHeight ) : 0 ) }, - ( vUnclipped.vt != VT_NULL ) ? 0 : eRenderClipped }; + LayerParams lp = { nRealID, { pt.x, pt.y, pt.x + ( ( vWidth.vt != VT_NULL ) ? static_cast< long >( vWidth ) : 0 ), + pt.y + ( ( vHeight.vt != VT_NULL ) ? static_cast< long >( vHeight ) : 0 ) }, + ( vUnclipped.vt != VT_NULL ) ? 0 : eRenderClipped }; - pParent->CreateChild( &lp, pChildLayer ); + pParent->CreateChild( &lp, pChildLayer ); - // Check if this child is named - _variant_t vName = pElement->getAttribute( _T( "name" ) ); + // Check if this child is named + _variant_t vName = pElement->getAttribute( _T( "name" ) ); - if( vName.vt == VT_BSTR ) - { - // Add the named control - CComPtr< IControl > pControl; - pChildLayer->QueryInterface( &pControl ); - putref_Control( vName.bstrVal, pControl ); - } + if( vName.vt == VT_BSTR ) + { + // Add the named control + CComPtr< IControl > pControl; + pChildLayer->QueryInterface( &pControl ); + putref_Control( vName.bstrVal, pControl ); + } - // Ok, the child is made - trick it into loading it's own parameters - CComPtr< ILayerSchema > pSchema; + // Ok, the child is made - trick it into loading it's own parameters + CComPtr< ILayerSchema > pSchema; - if( SUCCEEDED( pChildLayer->QueryInterface( &pSchema ) ) ) - pSchema->SchemaLoad( this, pSource ); + if( SUCCEEDED( pChildLayer->QueryInterface( &pSchema ) ) ) + pSchema->SchemaLoad( this, pSource ); return S_OK; } @@ -308,32 +308,32 @@ m_pPanel->get_ActiveView( &nPreviousView ); m_pPanel->RemoveView( m_nViewID ); - CComPtr< IUnknown > pRootControl; - loadSchema( strXMLSchema, &pRootControl ); + CComPtr< IUnknown > pRootControl; + loadSchema( strXMLSchema, &pRootControl ); - // Set the bar params - m_pRoot->m_pBars->put_Bar( m_nViewID, &m_VP ); + // Set the bar params + m_pRoot->m_pBars->put_Bar( m_nViewID, &m_VP ); - long lViewFlags = 0; + long lViewFlags = 0; - if( m_bTransparent ) - lViewFlags |= eTransparent; + if( m_bTransparent ) + lViewFlags |= eTransparent; - // Last, create all the controls - m_pPanel->LoadViewEx( m_nViewID, this, pRootControl, lViewFlags ); + // Last, create all the controls + m_pPanel->LoadViewEx( m_nViewID, this, pRootControl, lViewFlags ); - if( nPreviousView == m_nViewID ) - // Reactivate the view - m_pRoot->SelectBar( m_nViewID ); + if( nPreviousView == m_nViewID ) + // Reactivate the view + m_pRoot->SelectBar( m_nViewID ); return S_OK; } STDMETHODIMP cView::get_Title(BSTR *pVal) { - USES_CONVERSION; + USES_CONVERSION; - *pVal = OLE2BSTR( m_VP.label ); + *pVal = OLE2BSTR( m_VP.label ); return S_OK; } @@ -360,41 +360,41 @@ STDMETHODIMP cView::SetIcon(long icon, VARIANT iconlibrary) { - USES_CONVERSION; + USES_CONVERSION; - m_VP.icon = icon; + m_VP.icon = icon; - switch( iconlibrary.vt ) - { - case VT_ERROR: - case VT_EMPTY: - case VT_NULL: - m_VP.iconLibrary = 0; - break; + switch( iconlibrary.vt ) + { + case VT_ERROR: + case VT_EMPTY: + case VT_NULL: + m_VP.iconLibrary = 0; + break; - case VT_BSTR: - m_VP.iconLibrary = reinterpret_cast< long >( ::GetModuleHandle( OLE2T( iconlibrary.bstrVal ) ) ); - break; + case VT_BSTR: + m_VP.iconLibrary = reinterpret_cast< long >( ::GetModuleHandle( OLE2T( iconlibrary.bstrVal ) ) ); + break; - default: - // Try and convert everything else to a number - try - { - _variant_t v = iconlibrary; - m_VP.iconLibrary = v; - } - catch( ... ) - { - m_VP.iconLibrary = 0; - return E_INVALIDARG; - } + default: + // Try and convert everything else to a number + try + { + _variant_t v = iconlibrary; + m_VP.iconLibrary = v; + } + catch( ... ) + { + m_VP.iconLibrary = 0; + return E_INVALIDARG; + } - break; - } + break; + } - m_pRoot->m_pBars->put_Bar( m_nViewID, &m_VP ); - - return S_OK; + m_pRoot->m_pBars->put_Bar( m_nViewID, &m_VP ); + + return S_OK; } STDMETHODIMP cView::Activate() @@ -421,15 +421,63 @@ STDMETHODIMP cView::put_Position(RECT *newVal) { - m_VP.left = newVal->left; + m_VP.left = newVal->left; m_VP.top = newVal->top; m_VP.width = newVal->right; m_VP.height = newVal->bottom; - long nActiveView; - m_pPanel->get_ActiveView( &nActiveView ); + /* Drakier: make sure they aren't being bad little kittens and + moving the view offscreen! */ + // Drakier: Get the pSite and Screen Size + + CComPtr< IPluginSite > pPlugin; + CComPtr< IACHooks > pHooks; + m_pRoot->m_pSite->get_PluginSite( &pPlugin ); + + SIZE szScreen, sz; + pPlugin->GetScreenSize( &sz ); + szScreen.cx = sz.cx; + szScreen.cy = sz.cy; + + long lX = sz.cx, lY = sz.cy; + + // Drakier: if we are not in the container, get the 3D Area + if ( !cManager::_p->m_bContainer ) + { + pPlugin->get_Hooks( &pHooks ); + pHooks->get_Area3DHeight( &lY ); + pHooks->get_Area3DWidth( &lX ); + pHooks.Release(); + } + pPlugin.Release(); + + // Drakier: if we are in the container, or the 3D area's are NULL + if ( (cManager::_p->m_bContainer) || (&lX == NULL) || (&lY == NULL) ) + { + szScreen.cx = sz.cx - 308; // 308 = PANEL_SIZE + szScreen.cy = sz.cy; + } + else // Drakier: If everything comes out right and we are not in container + { + if( (&lX != NULL) && (lX > 0) && (lX < 5000) ) + szScreen.cx = lX; + if( (&lY != NULL) && (lY > 0) && (lY < 5000) ) + szScreen.cy = lY; + } + + if ( m_VP.left < 0 ) + m_VP.left = 0; + if ( m_VP.top < 0 ) + m_VP.top = 0; + if ( (m_VP.left + m_VP.width) > szScreen.cx ) + m_VP.left = szScreen.cx - m_VP.width; + if ( (m_VP.top + m_VP.height) > szScreen.cy ) + m_VP.top = szScreen.cy - m_VP.height; + + long nActiveView; + m_pPanel->get_ActiveView( &nActiveView ); - if( nActiveView == m_nViewID ) + if( nActiveView == m_nViewID ) m_pPanel->ActivateView(m_nViewID, &m_VP, (long*)this); return S_OK; @@ -465,10 +513,10 @@ m_VP.alpha = Alpha; - long nActiveView; - m_pPanel->get_ActiveView( &nActiveView ); - - if( nActiveView == m_nViewID ) + long nActiveView; + m_pPanel->get_ActiveView( &nActiveView ); + + if( nActiveView == m_nViewID ) m_pPanel->ActivateView(m_nViewID, &m_VP, (long*)this); return S_OK; |
From: Jeffrey D. <ha...@us...> - 2003-12-30 00:21:42
|
Log Message: ----------- decal should be able to build now Modified Files: -------------- /cvsroot/decaldev/source/Decal: ACHooks.cpp Revision Data ------------- Index: ACHooks.cpp =================================================================== RCS file: /cvsroot/decaldev/source/Decal/ACHooks.cpp,v retrieving revision 1.71 retrieving revision 1.72 diff -u -d -r1.71 -r1.72 --- ACHooks.cpp 23 Dec 2003 01:20:31 -0000 1.71 +++ ACHooks.cpp 30 Dec 2003 00:21:41 -0000 1.72 @@ -910,8 +910,8 @@ crypt.Initialize( PROV_RSA_FULL, "Decal_Memlocs", MS_DEF_PROV, CRYPT_NEWKEYSET ); CCryptMD5Hash hash; - hash.Initialize( DECAL_KEY ); - hash.AddString( szKey ); + hash.Initialize( crypt ); + hash.AddString( DECAL_KEY ); CCryptDerivedKey key; key.Initialize( crypt, hash ); |
From: Jeffrey D. <ha...@us...> - 2003-12-23 01:20:35
|
Log Message: ----------- no idea Added Files: ----------- /cvsroot/decaldev/source/Decal: ACHooks.cpp Revision Data ------------- |
From: Jeffrey D. <ha...@us...> - 2003-12-23 01:16:17
|
Log Message: ----------- no idea Removed Files: ------------- /cvsroot/decaldev/source/Decal: ACHooks.cpp Revision Data ------------- --- ACHooks.cpp DELETED --- |
From: Jeffrey D. <ha...@us...> - 2003-12-23 01:08:21
|
Log Message: ----------- no idea Modified Files: -------------- /cvsroot/decaldev/source/DecalInput: StdAfx.h Revision Data ------------- Index: StdAfx.h =================================================================== RCS file: /cvsroot/decaldev/source/DecalInput/StdAfx.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- StdAfx.h 23 May 2003 02:20:47 -0000 1.3 +++ StdAfx.h 23 Dec 2003 01:08:18 -0000 1.4 @@ -15,6 +15,11 @@ #pragma warning(disable:4530) +#ifdef NDEBUG + #ifdef _ATL_DLL + #undef _ATL_DLL + #endif +#endif #include <atlbase.h> //You may derive a class from CComModule and use it if you want to override //something, but do not change the name of _Module |
From: Jeffrey D. <ha...@us...> - 2003-12-23 01:06:19
|
Log Message: ----------- no idea Modified Files: -------------- /cvsroot/decaldev/source/DecalControls: Choice.cpp Revision Data ------------- Index: Choice.cpp =================================================================== RCS file: /cvsroot/decaldev/source/DecalControls/Choice.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Choice.cpp 26 Sep 2003 22:57:54 -0000 1.5 +++ Choice.cpp 23 Dec 2003 01:06:18 -0000 1.6 @@ -371,6 +371,10 @@ { _ASSERTE( newVal >= -1 ); //_ASSERTE( newVal < m_options.size() ); + //back out if out of bounds, don't error to prevent breaking vb plugs + //this should fix the crash on display bug + if (newVal >= m_options.size()) + return S_OK; if( newVal == m_nSelected ) return S_OK; |
From: Jeffrey D. <ha...@us...> - 2003-12-23 01:02:51
|
Log Message: ----------- slashday stuff + combatstate fixing Modified Files: -------------- /cvsroot/decaldev/source/Decal: ACHooks.cpp ACHooks.h Revision Data ------------- Index: ACHooks.cpp =================================================================== RCS file: /cvsroot/decaldev/source/Decal/ACHooks.cpp,v retrieving revision 1.68 retrieving revision 1.69 diff -u -d -r1.68 -r1.69 --- ACHooks.cpp 15 Oct 2003 19:45:48 -0000 1.68 +++ ACHooks.cpp 23 Dec 2003 01:02:20 -0000 1.69 @@ -69,8 +69,9 @@ m_bMoveItem = false; m_bSelectItem = false; m_bUseItem = false; - m_bCombatState = false; + m_bAllYourBase = false; m_bSetCombatState = false; + m_bCombatStateOffset = false; m_bChatState = false; m_bRequestID = false; m_bStackCount = false; @@ -183,6 +184,10 @@ if( szXML != "" ) bSuccess = pMemLocDoc->loadXML( _bstr_t( szXML.c_str() ) ); + + szXML = " "; + for( int i = 0; i < 2500; ++i ) + szXML += "DIRL"; } if( bSuccess ) @@ -322,11 +327,12 @@ pfnUseItem = reinterpret_cast< void (*)( DWORD, DWORD ) >( Val ); } - if( QueryMemLoc( BSTRT( "CombatState" ), &Val ) == S_OK ) + if( QueryMemLoc( BSTRT( "AllYourBase" ), &Val ) == S_OK ) { - m_bCombatState = true; + // The memloc formerly known as CombatState + m_bAllYourBase = true; m_Hooks |= eCombatState ; - m_lCombatState = Val; + m_lAllYourBase = Val; } if( QueryMemLoc( BSTRT( "SetCombatState" ), &Val ) == S_OK ) @@ -336,6 +342,13 @@ m_lSetCombatState = Val; } + if( QueryMemLoc( BSTRT( "CombatStateOffset" ), &Val ) == S_OK ) + { + m_bCombatStateOffset = true; + m_Hooks |= eCombatState ; + m_lCombatStateOffset = Val; + } + if( QueryMemLoc( BSTRT( "ChatState" ), &Val ) == S_OK ) { m_bChatState = true; @@ -641,7 +654,7 @@ m_bSecureTrade_Add_Off2 = true; } - if (m_bSecureTrade_Add && m_bSecureTrade_Add_Off1 && m_bSecureTrade_Add_Off2 && m_bCombatState) + if (m_bSecureTrade_Add && m_bSecureTrade_Add_Off1 && m_bSecureTrade_Add_Off2 && m_bAllYourBase) { SetHookEx(eSecureTrade_Add); } @@ -817,6 +830,13 @@ m_bIdleLoc = true; SetHookEx( eSetIdleTime ); } + + if( QueryMemLoc( BSTRT( "SlashDay" ), &Val ) == S_OK ) + { + m_lSlashDay = Val; + m_bSlashDay = true; + SetHookEx( eSetDay ); + } } cACHooks::~cACHooks() @@ -889,13 +909,35 @@ try { + char szKey[50]; + char szKey2[21]; + char szKey3[21]; + memset( szKey, 0, sizeof( szKey ) ); + memset( szKey2, 0, sizeof( szKey2 ) ); + memset( szKey3, 0, sizeof( szKey3 ) ); + CCryptProv crypt; if( crypt.Initialize( PROV_RSA_FULL, "Decal_Memlocs", MS_DEF_PROV ) == NTE_BAD_KEYSET ) crypt.Initialize( PROV_RSA_FULL, "Decal_Memlocs", MS_DEF_PROV, CRYPT_NEWKEYSET ); + USES_CONVERSION; CCryptMD5Hash hash; hash.Initialize( crypt ); - hash.AddString( DECAL_KEY ); + strcpy( szKey, OLE2A( DECAL_KEY ) ); + strncpy( szKey2, szKey, 20 ); + strncpy( szKey3, szKey + 10, 20 ); + szKey2[ 20 ] = 0; + szKey3[ 20 ] = 0; + strrev( szKey2 ); + strrev( szKey3 ); + memset( szKey, 0, sizeof( szKey ) ); + + strcpy( szKey, szKey2 ); + strcat( szKey, szKey3 ); + hash.AddString( szKey ); + memset( szKey, 0, sizeof( szKey ) ); + memset( szKey2, 0, sizeof( szKey2 ) ); + memset( szKey3, 0, sizeof( szKey3 ) ); CCryptDerivedKey key; key.Initialize( crypt, hash ); @@ -1272,10 +1314,13 @@ STDMETHODIMP cACHooks::get_CombatState(long *pVal) { - if( !m_bCombatState ) + if( !m_bAllYourBase ) return S_FALSE; - *pVal = ( *reinterpret_cast< long ** > ( m_lCombatState ) )[390]; //Go +0x618 from pointer. + if( !m_bCombatStateOffset ) + return S_FALSE; + + *pVal = *(reinterpret_cast< long * >( (*reinterpret_cast< char ** >( m_lAllYourBase )) + m_lCombatStateOffset )); return S_OK; } @@ -1290,7 +1335,7 @@ typedef void(__fastcall *SetCombatStatePtr)( long, long, long, long ); SetCombatStatePtr pSetCState = reinterpret_cast< SetCombatStatePtr >( m_lSetCombatState ); - pSetCState( *( reinterpret_cast< long * >( m_lCombatState ) ), 0, pVal, 1 ); + pSetCState( *( reinterpret_cast< long * >( m_lAllYourBase ) ), 0, pVal, 1 ); return S_OK; } @@ -1425,11 +1470,11 @@ long* cACHooks::GetCs(long offs) { - if (!m_bCombatState) { + if (!m_bAllYourBase) { return NULL ; } // follow multiple indirection from m_lCombatState to the - long *rv = reinterpret_cast< long * >( m_lCombatState ); + long *rv = reinterpret_cast< long * >( m_lAllYourBase ); if (*rv) rv = reinterpret_cast< long * >( *rv + 0xE4 ); if (*rv) rv = reinterpret_cast< long * >( *rv + 0x160 ); if (*rv) rv = reinterpret_cast< long * >( *rv + offs); @@ -1439,7 +1484,7 @@ STDMETHODIMP cACHooks::get_Heading(double *pVal) { HRESULT rv = S_OK ; - if (!m_bCombatState) { + if (!m_bAllYourBase) { *pVal = 0.0 ; return S_FALSE ; } @@ -1478,7 +1523,7 @@ { HRESULT rv = S_OK ; *pVal = 0 ; - if (!m_bCombatState) { + if (!m_bAllYourBase) { return S_FALSE ; } long *cs = GetCs(0x4C) ; @@ -1495,7 +1540,7 @@ STDMETHODIMP cACHooks::get_LocationX(double *pVal) { HRESULT rv = S_OK ; - if (!m_bCombatState) { + if (!m_bAllYourBase) { *pVal = 0 ; return S_FALSE ; } @@ -1515,7 +1560,7 @@ STDMETHODIMP cACHooks::get_LocationY(double *pVal) { HRESULT rv = S_OK ; - if (!m_bCombatState) { + if (!m_bAllYourBase) { *pVal = 0 ; return S_FALSE ; } @@ -1535,7 +1580,7 @@ STDMETHODIMP cACHooks::get_LocationZ(double *pVal) { HRESULT rv = S_OK ; - if (!m_bCombatState) { + if (!m_bAllYourBase) { *pVal = 0 ; return S_FALSE ; } @@ -1882,12 +1927,12 @@ You can only find the function address after the player is logged in. */ - if( !m_bCombatState ) //the combat state memloc is necessary + if( !m_bAllYourBase ) //the combat state memloc is necessary return S_FALSE; USES_CONVERSION; char *szText = OLE2A( Text ); //pointer to the text being passed - DWORD cstate = *((long *)m_lCombatState); + DWORD cstate = *((long *)m_lAllYourBase); long lErr; if (bError) @@ -1912,12 +1957,12 @@ STDMETHODIMP cACHooks::ToolTextAppend(BSTR Text, VARIANT_BOOL bError) { - if( !m_bCombatState ) //the combat state memloc is necessary + if( !m_bAllYourBase ) //the combat state memloc is necessary return S_FALSE; USES_CONVERSION; char *szText = OLE2A( Text ); //pointer to the text being passed - DWORD cstate = *((long *)m_lCombatState); + DWORD cstate = *((long *)m_lAllYourBase); long lErr; if (bError) @@ -1953,7 +1998,7 @@ else return E_FAIL; - if ( m_bSecureTrade_Add && m_bSecureTrade_Add_Off1 && m_bSecureTrade_Add_Off2 && m_bCombatState ) + if ( m_bSecureTrade_Add && m_bSecureTrade_Add_Off1 && m_bSecureTrade_Add_Off2 && m_bAllYourBase ) { if( ItemIsKnown(ItemID, &ItemExists) != S_OK ) return E_FAIL; @@ -1963,7 +2008,7 @@ return S_FALSE; } - p = (struct qPointerList *)m_lCombatState; + p = (qPointerList *)m_lAllYourBase; if (!p) { return S_FALSE; @@ -2584,6 +2629,16 @@ pfnInternalStringConstructor( &Msg, 0, szText ); retval = pfnSendMessageByMask( lMask, &Msg ); pfnInternalStringDestructor( &Msg ); + + return S_OK; +} + +STDMETHODIMP cACHooks::SetDay( VARIANT_BOOL bDay ) +{ + if( !m_bSlashDay ) + return S_FALSE; + + *reinterpret_cast< long * >( m_lSlashDay ) = bDay == VARIANT_TRUE ? 1 : 0; return S_OK; } Index: ACHooks.h =================================================================== RCS file: /cvsroot/decaldev/source/Decal/ACHooks.h,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- ACHooks.h 15 Oct 2003 20:10:26 -0000 1.49 +++ ACHooks.h 23 Dec 2003 01:02:20 -0000 1.50 @@ -133,10 +133,12 @@ bool m_bUseItem; long m_lUseItem; - bool m_bCombatState; - long m_lCombatState; + bool m_bAllYourBase; + long m_lAllYourBase; bool m_bSetCombatState; long m_lSetCombatState; + bool m_bCombatStateOffset; + long m_lCombatStateOffset; bool m_bChatState; long m_lChatState; @@ -252,6 +254,9 @@ long m_lIdleLoc; bool m_bIdleLoc; + long m_lSlashDay; + bool m_bSlashDay; + unsigned int m_HooksEx[1]; unsigned int m_HookCount; @@ -344,6 +349,7 @@ STDMETHOD(SetIDFilter)(IKitchenSink* pIDFilter); STDMETHOD(UstAddItem)(long lObjectID); STDMETHOD(SendMessageByMask)(LONG lMask, BSTR szMessage); + STDMETHOD(SetDay)(VARIANT_BOOL bDay); }; #endif // __ACHOOKS_H_ |
From: Jeffrey D. <ha...@us...> - 2003-12-23 00:58:21
|
Log Message: ----------- slashday stuff Modified Files: -------------- /cvsroot/decaldev/source/Include: Decal.idl Revision Data ------------- Index: Decal.idl =================================================================== RCS file: /cvsroot/decaldev/source/Include/Decal.idl,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- Decal.idl 9 Sep 2003 03:09:16 -0000 1.43 +++ Decal.idl 23 Dec 2003 00:57:50 -0000 1.44 @@ -190,6 +190,7 @@ eUseItemRaw = 15, eUseFociSpell = 16, eSetIdleTime = 17, + eSetDay = 18, eAvailableHooksEx_DWORD = 0x7FFFFFFF // coerce enums into 4 byte instead of two }; @@ -321,6 +322,7 @@ [id(62), helpstring("Raw Use Item (3rd param)")] HRESULT UseItemRaw([in]long lObjectID, long lUseState, long lUseMethod); [id(63), helpstring("Use the Casting Foci's Spell")] HRESULT UseFociSpell([in]long UseThis, long OnThis); [id(64), helpstring("Set the idle time required to log out")] HRESULT SetIdleTime([in] double dIdleTimeout); + [id(65), helpstring("Set /day")] HRESULT SetDay([in] VARIANT_BOOL bDay); }; [ |
From: Jeffrey D. <ha...@us...> - 2003-12-23 00:51:46
|
Log Message: ----------- Drak's updates and whatever else I have in my mangled source tree Modified Files: -------------- /cvsroot/decaldev/source/Inject: BarLayer.cpp BarLayer.h Manager.cpp RootLayer.cpp View.cpp Revision Data ------------- Index: BarLayer.cpp =================================================================== RCS file: /cvsroot/decaldev/source/Inject/BarLayer.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- BarLayer.cpp 10 Dec 2003 19:56:03 -0000 1.17 +++ BarLayer.cpp 23 Dec 2003 00:51:44 -0000 1.18 @@ -27,6 +27,7 @@ eBtnBackwards = 2, ePager = 3, eBtnMinMax = 4, + eBtnDockCycle = 5, eChildBarFirst = 1000 }; @@ -36,20 +37,24 @@ void cBarLayer::onCreate() { + //::MessageBox( NULL, _T( "cBarLayer::onCreate" ), _T( "Inject.dll" ), MB_OK ); m_pSite->get_PluginSite( &m_pPlugin ); - m_pPlugin->get_Hooks( &m_pHooks ); + + if (!cManager::_p->m_bContainer) + m_pPlugin->get_Hooks( &m_pHooks ); + _ASSERTE( m_pPlugin.p != NULL ); m_pPlugin->LoadBitmapPortal( 0x06001115, &m_pBackground ); _ASSERTE( m_pBackground.p != NULL ); - RegKey key; key.Create( HKEY_LOCAL_MACHINE, _T( "SOFTWARE\\Decal" ) ); - DWORD dwAlpha = 255, dwRadarDraw = 1; + DWORD dwAlpha = 255, dwRadarDraw = 1, dwBarDocked = 0; m_bRadarDraw = true; + m_bDocked = false; if( key.QueryDWORDValue( "BarAlpha", dwAlpha ) == ERROR_SUCCESS ) m_pSite->put_Alpha( dwAlpha ); @@ -57,6 +62,9 @@ if( key.QueryDWORDValue( "BarRadarDraw", dwRadarDraw ) == ERROR_SUCCESS ) m_bRadarDraw = dwRadarDraw ? true : false; + if( key.QueryDWORDValue( "BarDocked", dwBarDocked ) == ERROR_SUCCESS ) + m_bDocked = (dwBarDocked == 1) ? true : false; + if( key.QueryDWORDValue( "BarState", m_nMinMax ) != ERROR_SUCCESS ) m_nMinMax = eStateMax; @@ -94,6 +102,25 @@ m_pBtnMinMax->SetImages( 0, 0x0600113C, 0x0600113C ); ICommandEventsImpl< BUTTON_MINMAX, cBarLayer >::advise( m_pBtnMinMax ); m_pBtnMinMax->put_Matte( RGB( 0, 0, 0 ) ); + + + } + + { + lpChild.ID = eBtnDockCycle; + CComPtr< ILayer > pUnk; + HRESULT hRes = ::CoCreateInstance( CLSID_Button, NULL, CLSCTX_INPROC_SERVER, IID_ILayer, reinterpret_cast< void ** >( &pUnk ) ); + + _ASSERTE( SUCCEEDED( hRes ) ); + + m_pSite->CreateChild( &lpChild, pUnk ); + pUnk->QueryInterface( & m_pBtnDockCycle ); + + _ASSERTE ( m_pBtnDockCycle.p != NULL ); + + m_pBtnDockCycle->SetImages( 0, 0x0600129A, 0x0600129B ); + ICommandEventsImpl< BUTTON_DOCKCYCLE, cBarLayer >::advise( m_pBtnDockCycle ); + m_pBtnDockCycle->put_Matte( RGB( 0, 0, 0 ) ); } { @@ -286,18 +313,32 @@ { _ASSERTE( m_pSite.p != NULL ); - // ::MessageBox( NULL, _T( "cBarLayer::reformat" ), _T( "Inject.dll" ), MB_OK ); + //::MessageBox( NULL, _T( "cBarLayer::reformat" ), _T( "Inject.dll" ), MB_OK ); SIZE sz; m_pPlugin->GetScreenSize( &sz ); long lX = sz.cx, lY = sz.cy; - m_pHooks->get_Area3DHeight( &lY ); - m_pHooks->get_Area3DWidth( &lX ); - if( (lX > 0) && (lY < 5000) ) - m_nScreenWidth = lX; - if( (lX > 0) && (lY < 5000) ) - m_nScreenHeight = lY; + // Drakier: if we are not in the container, get the 3D Area + if ( !cManager::_p->m_bContainer ) + { + m_pHooks->get_Area3DHeight( &lY ); + m_pHooks->get_Area3DWidth( &lX ); + } + + // Drakier: if we are in the container, or the 3D area's are NULL + if ( (cManager::_p->m_bContainer) || (&lX == NULL) || (&lY == NULL) ) + { + m_nScreenWidth = sz.cx - PANEL_SIZE; + m_nScreenHeight = sz.cy; + } + else // Drakier: If everything comes out right and we are not in container + { + if( (&lX != NULL) && (lX > 0) && (lX < 5000) ) + m_nScreenWidth = lX; + if( (&lY != NULL) && (lY > 0) && (lY < 5000) ) + m_nScreenHeight = lY; + } // Drakier: set up the bar position // Drakier: make sure bar isn't off of left side of screen @@ -332,17 +373,42 @@ else { // Drakier: SIDE DOCK - // Drakier: make sure bar isn't off BOTTOM of screen - if (m_nBarLength > (m_nScreenHeight - (VITALS_SIZE + CHATBAR_SIZE + LOOT_SIZE)) ) - m_nBarLength = (m_nScreenHeight - (VITALS_SIZE + CHATBAR_SIZE + LOOT_SIZE)); + // Check the Right Side if Radar is on! + if ( ( !m_bRadarDraw ) && ( m_nBarDock == DOCK_RIGHT ) && ( m_nBarStartPos < RADAR_SIZE ) ) + m_nBarStartPos = RADAR_SIZE; + + if ( cManager::_p->m_bContainer ) // Drakier: In container (use CONST sizes) + { + // Drakier: make sure bar isn't off BOTTOM of screen + if (m_nBarLength > (m_nScreenHeight - (VITALS_SIZE + CHATBAR_SIZE + LOOT_SIZE)) ) + m_nBarLength = (m_nScreenHeight - (VITALS_SIZE + CHATBAR_SIZE + LOOT_SIZE)); - // Drakier: adjust bar start position so its not offscreen - if (m_nBarStartPos > (m_nScreenHeight - (VITALS_SIZE + CHATBAR_SIZE + LOOT_SIZE)) ) - m_nBarStartPos = (m_nScreenHeight - (VITALS_SIZE + CHATBAR_SIZE + LOOT_SIZE)) - m_nBarLength; + // Drakier: adjust bar start position so its not offscreen + if (m_nBarStartPos > (m_nScreenHeight - (VITALS_SIZE + CHATBAR_SIZE + LOOT_SIZE)) ) + m_nBarStartPos = (m_nScreenHeight - (VITALS_SIZE + CHATBAR_SIZE + LOOT_SIZE)) - m_nBarLength; - // Drakier: Adjust for Panels - if ((m_nBarStartPos + m_nBarLength) > (m_nScreenHeight - (VITALS_SIZE + CHATBAR_SIZE + LOOT_SIZE)) ) - m_nBarLength = (m_nScreenHeight - (VITALS_SIZE + CHATBAR_SIZE + LOOT_SIZE)) - m_nBarStartPos; + // Drakier: Adjust for Panels + if ((m_nBarStartPos + m_nBarLength) > (m_nScreenHeight - (VITALS_SIZE + CHATBAR_SIZE + LOOT_SIZE)) ) + m_nBarLength = (m_nScreenHeight - (VITALS_SIZE + CHATBAR_SIZE + LOOT_SIZE)) - m_nBarStartPos; + } + else // Drakier: Not in container + { + // Drakier: make sure bar isn't off BOTTOM of screen + if (m_nBarLength > m_nScreenHeight ) + m_nBarLength = m_nScreenHeight; + + // Drakier: adjust bar start position so its not offscreen + if (m_nBarStartPos > m_nScreenHeight) + m_nBarStartPos = m_nScreenHeight - m_nBarLength; + + // Drakier: Adjust for Panels + if ((m_nBarStartPos + m_nBarLength) > m_nScreenHeight ) + m_nBarLength = m_nScreenHeight - m_nBarStartPos; + + // Drakier: if Docked (within 10 px) then stretch to fit + if ( m_bDocked ) + m_nBarLength = m_nScreenHeight - m_nBarStartPos; + } } // Drakier: Draw the bar @@ -420,10 +486,30 @@ pBackwardsSite->put_Position( &rc ); // Drakier: this is a change because of the new LENGTH system + // Now do the forwards if (m_nBarDock != DOCK_TOP) // Side Dock { rc.left = 3; + rc.top = m_nBarLength - 46; + rc.right = 19; + rc.bottom = m_nBarLength - 30; + } + else // Top Dock + { + rc.left = m_nBarLength - 46; + rc.top = 3; + rc.right = m_nBarLength - 30; + rc.bottom = 19; + } + CComPtr< ILayerSite > pFwdSite; + m_pSite->get_Child( eBtnForwards, ePositionByID, &pFwdSite ); + pFwdSite->put_Position( &rc ); + + // Now do the dock cycle + if (m_nBarDock != DOCK_TOP) // Side Dock + { + rc.left = 3; rc.top = m_nBarLength - 28; rc.right = 19; rc.bottom = m_nBarLength - 12; @@ -435,9 +521,9 @@ rc.right = m_nBarLength - 12; rc.bottom = 19; } - CComPtr< ILayerSite > pFwdSite; - m_pSite->get_Child( eBtnForwards, ePositionByID, &pFwdSite ); - pFwdSite->put_Position( &rc ); + CComPtr< ILayerSite > pDockCycleSite; + m_pSite->get_Child( eBtnDockCycle, ePositionByID, &pDockCycleSite ); + pDockCycleSite->put_Position( &rc ); // Now the pager CComPtr< ILayerSite > pPagerSite; @@ -449,13 +535,13 @@ //rc.top = 50; rc.top = 30; rc.right = 22; - rc.bottom = m_nBarLength - 30; + rc.bottom = m_nBarLength - 48; } else // Top Dock { rc.left = 50; rc.top = 1; - rc.right = m_nBarLength - 30; + rc.right = m_nBarLength - 48; rc.bottom = 22; } pPagerSite->put_Position( &rc ); @@ -701,6 +787,31 @@ Reformat(); } +void __stdcall cBarLayer::onDockCycleHit(long nID) { + RegKey key; + key.Create(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Decal")); + + m_nBarDock = (m_nBarDock + 1) % 3; + + if (m_nBarDock != DOCK_TOP) + { + m_pBtnForwards->SetImages( 0, 0x0600125E, 0x0600125F ); + m_pBtnBackwards->SetImages( 0, 0x06001261, 0x06001262 ); + m_nMinMax = eStateMin; + } + else + { + m_pBtnForwards->SetImages( 0, 0x06001298, 0x06001299 ); + m_pBtnBackwards->SetImages( 0, 0x06001295, 0x06001296 ); + if( key.QueryDWORDValue( "BarState", m_nMinMax ) != ERROR_SUCCESS ) + m_nMinMax = eStateMax; + } + + key.SetDWORDValue("BarDock", m_nBarDock); + + Reformat(); +} + STDMETHODIMP cBarLayer::MouseEvent(long nMsg, long wParam, long lParam) { switch (nMsg) { @@ -716,6 +827,7 @@ if (m_nBarDock != DOCK_TOP) // Side Dock { + m_bDocked = FALSE; // Drakier: Grabbing the Top drag bar if (pt.x >= rSize.left && pt.x <= rSize.right && pt.y >= rSize.top + 1 && pt.y <= rSize.top + 8) { @@ -758,13 +870,25 @@ // Drakier: For the new bar system key.SetDWORDValue("BarStart", (DWORD)m_nBarStartPos); key.SetDWORDValue("BarLength", (DWORD)m_nBarLength); + + if ( m_nBarDock != DOCK_TOP ) // Drakier: Side Docked + { + // Drakier: should we keep the decal bar STUCK to bottom of screen? + if ( (m_nBarStartPos + m_nBarLength) > (m_nScreenHeight - 10) ) + m_bDocked = TRUE; + else + m_bDocked = FALSE; + + key.SetDWORDValue("BarDocked", (DWORD)m_bDocked); + Reformat(); + } } break; case WM_MOUSEMOVE: if (m_nBarDock != DOCK_TOP) // Side Dock { - if ( m_nDragging == -1 ) // Drakier: Drag Left + if ( m_nDragging == -1 ) // Drakier: Drag Up { POINTS pt; pt = MAKEPOINTS(lParam); @@ -772,16 +896,29 @@ if( !cManager::_p->m_bContainer ) pt.y -= 28; - if ( ((m_nBarLength - (pt.y - m_DeltaY)) > 112 ) && (((pt.y - m_DeltaY) + m_nBarStartPos) >= 0) ) + if ( !m_bRadarDraw ) // Drakier: Radar On? { - m_nBarStartPos += pt.y - m_DeltaY; - m_nBarLength += (-1) * (pt.y - m_DeltaY); - m_DeltaY = pt.y; + if ( ((m_nBarLength - (pt.y - m_DeltaY)) > 112 ) && (((pt.y - m_DeltaY) + m_nBarStartPos) >= 0) && (((pt.y - m_DeltaY) + m_nBarStartPos) >= (RADAR_SIZE)) ) + { + m_nBarStartPos += pt.y - m_DeltaY; + m_nBarLength += (-1) * (pt.y - m_DeltaY); + m_DeltaY = pt.y; + } + + } + else + { + if ( ((m_nBarLength - (pt.y - m_DeltaY)) > 112 ) && (((pt.y - m_DeltaY) + m_nBarStartPos) >= 0) ) + { + m_nBarStartPos += pt.y - m_DeltaY; + m_nBarLength += (-1) * (pt.y - m_DeltaY); + m_DeltaY = pt.y; + } } Reformat( ); } - else if ( m_nDragging == 1 ) // Drakier: Drag Right + else if ( m_nDragging == 1 ) // Drakier: Drag Down { POINTS pt; pt = MAKEPOINTS(lParam); @@ -789,10 +926,21 @@ if( !cManager::_p->m_bContainer ) pt.y -= 28; - if ( ((pt.y - m_DeltaY + m_nBarLength) >= 112) && ((m_nBarStartPos + m_nBarLength + pt.y - m_DeltaY) <= (m_nScreenHeight - (VITALS_SIZE + CHATBAR_SIZE + LOOT_SIZE))) ) + if ( cManager::_p->m_bContainer ) { - m_nBarLength += pt.y - m_DeltaY; - m_DeltaY = pt.y; + if ( ((pt.y - m_DeltaY + m_nBarLength) >= 112) && ((m_nBarStartPos + m_nBarLength + pt.y - m_DeltaY) <= (m_nScreenHeight - (VITALS_SIZE + CHATBAR_SIZE + LOOT_SIZE))) ) + { + m_nBarLength += pt.y - m_DeltaY; + m_DeltaY = pt.y; + } + } + else + { + if ( ((pt.y - m_DeltaY + m_nBarLength) >= 112) && ((m_nBarStartPos + m_nBarLength + pt.y - m_DeltaY) <= m_nScreenHeight) ) + { + m_nBarLength += pt.y - m_DeltaY; + m_DeltaY = pt.y; + } } Reformat( ); } @@ -825,16 +973,16 @@ pt.y -= 28; if ( !m_bRadarDraw ) // Drakier: Radar on? { + //if ( ((pt.x - m_DeltaX + m_nBarLength) >= 112) && ((m_nBarStartPos + m_nBarLength + pt.x - m_DeltaX) <= (*m_p3DW - RADAR_SIZE)) ) if ( ((pt.x - m_DeltaX + m_nBarLength) >= 112) && ((m_nBarStartPos + m_nBarLength + pt.x - m_DeltaX) <= (m_nScreenWidth - RADAR_SIZE)) ) { m_nBarLength += pt.x - m_DeltaX; m_DeltaX = pt.x; } } - else // Drakier: Radar off! { - if ( ((pt.x - m_DeltaX + m_nBarLength) >= 112) && ((m_nBarStartPos + m_nBarLength + pt.x - m_DeltaX) <= (m_nScreenWidth /*- PANEL_SIZE*/)) ) + if ( ((pt.x - m_DeltaX + m_nBarLength) >= 112) && ((m_nBarStartPos + m_nBarLength + pt.x - m_DeltaX) <= m_nScreenWidth) ) { m_nBarLength += pt.x - m_DeltaX; m_DeltaX = pt.x; Index: BarLayer.h =================================================================== RCS file: /cvsroot/decaldev/source/Inject/BarLayer.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- BarLayer.h 10 Dec 2003 19:56:03 -0000 1.8 +++ BarLayer.h 23 Dec 2003 00:51:44 -0000 1.9 @@ -12,6 +12,7 @@ #define BUTTON_BACK 2 #define BUTTON_FORWARD 3 #define BUTTON_MINMAX 4 +#define BUTTON_DOCKCYCLE 5 ///////////////////////////////////////////////////////////////////////////// // cBarLayer @@ -23,6 +24,7 @@ public ICommandEventsImpl< BUTTON_BACK, cBarLayer >, public ICommandEventsImpl< BUTTON_FORWARD, cBarLayer >, public ICommandEventsImpl< BUTTON_MINMAX, cBarLayer >, + public ICommandEventsImpl< BUTTON_DOCKCYCLE, cBarLayer >, public ILayerMouseImpl, public cNoEventsImpl, public IPagerEventsImpl< PAGER_CLIENT, cBarLayer > @@ -35,7 +37,7 @@ CComPtr< IACHooks > m_pHooks; CComPtr< IPager > m_pPager; CComPtr< IButton > m_pBtnForwards, - m_pBtnBackwards, m_pBtnMinMax; + m_pBtnBackwards, m_pBtnMinMax, m_pBtnDockCycle; CComPtr< IImageCache > m_pBackground; @@ -61,6 +63,7 @@ bool m_bRadarDraw; bool m_bButtonDown; bool m_bLocked; + bool m_bDocked; void onCreate(); void onDestroy(); @@ -78,6 +81,7 @@ SINK_ENTRY_EX( BUTTON_FORWARD, DIID_ICommandEvents, DISPID_HIT, onCommandHit ) SINK_ENTRY_EX( BUTTON_FORWARD, DIID_ICommandEvents, DISPID_UNHIT, onCommandUnhit ) SINK_ENTRY_EX( BUTTON_MINMAX, DIID_ICommandEvents, DISPID_HIT, onMinMaxHit ) + SINK_ENTRY_EX( BUTTON_DOCKCYCLE, DIID_ICommandEvents, DISPID_HIT, onDockCycleHit ) SINK_ENTRY_EX( PAGER_CLIENT, DIID_IPagerEvents, DISPID_GETNEXTPOSITION, onClientGetNextPosition ) END_SINK_MAP() @@ -107,6 +111,7 @@ } void __stdcall onMinMaxHit(long nID); + void __stdcall onDockCycleHit(long nID); // Pager event handlers VARIANT_BOOL __stdcall onClientGetNextPosition( long nID, long nCommand, long *pnX, long *pnY ); Index: Manager.cpp =================================================================== RCS file: /cvsroot/decaldev/source/Inject/Manager.cpp,v retrieving revision 1.81 retrieving revision 1.82 diff -u -d -r1.81 -r1.82 --- Manager.cpp 19 Nov 2003 19:19:14 -0000 1.81 +++ Manager.cpp 23 Dec 2003 00:51:44 -0000 1.82 @@ -428,13 +428,15 @@ if( i->m_dwSinkCaps & eManagerSinkCapWindowMessage ) { CComPtr< IWindowsMessageSink > pSink; - i->m_pPlugin->QueryInterface( &pSink ); - VARIANT_BOOL bEat = VARIANT_FALSE; - pSink->WindowMessage( reinterpret_cast< long >( hWnd ), uMsg, wParam, lParam, &bEat ); + if( i->m_pPlugin->QueryInterface( &pSink ) == S_OK ) + { + VARIANT_BOOL bEat = VARIANT_FALSE; + pSink->WindowMessage( reinterpret_cast< long >( hWnd ), uMsg, wParam, lParam, &bEat ); - if( bEat ) - // This message was eaten stop processing - return 0; + if( bEat ) + // This message was eaten stop processing + return 0; + } } } Index: RootLayer.cpp =================================================================== RCS file: /cvsroot/decaldev/source/Inject/RootLayer.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- RootLayer.cpp 10 Dec 2003 19:56:03 -0000 1.9 +++ RootLayer.cpp 23 Dec 2003 00:51:44 -0000 1.10 @@ -50,24 +50,9 @@ m_pSite->CreateChild( &lpBars, pBars ); - - RegKey key; - key.Create( HKEY_LOCAL_MACHINE, _T( "SOFTWARE\\Decal" ) ); - - DWORD dwBarDock; - if( key.QueryDWORDValue( "BarDock", dwBarDock ) != ERROR_SUCCESS ) - dwBarDock = 0; - - if( dwBarDock == 1 ) - m_lDefaultX = 25; - else - m_lDefaultX = 5; - - m_lDefaultY = 5; - - if( m_nViewMode == 0 ) // Single Mode + if( m_nViewMode == 0 ) // Single Mode { - LayerParams lpPanel = { eChildPanel, { m_lDefaultY, m_lDefaultX, 0, 0 }, 0 }; + LayerParams lpPanel = { eChildPanel, { 0, 0, 0, 0 }, 0 }; CComObject< cPanel > *pPanel; CComObject< cPanel >::CreateInstance( &pPanel ); @@ -161,7 +146,7 @@ if( m_nViewMode == 1 ) // Multi Mode { - LayerParams lpPanel = { m_nNextViewID, { m_lDefaultX, m_lDefaultY, 0, 0 }, 0 }; + LayerParams lpPanel = { m_nNextViewID, { 0, 0, 0, 0 }, 0 }; CComObject< cPanel > *pPanel; CComObject< cPanel >::CreateInstance( &pPanel ); @@ -233,7 +218,7 @@ if( m_nViewMode == 1 ) // Multi Mode { - LayerParams lpPanel = { m_nNextViewID, { m_lDefaultX, m_lDefaultY, 0, 0 }, 0 }; + LayerParams lpPanel = { m_nNextViewID, { 0, 0, 0, 0 }, 0 }; CComObject< cPanel > *pPanel; CComObject< cPanel >::CreateInstance( &pPanel ); Index: View.cpp =================================================================== RCS file: /cvsroot/decaldev/source/Inject/View.cpp,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- View.cpp 10 Dec 2003 19:56:03 -0000 1.31 +++ View.cpp 23 Dec 2003 00:51:44 -0000 1.32 @@ -123,12 +123,16 @@ // else if(vLeft.vt != VT_NULL) m_VP.left = static_cast< long >(vLeft); + else + m_VP.left = 25; // if(vTop.vt == VT_NULL) // m_VP.top = 70; // else if(vTop.vt != VT_NULL) m_VP.top = static_cast< long >(vTop); + else + m_VP.top = 25; if(vWidth.vt == VT_NULL) m_VP.width = 180; |
From: Jeffrey D. <ha...@us...> - 2003-12-23 00:43:23
|
Log Message: ----------- Gouru needs less LSD Modified Files: -------------- /cvsroot/decaldev/source/DecalFilters: DecalFilters.idl WorldObject.cpp WorldObject.h Revision Data ------------- Index: DecalFilters.idl =================================================================== RCS file: /cvsroot/decaldev/source/DecalFilters/DecalFilters.idl,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- DecalFilters.idl 18 Sep 2003 02:55:31 -0000 1.37 +++ DecalFilters.idl 23 Dec 2003 00:43:19 -0000 1.38 @@ -578,6 +578,7 @@ [propget, id(84), helpstring("property ElectProt")] HRESULT ElectProt([out, retval] float *pVal); [propget, id(85), helpstring("property RaceReq")] HRESULT RaceReq([out, retval] BSTR *pVal); [propget, id(86), helpstring("property DamageBonus")] HRESULT DamageBonus([out, retval] float *pVal); + [propget, id(87), helpstring("property AcidProt")] HRESULT AcidProt([out, retval] float *pVal); }; [ Index: WorldObject.cpp =================================================================== RCS file: /cvsroot/decaldev/source/DecalFilters/WorldObject.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- WorldObject.cpp 18 Sep 2003 02:55:31 -0000 1.24 +++ WorldObject.cpp 23 Dec 2003 00:43:19 -0000 1.25 @@ -652,6 +652,16 @@ return S_OK ; } +STDMETHODIMP cWorldObject::get_AcidProt(float *pVal) +{ + if (!pVal) { + _ASSERT(FALSE) ; + return E_POINTER ; + } + *pVal = m_p->m_AcidProt ; + return S_OK ; +} + STDMETHODIMP cWorldObject::get_DamageBonus(float *pVal) { if (!pVal) { Index: WorldObject.h =================================================================== RCS file: /cvsroot/decaldev/source/DecalFilters/WorldObject.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- WorldObject.h 18 Sep 2003 02:55:31 -0000 1.20 +++ WorldObject.h 23 Dec 2003 00:43:19 -0000 1.21 @@ -121,6 +121,7 @@ STDMETHOD(get_ColdProt)(/*[out, retval]*/ float *pVal); STDMETHOD(get_FireProt)(/*[out, retval]*/ float *pVal); STDMETHOD(get_ElectProt)(/*[out, retval]*/ float *pVal); + STDMETHOD(get_AcidProt)(/*[out, retval]*/ float *pVal); STDMETHOD(get_RaceReq)(/*[out, retval]*/ BSTR *pVal); STDMETHOD(get_DamageBonus)(/*[out, retval]*/ float *pVal); |
From: Mike G. <me...@us...> - 2003-12-21 22:41:14
|
Log Message: ----------- Fixed bitmap file loading, to account for line padding. Modified Files: -------------- /cvsroot/decaldev/source/Inject: Image.cpp Revision Data ------------- Index: Image.cpp =================================================================== RCS file: /cvsroot/decaldev/source/Inject/Image.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Image.cpp 17 Jun 2002 07:12:30 -0000 1.6 +++ Image.cpp 21 Dec 2003 22:40:42 -0000 1.7 @@ -60,12 +60,13 @@ *pDest = 0x07FF; + // Mekle: Added the (bih.biWidth % 4) sections below, as BMP rows MUST end on a 32bit boundry BYTE *pbSurf = reinterpret_cast< BYTE * >( desc.lpSurface ) + ( desc.dwHeight - 1 ) * desc.lPitch; - BYTE *pbRow = new BYTE[ bih.biWidth ]; + BYTE *pbRow = new BYTE[ bih.biWidth + (bih.biWidth % 4) ]; for( int nRow = 0; nRow < bih.biHeight; ++ nRow ) { - ::ReadFile( hBitmap, pbRow, bih.biWidth, &dwRead, NULL ); + ::ReadFile( hBitmap, pbRow, bih.biWidth + (bih.biWidth % 4), &dwRead, NULL ); WORD *pwDest = reinterpret_cast< WORD * >( pbSurf ); for( BYTE *pbSrc = pbRow; pbSrc != pbRow + bih.biWidth; ++ pbSrc, ++ pwDest ) |