DumontEXE 0.0.1
cmcExe.cpp
00001 /* ***************************************************************************
00002 **
00003 ** Copyright (C) 2007 Lorimark Solutions, LLC. All rights reserved.
00004 **
00005 ** This file is part of the DumontEXE Scripting Extension Kit
00006 **
00007 ** This file may be used under the terms of the GNU General Public
00008 ** License version 2.0 as published by the Free Software Foundation
00009 ** and appearing in the file LICENSE.GPL included in the packaging of
00010 ** this file.  Please review the following information to ensure GNU
00011 ** General Public Licensing requirements will be met:
00012 ** http://dumont.showoff-db.org/opensource.html
00013 **
00014 ** If you are unsure which license is appropriate for your use, please
00015 ** review the following information:
00016 ** http://dumont.showoff-db.org/licensing.html 
00017 ** or contact the sales department at sales@lorimarksolutions.com.
00018 **
00019 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00020 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00021 **
00022 ** author: Mark Petryk ~ Lorimark Solutions, LLC
00023 ** **************************************************************************/
00024 
00025 #include <QTextEdit>
00026 
00027 #include <ModuleInstance.h>
00028 
00029 #include "cmcExe.h"
00030 
00031 //namespace cmcDatabaseApi {
00032 
00033 cmcExe::cmcExe( QObject * parent )
00034 :QObject(parent)
00035 {
00036   textEdit = new QTextEdit();
00037   textEdit-> setFont( QFont("Courier New",8) );
00038   textEdit-> resize( 600, 600 );
00039   textEdit-> move( 1, 1 );
00040 
00041   taskManager = new CTaskManager(this);
00042 
00043   taskManager-> Populate();
00044 
00045   qDebug( " taskManager %ld", taskManager-> GetProcessCount() );
00046 
00047 
00048   // Enumerates all processes
00049   for( unsigned i=0; i<taskManager-> GetProcessCount(); i++ )
00050   {
00051     CExeModuleInstance * pProcess = taskManager-> GetProcessByIndex(i);
00052     qDebug( " " );
00053     qDebug
00054     (
00055       "i=%d mod_count=%ld pid=%ld Process %s", 
00056       i, 
00057       pProcess->GetModuleCount(),
00058       pProcess->Get_ProcessId(),
00059       qPrintable(pProcess->Get_Name())
00060     );
00061 
00062     #ifndef NEVER
00063     // Enumerates all modules loaded by (pProcess) process
00064     for( unsigned j=0; j<pProcess->GetModuleCount(); j++ )
00065     {
00066       CModuleInstance * pModule = pProcess->GetModuleByIndex(j);
00067       qDebug("j=%d %s Handle=%.8lx",j , qPrintable(pModule->GetBaseName()), (long) pModule->Get_Module() );
00068     } // for
00069     #endif
00070 
00071   } // for
00072 
00073 
00074 #ifdef NEVER
00075   HWND m_cmcHwnd = ::FindWindow(L"Commence", NULL);
00076 
00077   if( m_cmcHwnd ) 
00078   {
00079     WCHAR szWindowName[80];
00080     GetWindowText( m_cmcHwnd, szWindowName, 80 );
00081 
00082     QString windowName = QString::fromWCharArray(szWindowName);
00083 
00084     qDebug( "commence window found %s", qPrintable(windowName) );
00085 
00086   }
00087   else
00088   {
00089     qDebug( "no commence window found" );
00090   }
00091 #endif
00092 
00093 }
00094 
00095 cmcExe::~cmcExe()
00096 {
00097   if( taskManager ) delete taskManager;
00098 }
00099 
00100 
00101 void cmcExe::show()
00102 {
00103   textEdit-> show();
00104 }
00105 
00106 
00107 // } // endnamespace cmcDatabaseApi
00108 
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties




~ ~ ~ ~ ~ ~
Source Code without Comments is like a Cranberry Garland
without the berries. Comment your Code!
 
Commence Database User Support Group Forum
http://newsgroup.showoff-db.org/
~ ~ ~ ~ ~ ~
Author: Mark Petryk
Lorimark Solutions, LLC
mark@lorimarksolutions.com