|
The EnumProcesses function in the PSAPI library enumerates processes. Unfortunately, it does not include in that enumeration processes run by other users. Does anyone know of a way to enumerate all the processes in the system?
Software Zen: delete this;
|
|
|
|
|
probably you can do it only if you have admin rights.
-prakash
|
|
|
|
|
Thanks for your response.
In this case, administrator rights doesn't appear to help (the logged-in user is an administrator).
I've found an alternate method of resolving my issue (it involves an installer for a service that runs under a separate account) using the service control manager directly.
Software Zen: delete this;
|
|
|
|
|
Gary Wheeler wrote:
Does anyone know of a way to enumerate all the processes in the system?
Hi Mr. Gary,
you can try CreateToolhelp32Snapshot(..),Process32First and Process32Next api
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Thanks for your response. I'll keep it in mind.
I've found an alternate method of resolving my issue (it involves an installer for a service that runs under a separate account) using the service control manager directly.
Software Zen: delete this;
|
|
|
|
|
Hi,
I am a bigner in VC++ programming (started lerning only in March 2005 with visual stdio 6).
I request some help.
I have created a small database related application for a friend using CDAORecordSet. I made the data connection to Access (ie data is stored, added to and retrived from an access file and displaed on to a listView). I build the application seting the build configuration as 'release'. Then I copied the exe file and the access file on to my friend's computer and tried to run it.
I get the message "Unable to initialise DAO/jet engine".
Please tell me what to do now? Do I have to incorporate the jet engine in the program. If so, how do I do it? Or is there something else that must be done, like create a setup file.
Please, someone, tell me what to do? I really need some help.
Thank you,
Tara
|
|
|
|
|
You have to check register "HKEY_LOCAL_MACHINE\Software\Microsoft\Jet\3.5\Engines exists"
If you don't have this fold you have to install Jet Engine. It's depend on OS you can get download in this site http://www.microsoft.com/downloads/results.aspx?productID=&freetext=Jet%204.0%20Service%20Pack&displaylang=en[^]
One more thing is before check DAO/Jet infromation
bool DAOInstallCheck()
{
HKEY hRet;
bool bBool=false;
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
"Software\\Microsoft\\Jet\\3.5\\Engines",
0,KEY_QUERY_VALUE, &hRet) == ERROR_SUCCESS)
{
bBool = true;
RegCloseKey(hRet);
}
return bBool;
}
if DAOInstallCheck())
// Message Return Install require
else
// DAO already Install
Have a nice day
-- modified at 17:22 Wednesday 12th October, 2005
|
|
|
|
|
Hi,
I'm trying to show a bitmap image (blended) over a background video using VMR9, this works fine...
Except,
The bitmap is only visable in the areas of the client window which the video is covering. (as the video is letterboxed).
Is it possible to allow the overlay bitmap to fill the entire window...
And if not, what over approach should I be looking for to acheive this?
Thanks...
Simon.
|
|
|
|
|
ooook... figured it out
I've turned off letterbox mode, and manually resized the video itself into the client area, this allows the VMR to render the bitmap to the entire client area....
Thanks for listening
|
|
|
|
|
Thanks for letting us know the solution - I sometimes look here to see common problems (and solutions) that people come across.
Elaine
The tigress is here
|
|
|
|
|
Hi,
My clients like to see the texts instead of the dimmed texts on disabled controls such as check box, radio button, combo box, and edit box in a C++/MFC dialog box. The texts on enabled controls are black.
In order to differentiate disabled controls from enabled controls (black texts), I would like to add some color (blue) on the disabled control texts.
Can you tell me the existing or potential solutions?
Thank you very much!
Shelley
-- modified at 16:20 Wednesday 12th October, 2005
|
|
|
|
|
y22zhou wrote:
My clients like to see the texts instead of the dimmed texts on disabled controls such as check box, radio button, combo box, and edit box in a C++/MFC dialog box.
This would seem to be counterintuitive. For example, say you set the text of these disabled controls to red, and the user went in and changed their theme to display red text for controls. How would they differentiate between a disabled control and an enabled control?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Hi,
I have a jpeg file. I would like to embed some text to it.
The text messages will be right above the jpeg image.
For example:
Smiley face
Can someone g:|ive me some ideas about how to do it?
Thanks,
Kevin
|
|
|
|
|
read the jpeg.
allocate a temp image large enough to hold the jpeg, with extra space at the top for the text.
overlay/merge the jpeg onto the temp image.
draw the text at the top of the temp image.
save the temp image.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
Hello,
I need to set a button as a default button (get's pressed when ENTER is pressed). I'm not using CDialog, so SetDefID is out.
I can subclass the controls in the view and have them post a message to the parent when ENTER is pressed, but there must be a better (more simple) solution.
Any ideas?
Thanks!
-Ian
|
|
|
|
|
Ian Bowler wrote:
I'm not using CDialog, so SetDefID is out.
What's wrong with sending the control a DM_SETDEFID message?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Isn't that messaged handled by CDialog? If so, I don't think that will work because I'm not using CDialog.
|
|
|
|
|
Ian Bowler wrote: If so, I don't think that will work because I'm not using CDialog.
MFC is not an issue here. It is a standard Windows message that you can send to a control.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
u can set up a default button
right click the button in
the resource editor , click on property,
go to the style tab , check mark the
Set default check box,
I think that willl solve ur problem
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
Ian Bowler wrote:
I need to set a button as a default button (get's pressed when ENTER is pressed). I'm not using CDialog, so SetDefID is out.
are you dynamically creating the Button then use BS_DEFPUSHBUTTON while creating the button otherwise use technique mention by Vikas
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Yes, I am dynamically creating the button. I tried using the BS_DEFPUSHBUTTON style but that did not work. The button that I'm wanting to set as the default is in a hosted ActiveX control. Could that be part of the problem? The hosted ActiveX control's UI is built on CView-derived class. This class owns a CWnd-derived class, which owns the CButton that I want to make default. When the CWnd-derived object or one of its child objects has the focus, I want the ENTER key to activate the CButton.
Here is a diagram that I hope will help:
--------------------------------------------------------------------------------------
Application
------------------------------------------------------
| ActiveX control
| ------------------------------------------
| | CView
| | ---------------------------------
| | | CWnd
| | | ---------- When this CWnd-derive class or any of its child MFC
| | | |CButton | controls have focus, I want the CButton to get
| | | ---------- pushed when the ENTER key is pressed.
| | ---------------------------------
| |
| ------------------------------------------
|
------------------------------------------------------
--------------------------------------------------------------------------------------
Thanks again for taking the time to help!
-- modified at 11:27 Thursday 13th October, 2005
|
|
|
|
|
Hello,
I have the following problem. I want to create a temporary object that is transparent to the caller of the function which creates the temporary. We all know that values returned by value from a function, the temporary is created on the stack until it is no longer needed.
I wan't to use this property of the temporary to create a locking / unlocking mechanism for an object. See the following code for details
class CArbitraryClass
{
public:
void DoFoo() {}
};
class CWrapperClass
{
public:
CInvisibleTemporary operator->()
{
return CInvisibleTemporary::CInvisibleTemporary();
}
};
class CInvisibleTemporary
{
public:
CArbitraryClass& operator->() { return m_ArbitraryObject; }
private:
CArbitraryClass m_ArbitraryObject;
};
So the code should look like the following statements:
CWrapperClass Wrapper;<br />
Wrapper->DoFoo();
But it looks like:
CWrapperClass Wrapper;<br />
Wrapper.operator ->().operator ->().DoFoo();
Am I trying to do something impossible?
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
I can't figure this out, Please Help!!!! I would appreciate any remarks
or opinions or help about the code below.
A you can see I am writing and reading from the serial port, that is
going OK MOST of the time. My big problem is when I want to break the
while loop. I am expecting a message in HEX to come in from the serial
port. for instance "0004 600A", which I get most of the time, sometimes
I just get random ASCII chars, anyway to the point
Question #1 is the way I am storing the read return(it seems to work
alright) the best way to do it, char in[13] ?
Question #2 I need to test the response in terms of binary?
0000 0000 0000 0100 0110 0000 0000 1010
I can manage to test the bit that I am interested in but how to get to
this point I am not to sure about.
Lastly, any remarks or bug fixes on the general structure of the my
code would be great
//************************************************************************************************************//
int _tmain(int argc, _TCHAR* argv[])
{
CSerial serial;
//CSyncSerialComm serial2("COM1");
char in[13];
char command[20];
DWORD bytesRead;
int value=1000;
int end;
int test;
serial.Open(1, 9600);
//serial.HomePosition(4);
while(1)
{
printf("\nEnter Command >>");
scanf("%d", &value);
sprintf(command, "4 lr %d\r4 m\r4 st\r", value);
serial.SendData(command, sizeof(command));
end = serial.ReadData(&in,20);
in[end] = '\0';
printf("value = %s",in);
if((int)in[7] > 4)
break;
}
serial.Close();
getchar();
return(0);
}
//***************************************Writing
Data**************************************//
bool CSerial::WriteCommByte( unsigned char ucByte )
{
bool bWriteStat;
DWORD dwBytesWritten;
bWriteStat = WriteFile( m_hIDComDev, (LPSTR) &ucByte, 1,
&dwBytesWritten, &m_OverlappedWrite );
if( !bWriteStat && ( GetLastError() == ERROR_IO_PENDING ) ){
if( WaitForSingleObject( m_OverlappedWrite.hEvent, 1000 ) )
dwBytesWritten = 0;
else{
GetOverlappedResult( m_hIDComDev, &m_OverlappedWrite,
&dwBytesWritten, FALSE );
m_OverlappedWrite.Offset += dwBytesWritten;
}
}
return( TRUE );
}
int CSerial::SendData( const char *buffer, int size )
{
if( !m_bOpened || m_hIDComDev == NULL ) return( 0 );
DWORD dwBytesWritten = 0;
int i;
for( i=0; i
|
|
|
|
|
bigjrags wrote:
Question #1 is the way I am storing the read return(it seems to work
alright) the best way to do it, char in[13] ?
This code snippet makes me doubt:
end = serial.ReadData(&in,20);
I do not know about the CSerial class, and therefore do not know what ReadData needs as parameters, but something tells me that the fact that 20 is greater than 13 is no good
This
while(1)
{
..
if((int)in[7] > 4)
break;
}
is a good way to get your application hang in case the expected break value never gets sent, or wrongly received. A condition where the user could interrupt the reading is much better than (1) .
bigjrags wrote:
I need to test the response in terms of binary?
What do you mean: Are you asking how to do it, or if you have to do it ?
~RaGE();
|
|
|
|
|
WebConn error LNK2019: unresolved external symbol __imp__InternetOpenA@20 referenced in function _main
My program "WebConn" keeps getting this error when ever I use items in the wininet.h class.
I'm using Visual Studio .Net 2003, C++.
Any help would be great!
Brad
#define WINVER 0x0400
#include "stdafx.h"
#include
#include
int main()
{
HINTERNET hInternetRoot;
hInternetRoot = InternetOpen("My Agent", INTERNET_OPEN_TYPE_PROXY, "127.0.0.1", "",0);
return 0;
}
|
|
|
|