|
hi,
what can I use FileChannel(valid in JAVA) in C++.
|
|
|
|
|
Hi there,
Can anyone tell me how can I track other application window handle and automate/simulate the object evens on that application window like button press etc..
Application will be running on the same PC, just like an .exe application.
Regards
|
|
|
|
|
Use SendMessage() or PostMessage() .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
1- use the spy to get the caption of the target window
2- use FindWindow to get the handle to this parent window
3- use EnumChildWindow(given the parent window handle) to loop onto the child windows of that parent window(like button,label,..etc
4- use SendMessage to fire the action of any child window.
any function i listed,see its def. from the MSDN,and its details..
by the way..i had automated so many other applications windows..
bye..
Amr
Hawk,amr
|
|
|
|
|
I've added an accelerator, then Ctrl+W then selected my main Dlg class.
However, when I run my program and press the keys, the accelerator doesn't work...
thanks for help
-Mike
|
|
|
|
|
Have you called LoadAccelerators() in the dialog's constructor? You'll also need to override the PreTranslateMessage() method and call TranslateAccelerator() accordingly.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hmm, can you give me an example please?
I'm kinda new...
CTestDlg::CTestDlg(CWnd* pParent /*=NULL*/)
: CDialog(CTestDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CD2HackKitDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
thanks
|
|
|
|
|
CTestDlg::CTestDlg(CWnd* pParent) : CDialog(CTestDlg::IDD, pParent)
{
m_hAccelTable = LoadAccelerators(AfxGetResourceHandle(), MAKEINTRESOURCE(IDR_ACCELERATOR1));
}
BOOL CTestDlg::PreTranslateMessage( LPMSG pMsg )
{
if (NULL != m_hAccelTable)
{
if (::TranslateAccelerator(m_hWnd, m_hAccelTable, pMsg))
return (TRUE);
}
return CDialog::PreTranslateMessage(pMsg);
}
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
|
I just completed an application for a company and they want a 30 day trial version made for demos.. can anyone point me in the right direction on how do add 30 day support? I have thought of looking at dates on files, creating reg keys etc.. but they want to make sure turning the clock back will not effect the time out. Any ideas?
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
One thing you might do is to have your software quit after 30 minutes, 60 minutes of use. and always, always remove all save functionalities from your demo versions.
If you can't do that and want a full version with a 30 days limit, remove some functionalities, restrict/disable saving, ...
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
|
I'm going to give it a shot.. Found that a little earlier today, there is another one in that area too..
I'll give it a try, Thanks!
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Hi all,
I have a set of property pages on a property sheet. I am trying to add a page to the sheet and change the title, but the title does not change.
If I do:
//AddPage(thepage);
//SetActivePage(thepage);
SetWindowText("TEST");
CString strTest;
GetWindowText(strTest);
Then strTest is changed to "TEST" correctly, but the text does not show up on the control.
Am i missing something?
Thanks and Regards,
Simon
|
|
|
|
|
See if MSDN article Q141487 helps. There's also the CPropertyPage protected member, m_strCaption .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Yes - the knowledge base article helped and I am now sorted.
Thanks very much,
Simon
|
|
|
|
|
SJolly wrote:
...and I am now sorted
I was not aware this was a sorting-related problem.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Sorry, my fault:
I am now titled.
Thanks again,
Simon
|
|
|
|
|
|
This is the situation:
ON_NOTIFY_EX(TTN_NEEDTEXT, 0, OnToolTipNotify )
EnableToolTips(TRUE); is the first statement in OnInitDialog
<br />
BOOL DlgFlexListFormatColumns::OnToolTipNotify(UINT id, NMHDR *pNMHDR, LRESULT *pResult){<br />
CString tooltiptext2display;<br />
tooltiptext2display = "";<br />
TOOLTIPTEXT *pTTT = (TOOLTIPTEXT *)pNMHDR; <br />
UINT nID = pNMHDR->idFrom;<br />
if (pTTT->uFlags & TTF_IDISHWND) {<br />
nID = ::GetDlgCtrlID((HWND)nID);<br />
switch(nID){<br />
case IDC_STATIC_LINESPERROW: tooltiptext2display.Format(IDS_LINESPERROW);<br />
break;<br />
case IDC_EDIT_NROFLINES: tooltiptext2display.Format(IDS_LINESPERROW);<br />
break;<br />
default:<br />
break;<br />
}
strcpy(pTTT->szText, tooltiptext2display);<br />
return(TRUE);<br />
}
else{ return FALSE; }
}
and in the header:
afx_msg BOOL OnToolTipNotify(UINT id, NMHDR *pNMHDR,LRESULT *pResult);<br />
QUESTION:
There is only 1 control in my dialog which catches (and thus shows) a tooltip. All the rest does nothing.
What did I do wrong?
tnx for your help...
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
V. wrote:
ON_NOTIFY_EX(TTN_NEEDTEXT, 0, OnToolTipNotify )
Change this to:
ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTW, 0, 0xFFFF, OnToolTipNotify)
ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTA, 0, 0xFFFF, OnToolTipNotify) V. wrote:
There is only 1 control in my dialog which catches (and thus shows) a tooltip.
Does that imply that OnToolTipNotify() is called only for that one control? Are the other controls obscured by anything, including a group box?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Well now you mention it: yes, they are all surrounded by a groupbox.
(that one control isn't surrounded)
I didn't know that that would be problem?
Why's that?
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
The group box control needs to be behind the other controls. Even though it appears as a skinny line surrounding the controls, it is actually obscuring them as far as tooltips are concerned. In the resource editor, change the tab order of the controls such that all the controls within the group come first.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi,
tnx for your reply, but I'm afraid the changes didn't make any difference...
Oh well if it doesn't work, the boss must be happy without.;P
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
V. wrote:
Oh well if it doesn't work, the boss must be happy without
If you can trim the code down to something very small and still be able to reproduce it, feel free to send the project to me and I can take a look.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|