Click here to Skip to main content
15,887,746 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to build a ProgressBar that depend on other process (retrieving data from DB) ? Pin
Pete O'Hanlon30-Oct-06 1:46
mvePete O'Hanlon30-Oct-06 1:46 
GeneralRe: How to build a ProgressBar that depend on other process (retrieving data from DB) ? Pin
digitalhand2-Nov-06 4:31
digitalhand2-Nov-06 4:31 
GeneralRe: How to build a ProgressBar that depend on other process (retrieving data from DB) ? Pin
Pete O'Hanlon2-Nov-06 9:55
mvePete O'Hanlon2-Nov-06 9:55 
AnswerRe: How to build a ProgressBar that depend on other process (retrieving data from DB) ? Pin
jahirhstu10-Jul-09 22:19
jahirhstu10-Jul-09 22:19 
QuestionHidden process Pin
chowj28-Oct-06 17:53
chowj28-Oct-06 17:53 
AnswerRe: Hidden process Pin
Jun Du29-Oct-06 5:09
Jun Du29-Oct-06 5:09 
GeneralRe: Hidden process Pin
chowj29-Oct-06 12:43
chowj29-Oct-06 12:43 
GeneralRe: Hidden process Pin
Jun Du30-Oct-06 2:24
Jun Du30-Oct-06 2:24 
The following code snippet is from my article[^], which demonstrates how to
1) enumerate the object list and get the object you want (one object for each class) and
2) invoke GetOwner() method of the object under discussion.

When you have got your object, you may invoke its SendMessage() method with an appropriate argument list.

private: static void OnTimedEvent(System::Object* source, System::Timers::ElapsedEventArgs* e)
         {
             XLogoffThread::mut->WaitOne();

            // Use WMI to check if it's been logged out.
            // If it is logged out, the explorer's owner should be System.

            ConnectionOptions *co = new ConnectionOptions();
            ManagementScope *ms = new ManagementScope("\\\\localhost", co);

            // Query all Win32_process type management objects
            ObjectQuery *oq = new ObjectQuery("select * from Win32_Process");
            ManagementObjectSearcher *mos = new ManagementObjectSearcher(ms,oq);
            ManagementObjectCollection *moc = mos->Get();
            ManagementObjectCollection::ManagementObjectEnumerator* moe = moc->GetEnumerator();

            moe->Reset();

            while(moe->MoveNext())
            {
                ManagementObject *mo = dynamic_cast<ManagementObject*>(moe->get_Current());

                String *str[] = {"", ""};
                str[0] = dynamic_cast<String*>(mo->get_Item("Name"));

                // Determine if System is the owner of explorer
                if(str[0]->Equals("explorer.exe"))
                {
                    mo->InvokeMethod("GetOwner",(Object*[])str);

                    // If it is logged in and GUI isn't alive, start GUI.
                    if(!str[0]->Equals("SYSTEM") && !str[0]->Equals("System"))
                    {
                        CheckGUI(true);
                    }

                    break;
                }
            }

            XLogoffThread::mut->ReleaseMutex();
         }



Best,
Jun

QuestionImplementing a COM defined interface in C# Pin
malayalite28-Oct-06 17:46
malayalite28-Oct-06 17:46 
AnswerRe: Implementing a COM defined interface in C# Pin
Pete O'Hanlon30-Oct-06 4:06
mvePete O'Hanlon30-Oct-06 4:06 
GeneralRe: Implementing a COM defined interface in C# Pin
malayalite7-Nov-06 9:02
malayalite7-Nov-06 9:02 
GeneralRe: Implementing a COM defined interface in C# Pin
Pete O'Hanlon7-Nov-06 9:27
mvePete O'Hanlon7-Nov-06 9:27 
GeneralRe: Implementing a COM defined interface in C# Pin
malayalite7-Nov-06 9:56
malayalite7-Nov-06 9:56 
GeneralRe: Implementing a COM defined interface in C# Pin
malayalite7-Nov-06 9:59
malayalite7-Nov-06 9:59 
QuestionGetCaretPos help needed (get keyboard possition) Pin
ranzask28-Oct-06 14:30
ranzask28-Oct-06 14:30 
AnswerRe: GetCaretPos help needed (get keyboard possition) Pin
lainoo28-Oct-06 17:49
lainoo28-Oct-06 17:49 
GeneralRe: GetCaretPos help needed (get keyboard possition) Pin
ranzask29-Oct-06 10:40
ranzask29-Oct-06 10:40 
QuestionGetting the last record autonumber value Pin
TheCardinal28-Oct-06 13:22
TheCardinal28-Oct-06 13:22 
AnswerRe: Getting the last record autonumber value Pin
Guffa28-Oct-06 16:18
Guffa28-Oct-06 16:18 
GeneralRe: Getting the last record autonumber value Pin
TheCardinal28-Oct-06 18:15
TheCardinal28-Oct-06 18:15 
GeneralRe: Getting the last record autonumber value Pin
lainoo28-Oct-06 18:19
lainoo28-Oct-06 18:19 
QuestionMSBuild Pin
AJ12328-Oct-06 8:04
AJ12328-Oct-06 8:04 
QuestionStealing the Mouse Pin
IceWater4228-Oct-06 6:57
IceWater4228-Oct-06 6:57 
AnswerRe: Stealing the Mouse Pin
Luc Pattyn28-Oct-06 7:06
sitebuilderLuc Pattyn28-Oct-06 7:06 
GeneralRe: Stealing the Mouse Pin
IceWater4229-Oct-06 17:55
IceWater4229-Oct-06 17:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.