|
well.....(just a suggestion;))afterall it workz!!!!!.....thanx for correcting me.....
Happy programmin bro.....
cheerz.....
|
|
|
|
|
In some instances, working is merely a symptom of the output. Many things might appear to produce a correct result but that does not mean they are correct.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi,
Look the MSDN documentation for following API's and structs
PROCESSENTRY32 struct and api's like CreateToolhelp32Snapshot,
Process32First,Process32Next etc.
you can use these set of api's to check the exe is running or not !
If you have patients wait for some days, i m putting the artical on this
issue !
Regards,
Vishal
|
|
|
|
|
I should create the dialog window (mfc) when hot key is pressed. All works fine, but at first time the dialog creates with a small delay and instantly later. How to speed up it first creation?
Thanks.
|
|
|
|
|
You could create this window when your app is idle and set it to be hidden first. Then you just make it visible when the user presses the hotkey.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi All,
Could anyone tell me with an example how to use the CRgn::GetRegionData()..?
TIA
regards,
Rajesh
|
|
|
|
|
Could someone tell me how to write a .ini file of an application to store some states of all controls in an application? Simply using CFile to write or there are some special classes to handle this? Thanks!
|
|
|
|
|
The
GetPrivateProfileXXX and
WritePrivateProfileXXX
functions do the job for you
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi, everyone:
Can someone provide a EZ way to change an individual text in a dialog? I knew that I can use CDC functions to realize that, but can I do this on a Static Control? To talk in detail, I wanna use SetWindowText() or SetDlgItemText( ) to change the text of a control containing some text string. And what should I do to change the reulting text? Or don't think about that, simply use CDC functions? Thanks!
|
|
|
|
|
Handle the WM_CTLCOLOR message.
In VS call the properties for the dialog, there you can set handlers for messages, in that list is a WM_CTLCOLOR message. Choose a function to handle this.
Write something like this in it:
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);<br />
CBrush *brush;<br />
brush = NULL;<br />
CWnd* pStaticWnd = (CWnd*)GetDlgItem(IDC_STATIC_STATUS);<br />
if(pWnd == pStaticWnd){<br />
pDC->SetTextColor(RGB(0, 0, 255));<br />
}
pStaticWnd = (CWnd*)GetDlgItem(IDC_STATIC_INFO_DOC);<br />
if(pWnd == pStaticWnd){<br />
if(lock_docstatus_text){<br />
pDC->SetTextColor(RGB(0, 100, 200));<br />
}
else{<br />
pDC->SetTextColor(RGB(0, 0, 255));<br />
}
}
pStaticWnd = (CWnd*)GetDlgItem(IDC_STATIC_INFO_SEND);<br />
if(pWnd == pStaticWnd){<br />
if(lock_sendstatus_text){<br />
pDC->SetTextColor(RGB(0, 100, 200));<br />
}
else{<br />
pDC->SetTextColor(RGB(0, 0, 255));<br />
}
}
return hbr;<br />
for more info check out msdn.
Hope this helps, good luck.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
It didn't work....
But if the condition in if() changed to this form could work:
if( pWnd->GetDlgCtrlID() == IDC_STATIC_MY_STATIC )<br />
{<br />
pDC->SetTextColor(RGB(255, 0, 0));<br />
}
Anyway, thnks for your help.
|
|
|
|
|
ytod wrote:
To talk in detail, I wanna use SetWindowText() or SetDlgItemText( ) to change the text of a control containing some text string. And what should I do to change the reulting text?
You just answered your own question. Use SetWindowText() .
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
DavidCrow wrote:
ytod wrote:
To talk in detail, I wanna use SetWindowText() or SetDlgItemText( ) to change the text of a control containing some text string. And what should I do to change the reulting text?
Miss one word "color":
And what should I do to change the reulting text "color"?
But I need to try what the previous post described first, thanks!
|
|
|
|
|
Using OnCtlColor() , or handling the WM_CTLCOLOR message, is the preferred method.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I need to insert a new line at the beginning of a text file but i don´t know how to do this without overwriting the first line. This is my code:
...
file.SeekToBegin();
file.WriteString(text);
...
I've also tried this:
...
file.SeekToBegin();
file.WriteString("\r\n");
file.WriteString(text);
...
but it doesn´t work. Could anyone help me? Thanks
Lucia
|
|
|
|
|
Do you have a valid file handle, do you have write-access to this file?
Check the return codes.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
It is not possible to 'insert' new data at the begining of the file. A solution for doing that is using a temporary file. In this file, you first copy the first line you need to insert, then copy all the data from the original file. When this is done, you take this data and copy it into the original file (erasing all it's previous contents).
|
|
|
|
|
I think allocating a buffer that's long enough to store previous data could also work.
|
|
|
|
|
Thanks for the reply. I have already thought of this solution but i searched the simplest one. Ok, i'll try using a temporary file
|
|
|
|
|
Be sure you have write access to the folder in which the temporary file will be created. If the file is not gigantic (e.g., 100MB or more), you could just read it into a heap-based buffer, write the new text to the file and then append the contents of the buffer. That's about as simple as it gets.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
is it possible to read icon (resource) info from an exe file directly without using resource functions such as ::FindResource()?
thx
includeh10
|
|
|
|
|
Sure, but it would require intimate knowledge of the PE file format.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I have made a DSP program that reduces a wave file size.
Now i want to be able to play it on the fly as a unpack it the new soundformat.
Been trying to figure out how to play it with directsound, but havent had much luck, and resources for setting this up is sparse.
Does anyone have a working example/link/tutorial, that does the following or explains how to make it.
Takes a block of PCM data, for instance 256 bytes.
Puts it in a buffer
The audio device plays the data in the buffer without gaps.
Have some trouble getting the larger picture, of how it should be set up, from reading MSDN explanation. Im all new to directx.
Thx in advance
|
|
|
|
|
I have developed an applications (MFC Dialog based) - uses buttons, picture box, edit box and radio button (some of the buttons use a BitmapButton class).
Now I would like to turn this program into a class as I need multiple instances of it and that would be ideal just to instantiate this class as many times as needed.
How do you go about converting a program to a class where they are many files used to build the original program?
Regards,
|
|
|
|
|
make your dialog ( and all its dependencies ) a DLL.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|