|
Amarelia wrote:
...I m not able to get the caption, classname or anything by GetWindowText or FindWindow().
Why not?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
EnumWindows() will cycle through every single window on the machine. Your program should be in there somewhere. You need to provide EnumWindows with a function to call for each window handle. Then try using GetWindowText() or GetClassName(). Most times you can figure out which Window Text or Class Name you are looking for if you use Spy++ (comes with Visual Studio).
Hope this helps!
Danny
|
|
|
|
|
Amarelia wrote:
I m not able to get the caption, classname or anything by GetWindowText or FindWindow().
After redaing your messages, one of best idea is to save your current handle of window in some INI or registry at starting .. so that other application read it from that common location and perform teh required.. though it not good solution... but it's worth trying it
"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
|
|
|
|
|
In Debug Mode, can we remove our application with codes..
Iam opening the winword with my application, without closing the word i closed my appliaction, for the next time while iam running the appliacion an error is showing coz of my applaction still exits in the task manager.. is there any solution for closing my applaiction from the code?
|
|
|
|
|
Is your application spawning additional threads?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Perhaps try sending winword the WM_CLOSE message with SendMessage(), and send your own program the message, as well.
Hope this helps!
Danny
|
|
|
|
|
Hi all,
It is more of a windows question than Visualc++ related.
My questions are regarding the windows display settings.
[1]How Can I set "large","small" fonts settings under windows.Iam using WinXp & If I go to ControlPanel->Display,(Darstellung Tab,Iam using a German wINxP),I see the font->Normal,Large & Extra Large.
Is this the place for setting large & small Fonts.If yes,I see it only as Normal,Large & extraLarge under my system.
[2]
If I go to Settings->advanced Tab,I see the DPI setting combobox containing,96 dpi,120 & userdefined value. What is this setting for & How is it related to the screen resolution....
Hope someone could clear up my mind..
Thanks...
|
|
|
|
|
Hi all..
I want to set some time for a menu tooltip before it appears when the cursor is placed on the menu item.For eg if i place my cursor on the menu item and i do not want the tooltip to appear immediately, instead it should appear after the time which is set.
How can i do that?
|
|
|
|
|
check it out,
void SetDelayTime( UINT nDelay );
void SetDelayTime( DWORD dwDuration, int iTime );
default time is 500ms.
best of luk
thanx
|
|
|
|
|
HI THIS A CODE SNIPPET,
void CPenWidthsDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Text(pDX, IDC_THIN_PEN_WIDTH, m_nThinWidth);
}
WAT DOES THIS DDX_ DO OR WERE IS THIS DEFINED AND CAN I OVERRIDE IT FOR MY CONVENIENCE AND CAN YOU SHOW HOW TO.
|
|
|
|
|
farpointer wrote:
WAT DOES THIS DDX_ DO OR WERE IS THIS DEFINED AND CAN I OVERRIDE IT FOR MY CONVENIENCE AND CAN YOU SHOW HOW TO.
Please do not shout, or fix your CAPS LOCK key on your keyboard.
As for your question, DDX_ is an MFC macro that maps one of the controls you have created in the resource editor (IDC_THIN_PEN_WIDTH) to the member variable (m_nThinWidth), so that you can access to the control using the member variable.
For advanced user, it is possible to mess with the MFC macros; however, unless you are trying to do some advanced code, if you have to change a macro, it points out a bad design. What are you trying to achieve exactely ?
~RaGE();
|
|
|
|
|
about the caps lock if you felt it that way then iam sorry ,i just wanted to know wether we could do it or not.
thanx for the explanation.
|
|
|
|
|
The way to figure this out for yourself is to place a breakpoint on the DDX_ line, run your program in the debugger and step into the DDX_ code.
You will then see what DDX_ does, and with a little help from MSDN you can easily figure out how to write your own.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
Hey guys
I have a simple dialog based MFC in which I have removed the title bar area from property of dialog as I want to show that dialog in fullscreen. Also I have opened another smae kind of exe. now when i terminate I want to terminate the other EXE also. But my both the EXEs don't have either classname or caption. So how to close it ?
For that first i need to find handle of the other EXE and for this i use FindWindow() function. Now it requires classname or caption. Is there any way to assigne classname or caption so that I can find that window.
Any idea....
Or is there a way so that I first assign window name to one of my window and at run time I can hide that caption. ?
Regards,
Amarelia Maehsh
Gujarat
India
|
|
|
|
|
good question, but i dont think u can assign a classname,can u? letz wait for a reply
V
|
|
|
|
|
AFAI, with GetWindowsText , you can retrieve the "name" of your window. The fact that you does not show the caption does not remove the member of the dialog class containing the name, it is only not shown.
~RaGE();
|
|
|
|
|
HI,
IAM NOT SURE I HAVENT DONE IT BUT YOU MIGHT CHECK INTO THE INITINSTANCE() WHICH IS RESPONSIBLE FOR MULTIPLE INSTANCES OF AN APPLICATION AND SEE WETHER YOU CAN GET ANY HELP FROM THERE.
BEST OF LUK
FARPOINTER
|
|
|
|
|
|
You can do some interprocess communication.
In the second application use RegisterWindowMessage() to register a custom user message, and capture that message using WndProc() .
In the first application (full-screen), when you are exiting, register the custom message, then send it to all windows using:
::SendMessage(HWND_BROADCAST,id,0,0); //id is id of the message returned by RegisterWindowMessage() .
The second one will catch it in its WndProc() then it can exit.
this is this.
|
|
|
|
|
Use ::SendMessageTimeout instead or your application might hang on the first app that is not processing messages - I can already see myself shouting this from the grave
|
|
|
|
|
Amarelia wrote:
Also I have opened another smae kind of exe.
Are you using CreateProcess() or ShellExecuteEx() for this? If so, then just retain the handle of the new process. You can then call TerminateProcess() using that handle. Another option is to send that other application a WM_CLOSE message.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
In the MFC exe version,i created a thread just to protect the GUI from freezing, but is it actually need inside an ATL dll?.. the dll's going to be used by a VB application, i guess it wont freeze the VB application, but is it recommended to use threads even inside a component(ATL)?
ie, its just a do while loop
void simpleFunction()
{
do
{
}while();
}
or
UINT ThreadFunxn(LPVOID lp)
{
do
{
}while();
}
which one can be right inside a DLL?
thanx
V
|
|
|
|
|
You already know the uses of both approaches. If it is a small operation, then it will do fine without threading.
If it is lengthy, then you should use threads. Inside the threaded version, you can report back by firing events that the operation is complete etc. Also you need to make sure that the object created in VB stays alive (global) as long as the thread inside the dll is running.
Maybe someone else can give some better explanation.
this is this.
|
|
|
|
|
khan++ wrote:
Inside the threaded version, you can report back by firing events that the operation is complete etc
AFAIK,This some time can be complecated... let search some documentation regarding it and will revert back to you for further discussion..
"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
|
|
|
|
|
Vivekuniq wrote:
UINT ThreadFunxn(LPVOID lp)
{
do
{
}while();
}
offourse this one, What else
"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
|
|
|
|