|
Rajesh R Subramanian wrote: From his previous bizarre post (where he's searching for a control by it's caption), I think this particular control is owned by a different process
Ahh, I missed that one.
You're probably right Rajesh.
Rajesh R Subramanian wrote: Of course, I'm only assuming things.
Yeah, that's usually 50% of the job trying to put together a useful answer depending on the lack of information in the posts....
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Roger Stoltz wrote: Yeah, that's usually 50% of the job trying to put together a useful answer depending on the lack of information in the posts.... Wink
[Sylverster Stallone tone] Well, it's tough answering questions here. They give me a war that I cannot believe in. [/Sylverster Stallone tone]
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Rajesh R Subramanian wrote: Sylverster Stallone tone
Hey man, you're too young to remember Sly.
--Carlo Rocky Rambo.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
There you go, changing your middle name again.
Warm regards,
Rajesh "Neo" Subramanian.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Actually, you can use GetWindowText on windows which belong to a different process.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Code-o-mat wrote: Actually, you can use GetWindowText on windows which belong to a different process
Well, read the subject line of the post again and you'll find it mentions "window control".
Then have a look at the documentation I linked to in my post where it clearly says "GetWindowText cannot retrieve the text of a control in another application".
But, then I'm just assuming the OP really meant a control when he wrote it....
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Please read the whole conversation before adding your comments. We're talking about a control that is owned by another process.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
I did read the whole conversation, but maybe i misunderstood something...sorry about that...
I thought by "window control" you meant things like buttons or edit boxes on windows, and as far as i know you are able to get the text of those, or at least some of them, some controls, like buttons allow you to query their windowtext over process boundaries, while some don't. But i guess you meant something else, sorry...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
No worries, there's no need to apologise if you have read the whole conversation before adding your comments.
You can have a look at the Remarks section of the respective documentation page[^] to know what I'm talking about.
Here[^] is a detailed explanation.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Thanks
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Hi all,
i m working on VS-2008,and os is windows vista.
in case of UAC enable on Windows Vista, when i run my application its show a dialog box to allow or cancel the process.
i want when i run it,its always run like Administrator with full rights.
please tell me how can i do this.
thhanks in advance
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Modify your Manifest property from
Project Properties->Linker->Manifest file
Change UAC Execution Level to "Require Administrator".
See this[^]
|
|
|
|
|
So...you want your application to run with full administrative rights without the user knowing that it's running as administrator. Sounds a little insecure to me...which is probably why MS don't let you do it.
Anyway - this page[^] has a workaround, of sorts.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi to all.
I'm trying to sort strings which contains some eastern European specific letters.
I'm sorting with qsort function:
qsort( (void *)polje, (size_t)cnt, sizeof( char * ), compare );
where 'compare' is a helper function int compare( const void *arg1, const void *arg2 ) which uses '_stricoll' function.
Wen running my test app sorting doesn't work.
I then tried to set local settings like this on OnInitDialog():
char* locale;
locale = setlocale(LC_ALL,"Croatian");
locale returns "Croatian_Croatia.1250"; but sorting still isn't working, why?
Thanks in advance
|
|
|
|
|
All I can suggest is splitting the problem into smaller parts. First, check that _stricoll (and thus your compare function) compare strings as you would expect.
After that...well, can you confirm that polje is of type char* polje[] , i.e. an array of character pointers?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks for replay, code:
CString *polje = new CString[cnt];
for(int i=0; i<cnt;i++) {
CString pom;
m_List.GetText(i,pom);
polje[i] = pom;
}
qsort( (void *)polje, (size_t)cnt, sizeof( char * ), compare );
I have a list box control where user can add strings for sorting. Posted code is extracted from OnOK()!
|
|
|
|
|
Right...well, that sizeof(char*) in the qsort call isn't going to be correct, is it?
I would suggest:
- Change compare so it expects its two parameters to be pointers to
CString - Change the
sizeof( char* ) to be sizeof( CString )
And here's a thought - if you used STL containers, you could use type-safe algorithms and things that would highlight these issues...
std::vector<cstring> polje(cnt);
for(int i=0; i<cnt;++cnt)
{
CString pom;
m_List.GetText(i,pom);
polje.push_back(pom);
}
std::sort(polje.begin(), polje.end(), compareFunction);</cstring>
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
josip cagalj wrote: Wen running my test app sorting doesn't work.
For anything or just eastern European specific letters.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Just eastern European letters.
|
|
|
|
|
Hi,
I have created a ListBox control with Selection type as Multiselection. Can I know how to handle Ctrl and Shift keys while making a selection in ListBox items. ie.,If I press Shiftkey on a item and select another item than all items in between both items should be selected. If I press Controlkey on a item and select another item then only the two items should be selected.
Thanks..
|
|
|
|
|
I thought CListBox already did this?! Have you enabled multiple-select option?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
I have enabled Multi-select options. It is infact selecting multiple items. I need the following behavior
Items in listbox:
Test1
Test2
Test3
Test4
I select the Test1 item in the listbox , I press shift key and now select Test4 item. Expected behavior is Test2 and Test3 should also be selected.
Where as If I had pressed Ctrl key instead of Shift key then only Test1 and Test4 should be selected.
|
|
|
|
|
I am able to see this behavior if I set "Extended" style for the list box's selection style.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Yes... it works.. Thanks a lot Rajesh..
|
|
|
|
|
MFC, STUDIO 2008, MDI-project
How do set value of variable
1. from modal dialog window
into modeless window
and
2. from modeless window to modal dialog window ?
CString m_sModal(L"text for modeless dialog window");
CString m_sModeless;
CMyModeless2 - class modeless window
CAdodc_MDI - class modal window
There is pointer onto modeless class Into View class
CMyModeless2* m_pModeless;
Both dillog windows have buttons 'OK' and 'Cancel'
Thank you.
|
|
|
|