Jump to content

Help How to get process list for windows 98?

- - - - -

  • Please log in to reply
20 replies to this topic

#1
Vita

Vita

    Newbie

  • Members
  • PipPip
  • 12 posts
Hi,
I've been trying to get process list and came up with this piece of code:

#include <iostream>

#include <string>

#include <windows.h>

#include <tlhelp32.h>


using namespace std;


int main()

{

	

	HANDLE hndl = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);

	if( hndl )

	{

		bool ff;

		LPPROCESSENTRY32 proces;

		proces->dwSize = sizeof( LPPROCESSENTRY32 );

		ff = Process32First(hndl,proces);

		

		if(ff)

		{

			cout << proces->szExeFile << endl;

			while(ff = Process32Next(hndl,proces))

			{

				ff = Process32Next(hndl,proces);

				cout << proces->szExeFile << endl;

			}

		}

		else

		{

			cout << "Error :(" << endl;

		}

	}

	CloseHandle(hndl);

	system("pause");

	return 0;

}


It compiles good but when I run it it shows and Error and app just breaks.

So if anyone knows a better way to display a list of processes with their handle-s and ids please give me an example that will work on Windows 98.


#2
Ancient Dragon

Ancient Dragon

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 400 posts
That function is not available for Win98. See Requirements here. I know of now alternative, but that doesn't mean there isn't one.
Visit Grandpa's Forums, a social networking forum, with family-oriented arcade games, blogs, discussion forums, and photo albums.

#3
Vita

Vita

    Newbie

  • Members
  • PipPip
  • 12 posts
Is there somehow some other way, or how to get window list?

#4
Ancient Dragon

Ancient Dragon

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 400 posts

Vita said:

Is there somehow some other way, or how to get window list?

Yes -- stop supporting Win98.
Visit Grandpa's Forums, a social networking forum, with family-oriented arcade games, blogs, discussion forums, and photo albums.

#5
RhetoricalRuvim

RhetoricalRuvim

    JavaScript Programmer

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,254 posts
  • Location:C:\Countries\US

AncientDragon said:

Yes -- stop supporting Win98.

What's wrong with Windows 98?

#6
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
Microsoft doesn't support Win98. It's 13 years old, not overly secure, and tends to have lots of issues.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#7
RhetoricalRuvim

RhetoricalRuvim

    JavaScript Programmer

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,254 posts
  • Location:C:\Countries\US

WingedPanther said:

Microsoft doesn't support Win98. It's 13 years old, not overly secure, and tends to have lots of issues.

Hmmm... I'm almost 17 years old; I wonder if that makes Microsoft not support me. :)

#8
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
I use Linux. Try getting support for MoonLight encryption from them.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#9
RhetoricalRuvim

RhetoricalRuvim

    JavaScript Programmer

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,254 posts
  • Location:C:\Countries\US

WingedPanther said:

I use Linux. Try getting support for MoonLight encryption from them.

What? What's MoonLight?

Oh, and also, I was just kidding about the "... Microsoft not support me" ; it's software, not necessarily people, that looses support with gaining age.

#10
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
Moonlight = Silverlight for Linux. Microsoft has contributed code to it, but NOT the encryption module that would let Netflix work on LInux.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#11
RhetoricalRuvim

RhetoricalRuvim

    JavaScript Programmer

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,254 posts
  • Location:C:\Countries\US
Oh, that makes so much more sense now.

* * *

But what if all someone has is Windows 98? What if the machine is so old that it doesn't support newer Windows versions?

#12
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others

RhetoricalRuvim said:

Oh, that makes so much more sense now.

* * *

But what if all someone has is Windows 98? What if the machine is so old that it doesn't support newer Windows versions?
That's what Linux is for :)
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users