|
Handle OnMove in your parent window. You would be having a pointer/ object to the modeless dialog in the parent window. You can call
pChild->MoveWindow(x,y,//width,//height,true); if you have a pointer and likewise for an object.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I use GetWindowText to get the text of a focused object. (lets say a button)
<br />
HWND Btn = ::GetFocus;<br />
<br />
TCHAR ButtonText[1024];<br />
<br />
GetWindowText(Btn, ButtonText, 1024);<br />
This work fine for most windows application.
But when I try this for an application like Firefox I get a NULL-string.
Does anyone have a generic solution to get the text of these non-windows objects..?
|
|
|
|
|
Just out of curiosity, how you have tested this code ? Any action to execute this code could have made application window having this code to activate.
matijsmoest wrote: Does anyone have a generic solution to get the text of these non-windows objects..?
I dont think this is problem related to non-windows object.
Use SPY utility to see, if you can see caption of FirFox window. If you could; then there should not be any problem to get text with above code.
|
|
|
|
|
I use hooking to do this.
If a button is pressed, my code is hooked to the process.
When my code is executed, I make a screenshot and take some extra information from the screen. Like the caption of the activewindow and the caption of the selected button. For all applications I can get the caption of the activewindow, but the caption of the buttons is harder.
The caption doesn't appear in Spy++.
In case of FireFox I get a MozillaWindowClass. But I dont know anything about it..
|
|
|
|
|
It seems that, you are not setting focus correctly on window. Use SPY and select caption bar of Mozila window. You will see the caption of window.
Now setting focus there, use you code.
..You made me install this browser on my m/c.
|
|
|
|
|
Thanx for helping me!
I can (as you figured out) get the caption of a Mozilla window when the focus is good.
My problem is that I can't get the caption of the selected button inside that window. I also can't find this caption in SPY.
I tried it with te options screen:
Tools >> Options
Then tap to the "Use current page" button. I can't find the text "Use current page" in SPY anywhere.
|
|
|
|
|
matijsmoest wrote: tried it with te options screen:
Tools >> Options
Then tap to the "Use current page" button. I can't find the text "Use current page" in SPY anywhere.
Yes, you are right. But I dont know how that window is constructed, because the it looks as a homogeneous panel and SPY cant differentiate betn its child control. No clue about it.
AFAK, its opensource, see if possible, how its achieved ?
-- modified at 7:40 Friday 1st September, 2006
|
|
|
|
|
matijsmoest wrote: : GetWindowText problem
According to MSDN, GetWindowText can't bring text from remote Window control except it title.. you have to use WM_GETTEXT!
"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
Support CRY- Child Relief and You
|
|
|
|
|
WM_GETTEXT gives me the same result
|
|
|
|
|
The Firefox UI uses their custom-built XUL stuff, not standard windows controls. Sending it window messages probably won't work (unless they reimplemented all the message handling of the corresponding controls, which is doubtful).
|
|
|
|
|
Hi All..
I am working with TabControl, where I created 3 dialog Boxes, in these three one dialog with TabControl, and remaining two dialogs with edit control.
In first Tab-first dialog, Second Tab-second dialog
I had created two dialogs in the OnInitDialog() function .
m_FirstDialog =new CFirstDialog();<br />
HRSRC hResource = FindResource(g_hModule, MAKEINTRESOURCE(IDD_FIRST_DIALOG),RT_DIALOG );<br />
HGLOBAL hTemplate = LoadResource(g_hModule, hResource);<br />
BOOL bResult = m_FirstDialog->CreateIndirect (hTemplate, this);<br />
FreeResource(hTemplate);<br />
m_FirstDialog->ShowWindow (SW_SHOW);
same code fallows for Second Dialog.
Everything is fine but Problem is when I tried to send data from member variable to Control on First , second dialogs.
I am not able to acces the data in editboxes in First, second dialogs from the TabDialog(tabcontrol).
Can you please help me how to find the cause of this problem.
Thanking You.
Sheshidar
|
|
|
|
|
Please suggest available coverage tools that can be integrated with wxDevC++ IDE.
Cheers
Pavan
|
|
|
|
|
Hi all,
I have this piece of code but I didn't write it, and I'm struggling my butt off to understand it ... can anyone help me...
<br />
typdef struct {<br />
uint8_t status;
uint8_t nrclus;
uint16_t tfmtag;
uint16_t recdid;
uint32_t fladdr;
uint8_t *pdbuff;
} TFM_PARAM3;<br />
<br />
typdef struct {<br />
uint8_t status;
uint8_t nrclus;
uint16_t tfmtag;
uint16_t recdid;
uint32_t fladdr;
uint8_t *pdbuff;
void (*app_cb) (TFM_PARAM3 TfmParameters);
} TFM_PARAM2;<br />
<br />
Many thanx...<br />
<br />
Regards
Programm3r
|
|
|
|
|
Programm3r wrote: void (*app_cb) (TFM_PARAM3 TfmParameters);
this declares a pointer to a function which gets a TFM_PARAM3 as a parameter, and returns nothing. this function pointer is called app_cb in your structure.
to use it, you can do this :
void Foo (TFM_PARAM3);
TFM_PARAM2 myStruct;
myStruct.app_cb = &Foo;
|
|
|
|
|
Thanx alot you guys ....
Regards
Programm3r
|
|
|
|
|
toxcct wrote: void Foo (TFM_PARAM3); TFM_PARAM2 myStruct;myStruct = &Foo;
Shouldn't we write:
myStruct.app_cb = &Foo
----------------------
Mayank Thakore
Learning C++ - since 1998
They didn't print my card right; so I resigned.
|
|
|
|
|
Yes, you're correct.
You can also write:
myStruct.app_cb = Foo;
I think that's also in the standard rather than being a common compiler extension.
Kev
|
|
|
|
|
lemur2 wrote: You can also write:
myStruct.app_cb = Foo;
functions have a unique property that their value is their address
i.e. &Foo == Foo
not sure if this is standard... works in VC++
----------------------
Mayank Thakore
Learning C++ - since 1998
They didn't print my card right; so I resigned.
|
|
|
|
|
MayankT wrote: not sure if this is standard... works in VC++
yes it works under microsoft compilers, but not standard. if i remember correctly, the last standard (or the future one) prevents to use the notation without the address operator...
|
|
|
|
|
toxcct wrote: the last standard (or the future one) prevents to use the notation without the address operator...
this is good to remove the slight confusion...
is there something planned for using function pointers as well?
like:
<br />
voif func () {}<br />
<br />
void (*func_ptr) ();<br />
<br />
func_ptr = &func;<br />
<br />
(*func_ptr)();
func_ptr ();
<br />
----------------------
Mayank Thakore
Learning C++ - since 1998
They didn't print my card right; so I resigned.
|
|
|
|
|
i don't know for this, but i personnaly prefer calling a function (even through a function pointer) with the usual syntax.
if you call a function with func_ptr() (even if the name is not that explicit), you can always browse the sources for the declaration of the func_ptr pointer, and then identify it to being a function pointer...
|
|
|
|
|
yes of course, i typed too fast and forgot to apply the .operator to the field of the structure.
thanks for the notice
|
|
|
|
|
Programm3r wrote: void (*app_cb) (TFM_PARAM3 TfmParameters); // THIS PART I DONT UNDERSTAND
Isn't this pointer to a function returning void and taking parameter to type TFM_PARAM3, which is declared above.
|
|
|
|
|
I have no idea .... what why I posted the question....
Regards
Programm3r
|
|
|
|
|
I have defined a template class in a header file like so:
template <class _T> class TCollection {
public:
TCollection();
~TCollection();
Then try to declare the members in the cpp file like so:
TCollection::TCollection() : pData(0) , pCount(0)
{
}
TCollection::~TCollection()
{
clear();
}
Yet I am getting a compiler error
'TCollection' : use of class template requires template argument list
Obviously it cannot be treated like a normal class, so what is the correct way of declaring the members?
|
|
|
|