|
thevoyager wrote:
but I am not able to fill data in the edit boxes or get the "OK" button clicked.
1. First Find Handle to Remote Window Using FindWindow() and FindWindowEx Api's.
2. Now, Find the Edit Box and OK Button, In Which you want to fill your custom values off course using FindWindowEx or EnumChildWindow Api.
3. Using WM_SETTEXT message Fill the Edit Box of remote Window from your custom text.
4. After completing above task, Post BN_CLICKED message for OK Button to Remote Window
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Thanks Alok, it works
I got the Handle to Remote Window and also to the buttons on it, but...
i) I'm not able to get control of the edit box (I searched for the button based on it's caption, but editboxes don't have a caption and i don't know what to give in the parameter lpszClassName).
ii) Sending BN_CLICKED message for the OK Button doesn't seem to work.
I'm sending you my code. Could you please figure out the problem:
CWnd* pClientWnd = NULL;<br />
pClientWnd = FindWindow(NULL, "Login");<br />
CWnd* pControl = new CWnd();<br />
HWND hWndOk = FindWindowEx((pClientWnd->m_hWnd), NULL, NULL, "&OK");<br />
pControl->Attach(hWndOk);<br />
pControl->EnableWindow(TRUE);<br />
pControl->PostMessage(BN_CLICKED);
|
|
|
|
|
thevoyager wrote:
I'm not able to get control of the edit box
Try obtaining its Control ID by using Spy++ and then searching by this ID among pClientWnd's children.
thevoyager wrote:
pControl->PostMessage(BN_CLICKED);
BN_CLICKED is not a message. It's a notification code to be used in a WM_COMMAND message. Check the documentation for both BN_CLICKED and WM_COMMAND.
You should post a WM_COMMAND message to the button's parent window (not the button), indicating a BN_CLICKED code and the button's ID. In fact, for the OK button, this ID is most likely IDOK, so you wouldn't even need to search and obtain a handle to the button itself.
Hope that helps,
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Jose Lamas Rios wrote:
You should post a WM_COMMAND message to the button's parent window (not the button), indicating a BN_CLICKED code and the button's ID.
Yeap, You are Right, Thanks for Correcting me Again Mr. Rios .
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
ThatsAlok wrote:
Yeap, You are Right, Thanks for Correcting me Again Mr. Rios
He, no problem
But if you like my corrections, that would be "Mr. Lamas", or "Mr. Lamas Ríos"
Anyway, just "José" or "jlr" will do.
Cheers,
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Jose Lamas Rios wrote:
But if you like my corrections, that would be "Mr. Lamas", or "Mr. Lamas Ríos"
, So i Will refer you by Jlr
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
when i compile my project i get this error!!!
--------------------Configuration: Ado1 - Win32 Debug--------------------
Compiling resources...
Compiling...
StdAfx.cpp
c:\program files\microsoft visual studio\vc98\mfc\include\afxv_w32.h(14) : fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>
Error executing cl.exe.
Ado1.exe - 1 error(s), 0 warning(s)
it is showing that error is in stdafx.h..
wat to do now...
i have only added one line to stdafx.h which is:: #include "comdef.h"
there is no #include <windows.h> in any of my project file...
please help and thanks
|
|
|
|
|
Use the < tags just above the emoticons because we cannot see which header file you included.
|
|
|
|
|
cedric moonen wrote:
< tags just above the emoticons because we cannot see which header file you included.
We Posted our comment at same Time
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Wow, that is synchronisation isn't it ?
|
|
|
|
|
smartymanav wrote:
have only added one line to stdafx.h which is:: #include
I am unable to see which file you have included in your project, please modify your comment with Do not treat <'s as HTML tags option checked
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Try including "comdef.h" after all other includes.
this is this.
|
|
|
|
|
|
|
Add your include files at the end of stdafx.h, just before the '#endif' line at the bottom. If you add your headers at the top of the file you will get this error.
sigless
|
|
|
|
|
|
hi,
i like to have to code to detect the client browser and according to that i have alter my tag.
eg
if ie then
if netscape then
if mozilla then
div align='left'
i need javascript code. anyone help me?
|
|
|
|
|
cnsathya wrote:
i need javascript code. anyone help me?
Perhaps you'd get better results at the Web Development forum...
This is Visual C++. Web Development is this way --->> (third door down the center corridor)
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Hi!
I found some APIs in MSDN for embeding Fonts like TTEmbedFontEx, TTGetEmbeddedFontInfo etc.
As per the documentation it says
Requirements
Header: Declared in T2embapi.h.
DLL: Part of T2embed.dll
Windows 2000/XP
Windows 98/98 SE/Me
but I can not find T2embapi.h any where, I have got all SDK's and DDk's installed.
Has any one ever used these Api's? I am not sure if these will serve my purpose.
Actually I want to embed font in the PS file from PS printer driver so that it is printed fine on the printer.
If anybody has got any idea how to do so pls. let me know
Thanks
Naveen
|
|
|
|
|
|
Hello friends,
I am saving telephone numbers in a combo box control. I want to delete the current selection in the combo box. DeleteString deletes item at specified index.
How do i go about this?
thank you
pallavi
|
|
|
|
|
mpallavi wrote:
I want to delete the current selection in the combo box. DeleteString deletes item at specified index.
If you are using Single Selection combo Box :-
int nIndex = pmyComboBox.GetCurSel();
if ((nIndex != LB_ERR))
{
pmyComoBox.DeleteString(nIndex);
}
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
mpallavi wrote:
I want to delete the current selection in the combo box. DeleteString deletes item at specified index.
How do i go about this?
int nCurrent = combo.GetCurSel();
if (nCurrent != CB_ERR)
combo.DeleteString(nCurrent);
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
If you want to delete the item from the drop list:
<br />
int nCurSel = m_myComboBox.GetCurSel();<br />
if (nCurSel != CB_ERR)<br />
m_myComboBox.DeleteString(nCurSel);<br />
If you just want to clear the text (if combo is not a drop list):
<br />
m_myComboBox.SetWindowText(_T(""));<br />
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
|
|
|
|
|
Thank you all..
Can anyone tell me how do i get the data associated with the current selection .. i mean the value of the current selection.
thanx
pallavi
|
|
|
|