|
if the button has an unique ID, i think you can add it as code auto generated by MFC.
includeh10
|
|
|
|
|
Why not just call the handler function directly?
BEGIN_MESSAGE_MAP(COptionsGeneralPage, CPropertyPage)
ON_BN_CLICKED(IDC_XB_ODBC_ENABLED, OnXbOdbcEnabled)
END_MESSAGE_MAP()
...
OnXbOdbcEnabled();
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
just post the wm_command event to the window with the id of the button
-prakash
|
|
|
|
|
|
I am creating a project which needs to skin a slidder control.This skin should be of .PNG file.How can i load image using the path of image file insted of Resource ID or name. I have seen article by JON "Skin based slider control Mark 2" but this is to load bmp file and by resource ID.
Pls help me
Learner always
|
|
|
|
|
Resizing the static control at runtime depending on the dynamic text.This shud increase or decrease the height to accomodate the text.And text shud wrap up.
Can anybody help plz.
|
|
|
|
|
use CDC to get size of your text then determine width and height of static control, i think there is no simple (or auto) way to do that.
includeh10
|
|
|
|
|
Hi I have two seperate exe files (both console applications) and I am looking for some ideas as to how I can deterimine if the other one is running so I can set the other one to sleep. Any help would be most appreciated
|
|
|
|
|
there is one C++ sample in article section of the forum, it is very good about running single copy program - exe file can not multiplely run - the sample detects if the exe (itself in the sample) is running.
you can modify the sample for detecting if another exe is running.
try to search it, the sample uses Mapping file.
includeh10
|
|
|
|
|
you can do it in many different ways.
one would be mutex objects which can be most efficient.
in one of the prg which will run first the fiorst line should be;
CreateMutex(NULL,TRUE,"Runnig");
now the second prg;
should enter in a cycle
while(CreateMutex(NULL,TRUE,"Running")!=ERROR_ALREADY_EXISTS)
{
Sleep(1);
}
or the other way around.
Try it
gabby
|
|
|
|
|
Thanks for the sugestions I am current executing the second file using this
WinExec("Application.exe",SW_SHOWMAXIMIZED);
Is there any other way I can check to see if its running without using Mutex as I have had lots of problems with them in the past
|
|
|
|
|
Check this out in MSDN:
Platform SDK: Performance Monitoring : Enumerating All Processes
|
|
|
|
|
HocusPocus235 wrote:
WinExec("Application.exe",SW_SHOWMAXIMIZED);
As WinExec() is for use with 16-bit Windows, why not use CreateProcess() instead?
STARTUPINFO si = {0};
PROCESS_INFORMATION pi = {0};
si.cb = sizeof(si);
CreateProcess(NULL, "Application.exe", ..., &si, &pi); Now when you want to know about the process, just look at pi.hProcess .
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Thanks for the sugestions people CreateProcess worked a charm
|
|
|
|
|
well..... ihad done this a different way.....
u c .....windows cannot delete a file when itz running.....use that concept.....
first make extra copies(backup) of the exe in a different location.....suppose the file that u want to check is not running,and u check this by trying to delete this file using the other running application,if success in deleteing the file then the file that u were checking was not running,else if it couldnt delete it,it meanz itz running.....now suppose it wasnt running and by checking this file if itz running or not(by trying to delete method),the file getz deleted,so now replace the backup exe to the same location.....
thatz the idea,i used in one of my programz.....
(might soung stupid.....but it workz fine).....
hope this info helpz.....
Happy programmin....
cheerz.....
|
|
|
|
|
Enumerating the running processes is as easy and a hell of a lot safer.
You also can not delete an executable if it is read only!!
I would *NOT* recommend that people try to determine if executables are running in this way.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
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!
|
|
|
|