|
I tried this::
IFileIO.h
<br />
#pragma once<br />
<br />
interface IFileIO<br />
{<br />
void setData(int xi);<br />
};
EDCService.h
#pragma once
#include "IFileIO.h"
<br />
class EDCService:public IFileIO<br />
{<br />
public:<br />
EDCService(){};<br />
int x;<br />
<br />
void setData(int xi)<br />
{<br />
x = xi;<br />
}<br />
};
Its works fine for me.
I can create instance like this
EDCService serviceObj;
Try it and let me know how it works
Manish Patel.
B.E. - Information Technology.
|
|
|
|
|
Hi
i use SendMessage(hndl,WM_SETTEXT,0,buufer) to send data in the edit control............ every time the program runs it clears the old text from the edit control and writes the new one to it ......but i want to keep the old data in the edit control and appends the new one ......
tHanks in advance
AbidBhat
|
|
|
|
|
First Get Text from Control and then append your text to this text and then set this combined text to edit control
Got it?
Manish Patel.
B.E. - Information Technology.
|
|
|
|
|
At first I thought this was a joke but now I think you are serious. I hope programming is just a hobby for you.
|
|
|
|
|
I think you need to save previous data of your program on the registry or a file for read again.
|
|
|
|
|
Not funny.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
I dont think my replay is funny?
|
|
|
|
|
manish is right, but there is a more efficient way:
send EM_SETSEL, -1, -1 to move the cursor to the end of the text
send EM_REPLACESEL, (TRUE/FALSE), (LPARAM) "your text" to insert the text at the cursor location (i.e. the end)
We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP blog: TDD - the Aha! | Linkify!| FoldWithUs! | sighist
|
|
|
|
|
See this[^] article.
/ravi
|
|
|
|
|
Hello all
I want to identify multiple monitors as we can do it by this way:
In Display Settings, by pressing Identify button.
Is there anyway to do this??
I am running on WinXP sp2
Thanks in advance.
Manish Patel.
B.E. - Information Technology.
|
|
|
|
|
use GetSystemMetrics(SM_CMONITORS) to detect if there is more than one monitor.
You can also use:
EnumDisplayMonitors() to enumarate monitors and retrieving the rect on screen.
GetMonitorInfo() to get information about a special monitor.
MonitorFromPoint() to get a handle to a monitor when you have a point.
You can use GDI to draw on screen or display a window to identify monitors
|
|
|
|
|
karle, Thanks for your kind reply
I want to Draw monitor number on top of all window and only number should be visible as system shows when we click on identify button of system settings property.
Any idea?
Thanks in advance.
Manish Patel.
B.E. - Information Technology.
|
|
|
|
|
you could make a separate window for each number display and show one on each monitor.
make each window a "stay on top" window (see SetWindowPos, z-order argument) so it shows above all other windows.
and if all you want is the number, then make the window without any border or title bar and use color key transparency (see the WS_EX_LAYERED extended style, and the SetLayeredWindowAttributes() API using the LWA_COLORKEY flag).
|
|
|
|
|
you can add the monitor number in each caption of your windows or
you create a transparent window with the size of the entire desktop (spreading over all monitors)
an draw the number with GDI in this window
|
|
|
|
|
Hello there.
I'm doing a program that waits for an application being minimized and send it to system tray.
I started using window hooks to intercept WM_MOVE messages, but I had some problems. First problem is that I can't find any documented function that can say if the window is really minimized, so i used the following workaround:
GetWindowRect(HWND(wps->hwnd),&rRect);
if (rRect.bottom=-32000)
other problem is that i cannot find if the hwnd is the main window of the application or any child window. When I minimize Firefox, for example, i get more than 8 icons on tray, depending on the tabs i have opened at the moment.
I was reading about hooks at Microsoft website and they say that we need an 64-bit dll to inject on a 64-bit executable and a 32-bit dll to inject on a 32-bit executable, so i was wondering if it wasn't a better solution to run through every hwnd on the system and see if it is minimized or not. I know it's not the best practice, but just wondering...
Any help will be kindly appreciated.
Best regards
|
|
|
|
|
marcio k wrote: First problem is that I can't find any documented function that can say if the window is really minimized...
What about IsIconic() ?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: What about IsIconic()?
That won’t work, since it answers question: is window already minimized.
marcio:
I am not sure what windows hook you are using but from your description I think it is either WH_GETMESSAGE or WH_CALLWNDPROC.
Consider using computer-based training hook: WH_CBT, monitoring HCBT_MINMAX code. Upon receiving this code examine lParam; it should be SW_MINIMIZE if window is minimizing. It will always be a top level window unless some application is trying to minimize child window. You can always verify if it is a top level window
Mind you, it has to be a global hook in a DLL. If you have never used hooks, there are some caveats you have to be aware.
How do you handle your present hook?
JohnCz
MS C++ MVP
|
|
|
|
|
JohnCz wrote: is window already minimized.
Which is exactly what the OP was asking about. His question was past tense (i.e., has already happened).
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: His question was past tense
Well, you have a right to your own opinion but do you really think that following is a past tense?
marcio k wrote being minimized
JohnCz
MS C++ MVP
|
|
|
|
|
The part I focused on was, "...if the window is really minimized."
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I attempted to do this in a DLL and it worked just fine .
However moving the code inside COM exe does not report any error but does not load the information in the registry .
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
ZeroMemory( &pi, sizeof(pi) );
CString strLocalFileName = CString(_T("regedit.exe /s ")) + strRegFileName;
if( !CreateProcess( NULL,
strLocalFileName.GetBuffer(0),
NULL,
NULL,
TRUE,
NORMAL_PRIORITY_CLASS,
NULL,
NULL,
&si,
&pi )
)
{
int error = GetLastError() ;
CloseHandle(pi.hProcess) ;
return false ;
}
else
{
ATLTRACE("GetLastError = %d\n",GetLastError());
WaitForSingleObject( pi.hProcess, INFINITE );
DWORD dwCode = 0;
GetExitCodeProcess ( pi.hProcess, &dwCode);
CloseHandle(pi.hProcess);
}
Any help is appreciated !
Engineering is the effort !
|
|
|
|
|
Try specifying some value other than 0 for si.wShowWindow . That way you can see if an error is popping up (and quickly disappearing).
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
so basically I am trying to create a process to run
regedit /s C:\Program Files\Common Files\MyApp\1.reg
For debugging purposes I removed the /s for regedit and I see that it
chops the path by space
So it keeps asking if I want to enter the entry
C:\Program Files
Common
Files\MyApp\1.reg
Is there a way this can be prevented ?
These files are present in the current working directory of the exe and pro grammatically obtained via GetModuleFileName
Engineering is the effort !
|
|
|
|
|
thanks for steering me into resolving this .
The key was to enclose the file path in quotes before supplying it to regedit.
But I wonder why and how this would be different in a DLL that I developed .
Engineering is the effort !
|
|
|
|
|
This looks strange:
ZeroMemory( p, sizeof(pi) );
|
|
|
|