|
You could try to place and test the code
inside a service, that would be started by user SYSTEM...
(if you know the title or class (discovered by Spy) of your dialog,
you could try the function FindWindow(..) too )Check your definition of Irrationality[ ^]
1 - Avicenna
5 - Hubbard
3 - Own definition
|
|
|
|
|
I want to place the window at top,left corner..
any idea
|
|
|
|
|
Your idea is fully correct:
you need the windows handle
(
Did you try your previous posted context (5 min waiting) with
while (!FindWindow(..) &&
!WaitTimeLimit()) {
Sleep(100);
} )Check your definition of Irrationality[ ^]
1 - Avicenna
5 - Hubbard
3 - Own definition
|
|
|
|
|
Could you give answer according to my problem / code?
I print the title of window, in vista I am getting different window title.
It means there are same process id for 2 process.
How to get correct one?
|
|
|
|
|
You could pass the returned handle to the searching tool of Spy
to control and analyze the result Check your definition of Irrationality[ ^]
1 - Avicenna
5 - Hubbard
3 - Own definition
|
|
|
|
|
I think you should load the visual c++ 2008 which suport new grammar to help you accomplish your program .
|
|
|
|
|
Hi,
I have a string like " Tag-10 CValve-15 Pump-2 ColorPush-1 Push-5"
Here i have to get the numbers of particular string.
I will find "Tag-" and then i will get the value 10.Like this i have to proceed.
What my problem is when i Find for "Push-",it returns the value as 1
and when i search for "ColorPush-",it return the value as 1.
But for "Push-" i want only the value of 5.How can i get that?
BOOL bFind = sTemp.Find("Tag") != -1 ? TRUE : FALSE;
if(bFind)
{
iPosHypen = sTemp.Find("Tag-");
iPosNewLine = sTemp.Find("\n", iPosHypen+4);
sName = sTemp.Left(iPosNewLine - 1);
sNo = sName.Mid(iPosHypen + 4);
iTagNum[iNo] = atoi(sNo);
}
.
.
bFind = sTemp.Find("Push") != -1 ? TRUE : FALSE;
if(bFind)
{
iPosHypen = sTemp.Find("Push-");
iPosNewLine = sTemp.Find("\n", iPosHypen+5);
sName = sTemp.Left(iPosNewLine - 1);
sNo = sName.Mid(iPosHypen + 5);
iButtonNum[iNo] = atoi(sNo);
}
bFind = sTemp.Find("ColorPush") != -1 ? TRUE : FALSE;
if(bFind)
{
iPosHypen = sTemp.Find("ColorPush-");
iPosNewLine = sTemp.Find("\n", iPosHypen+10);
sName = sTemp.Left(iPosNewLine - 1);
sNo = sName.Mid(iPosHypen + 10);
iPushNum[iNo] = atoi(sNo);
} Anu
|
|
|
|
|
Firstly let me ask you, did u check the syntax of CString::Find functions([^])?
It returns integer not bool, and it returns the index which can be used to find in case of multiple occurances.
Find is overloaded functions,
int Find( TCHAR ch ) const;
int Find( LPCTSTR lpszSub ) const;
int Find( TCHAR ch, int nStart ) const;
int Find( LPCTSTR pstr, int nStart ) const;
I think this sample code will solve your problem.
int nFind = sTemp.Find("ColorPush", 0);
if( -1 != nFind )
{
nFind++;
}
int nFind = sTemp.Find("Push", nFind ); Величие не Бога может быть недооценена.
|
|
|
|
|
always go for simple solutions. If a blank space is guaranteed before the items you search, then find them as
int nPos = sTemp.Find(" ColorPush-");
if(-1 != nPos)
{
}
nPos = sTemp.Find(" Push-");
if(-1 != nPos)
{
}
|
|
|
|
|
Actually before every text no blankspace occur.all are new line character.
"Tag-10||CValve-5||Push-1||ColorPush-5"
Is there any way to search full text.
Like, if im searching for "Push",it should get only "Push" not "ColorPush".Anu
|
|
|
|
|
You have to make a logic with CString::Find based on your requirement.
That is your job.
But if you have a symbol in between each set as you mentioned "||", then
strtok is very useful [^]Величие не Бога может быть недооценена.
|
|
|
|
|
How does it know you are only searching for Push? The literal string is part of ColorPush. If this is the the actual text, it appears you can use the delimiters. Thus you'd search for "\r\nPush-" (Note the dash, else you could also find "\r\nPushBack".)
An alternative is to parse the string and match each keyword as you parse, rather than the other way around.
|
|
|
|
|
This sample code may help
CString sTemp("Tag-10\nCValve-15\nPump-2\nColorPush-1\nPush-5");
int nFindFirstPos=0,nFindNextPos=0;
while ((nFindNextPos=sTemp.Find('\n',nFindFirstPos))!=-1)
{
int nStartIndex = nFindNextPos-1;
while(sTemp.GetAt(nStartIndex)>='0'&&sTemp.GetAt(nStartIndex)<='9')
{
nStartIndex--;
}
CString strNum =sTemp.Mid(nStartIndex+1,nFindNextPos-nStartIndex);
MessageBox(strNum);
nFindFirstPos=nFindNextPos+1;
}
|
|
|
|
|
hi i want to create a 12 buttons dynamically, 6 button 40x40 pixels and 6 button size 60x60 pixels with two different groups (group 1 contains 6 buttons and group 2 contains 6 buttons) with border.and i want to move groups within the dialog eg : MFC dialog window contains many controls and we can easily move the dialog within the screen. same thing i want move the groups which contains buttons within the dialog.
i have created buttons dynamically in a dialog.but i have no idia how to create groups please help me.
Thanks in advance.
|
|
|
|
|
When you create a button use BS_GROUPBOX to get in group
CButton* group1 = new CButton();
group1->Create(_T("Group1"),WS_CHILD|WS_VISIBLE|BS_GROUPBOX, CRect(0,0,360,50), this, 2000);
See the below link [^]Величие не Бога может быть недооценена.
|
|
|
|
|
CButton* group1 = new CButton();
group1->Create(_T("Group1"),WS_CHILD|WS_VISIBLE|BS_GROUPBOX, Rect(0,0,360,50), this, 2000);
i tryied this, but i want to move group along with controls any where in a dialog.but it wont work.
|
|
|
|
|
|
Hello,
Can I create a dialog that is larger than the screen size, and is controlled by the right hand side bar?
I have spent some time looking at information to see if this is possible, but no such luck.
I have currently created a dialog by extending the bottom of the dialog box, and it is approximately 2.5 screens. When I run the program, only one screen's worth of info appears, and no way to get to the rest.
Thank you,
Mark
|
|
|
|
|
You can create windows of any size by handling the WM_GETMINMAXINFO[^] message.
What do you mean by the right hand side bar?
To scroll the window you will be able to click anywhere on the dialog and drag by handling the WM_NCHITTEST[^] message and returning HTCAPTION .
|
|
|
|
|
I do not know the proper term for the item that one can click on on the right hand side of the dialog to go to the next page.
For example, the "bar" gets dragged down by the mouse, and the page moves however many lines you actually drag the mouse. If I click below the "bar", then the next page is displayed.
Most often, this side bar appears on internet pages that consist of many pages.
Does this explanation help?
Thank you
|
|
|
|
|
|
It isnt usual (because unergonomic) to create windows that are larger than the target screen. Better work with tabs or make it somehow fit and resizable to screen.
I wrote an article about some of these issues:
Repositioning Windows on Multiple Monitor Systems[^]Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Hello,
I have created an application which takes information entered via the GUI and puts this info into a file. I then wish to populate a .doc with this information.
Is anyone aware of a way to do this?
Thank you,
Mark
|
|
|
|
|
|
Hello,
I'm printing out doubles in c++, but not all the values have significant digits. Thus I'd like to accomplish the following using cout:
1.) If value is 90.00, then display it as 90 (no trailing zeros)
2.) If value is 99999999999999.0, then display it as 99999999999999 (not in scientific form)
3.) If value is 9.85545, then display it as 9.85545 (no precision loss)
Is there a combination of simultaneous ios flags that can be used with a single cout statement to accomplish the above 3 goals?
Thanks,
|
|
|
|