|
Gary R. Wheeler wrote:
Mike, I keep getting the feeling you've got some kind of macro thingy you run called SeeTheFAQ. It pops up a list of FAQ section titles, you pick one, and click Submit.
It's probably an undocumented feature of his CP searchbar
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
LOL
I've actually thought of writing an Explorer bar with links like that. What I do is, when I recognize a question that's in the FAQ, I open the FAQ (I have it bookmarked) then use some of the SearchBar keyboard shortcuts to make the links (most notably Ctrl+^ to make a clickety[^]).
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
Pinky, are you pondering what I'm pondering?
I think so Brain, but if we shaved our heads, we'd look like weasels!
|
|
|
|
|
I have been developing spidering applications following Pallman's book "Bots, Spiders and Intelligent Agents in Microsoft Visual C++" (Microsoft Press 1999) and have a persistent problem with messaging from tray icon once the onok event is triggered.
Ideally, once the robot has launched with onok, I'd like to be able to pause it or change its parameters by clicking on the status bar icon. Pallman's bots do this, but using the same code (but different Visual Studio version), mine don't. After I put the icon in the tray and before onok, clicking on the icon brings up the context menu but once onok is clicked, the tooltip message displays but there is no response to other mouse activity over the icon. The same problem with the minimized window in the task bar. If I click on task bar icon, it responds by highlighting but the main window is not repainted.
The project is developed in Visual Studio 2003 in C++ as a Dialog based MFC application (as Pallman instructs in his book) running under W2K. Some have suggested doing these as SDI or MDI projects but I'd like to defer that learning curve as the bots I have work fine but for this (significant) problem.
Suggestions?
|
|
|
|
|
|
It seems to me the code in your articls is about the same as mine. This is the code that doesn't work right.
in BotDlg.h
#define WM_TRAY_NOTIFY WM_USER + 0
...
...
class CBotDlg : public CDialog
{
// Construction
public:
CBotDlg(CWnd* pParent = NULL); // standard constructor
LRESULT OnTrayNotify(WPARAM wParam, LPARAM lParam);
void TakeABreak();
void BackToWork();
void OnMenuExit();
NOTIFYICONDATA m_nTrayData;
bool m_bOnBreak;
bool m_bHidden;
...
...
in BotDlg.cpp
...
...
BEGIN_MESSAGE_MAP(CBotDlg, CDialog)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_MESSAGE (WM_TRAY_NOTIFY, OnTrayNotify)
ON_COMMAND(IDC_BREAK, CBotDlg::TakeABreak)
ON_COMMAND (IDC_WORK, CBotDlg::BackToWork)
ON_COMMAND (IDC_EXIT, CBotDlg::OnMenuExit)
ON_BN_CLICKED(IDOK, OnBnClickedOk)
END_MESSAGE_MAP()
...
...
m_nTrayData.cbSize = sizeof(NOTIFYICONDATA);
m_nTrayData.hWnd = m_hWnd;
m_nTrayData.uID = 0;
m_nTrayData.hIcon = LoadIcon (AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_BREAK));
m_nTrayData.uCallbackMessage = WM_TRAY_NOTIFY;
strcpy (m_nTrayData.szTip, "Bot");
m_nTrayData.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
m_bOnBreak = false;
m_bHidden = false;
return TRUE; // return TRUE unless you set the focus to a control
...
...
// ******************************
// * *
// * OnTrayNotify *
// * *
// ******************************
//
// Tray Notification Handler
//
LRESULT CBotDlg::OnTrayNotify(WPARAM wParam, LPARAM lParam)
{
// ---- Left-button dclick: Exit Program
if (lParam == WM_LBUTTONDBLCLK)
{
Shell_NotifyIcon(NIM_DELETE, &m_nTrayData);
EndDialog(0);
}//end if
// ---- Right-button down: Pop-up menu
if (lParam == WM_RBUTTONDOWN)
{
CMenu menu;
VERIFY (menu.LoadMenu(IDR_MENU1));
CMenu* pPopup = menu.GetSubMenu(0);
ASSERT(pPopup != NULL);
CRect screen;
GetDesktopWindow()->GetWindowRect(screen);
pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, screen.right, screen.bottom, AfxGetMainWnd());
}//end if
return LRESULT(0);
}
// ******************************
// * *
// * BackToWork *
// * *
// ******************************
//
// Back to Work Handler
//
void CBotDlg::BackToWork()
{
m_nTrayData.hIcon=LoadIcon(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_WORK));
strcpy (m_nTrayData.szTip, "Bot");
m_nTrayData.uFlags = NIF_ICON | NIF_TIP;
Shell_NotifyIcon (NIM_MODIFY, &m_nTrayData);
}
// ******************************
// * *
// * TakeABreak *
// * *
// ******************************
//
// Take A Break Handler
//
void CBotDlg::TakeABreak()
{
m_nTrayData.hIcon=LoadIcon(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_BREAK));
strcpy (m_nTrayData.szTip, "Bot");
m_nTrayData.uFlags = NIF_ICON | NIF_TIP;
Shell_NotifyIcon (NIM_MODIFY, &m_nTrayData);
}
kJeromek aka JeromeKJerome
|
|
|
|
|
Remember that you need to set your window to be the foreground window before you call TrackPopupMenu() (SetForegroundWindow() ) and you need to post a dummy message immediately afterwards (PostMessage(WM_NULL) )
Hope this helps,
Ryan
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
hi..
I want to make a Dictionary like babylon so I need to get Text by screen coordinate.But,I will not use OCR for bitmap or other picture.
any ideas on how to do this?
Thanks in advance.
|
|
|
|
|
Use a sequence of:
1. GetCursorPos()
2. WindowFromPoint()
3. GetWindowText()
Bikram Singh
|
|
|
|
|
|
thank you very much...;P
that code is working perfect
|
|
|
|
|
Just few cents of ideas
1. Create a global mouse hook.
2. Keep track of mouse events to trigger your procedure.
3. Send double click message to the window where specific mouse trigger occured.
4. This will highlight a text, if there is.
5. Send message to capture the selected text to clipboard.
6. Let your main aplication get the text from the clipboard and process it.
|
|
|
|
|
thank you...
I will try..
|
|
|
|
|
hello,
my goal is to identify a machine on a unique way, so how can i got the id of motherborad or cpu...
thank you
|
|
|
|
|
i want to know how can i access the sound card directly and send data to be displayed on the speaker online.
this data is digital zeroes and ones not formated in a specifiec format
ex( not a wave file)
abdu
|
|
|
|
|
You can not access hardare resource from your application. You should write device driver for this purpose.
I offer you to use DirectSound.
|
|
|
|
|
does any one know a good toturial that learn how to use the direct sound
also does the direct sound can send runtime data to the speaker or it must be saved on the herd disk first?
|
|
|
|
|
Hi all,
How can we query xml data between two dates by using XPath.
For example:
I have an XML file like this
"<Employees>
<Employee>
<Name>xxxx</Name>
<DateOfJoin>'2000-04-12T10:12:30'</DateOfJoin>
</Employee>
<Employee>
<Name>yyyy</Name>
<DateOfJoin>'2001-04-12T10:12:30'</DateOfJoin>
</Employee>
<Employee>
<Name>zzzz</Name>
<DateOfJoin>'2002-04-12T10:12:30'</DateOfJoin>
</Employee>
<Employee>
<Name>aaaa</Name>
<DateOfJoin>'2003-04-12T10:12:30'</DateOfJoin>
</Employee>
<Employee>
<Name>bbbb</Name>
<DateOfJoin>'2004-04-12T10:12:30'</DateOfJoin>
</Employee>
</Employees>"
Now I want employee names between 2002 and 2003.
Thanks inadvance.
|
|
|
|
|
hi iam using the code below in my project! but when i Exit the program the Debuger goes to dbgheap.h and says Access Violation error, and if i remove this line of code : GetString(username, password, string); this error will not occure and the program will exit succesfully!
i have also Free the Library by calling FreeLibrary(hLib);
Any Suggestion how to get rid of this ?
Thanx in advance
typedef bool (WINAPI * cfunc)(const char * username,const char * Password, char * result_6);
HINSTANCE hLib=LoadLibrary("crypt_string.dll");
cfunc GetString;
GetString=(cfunc)GetProcAddress(hLib, "Get_String");
CString username = "Myuser" , password= "Mypass" , string = "";
GetString(username, password, string);
bool lo=FreeLibrary(hLib);
|
|
|
|
|
Seems like the problem is in GetYahooString(). Where's the source for that?
Bikram Singh
|
|
|
|
|
Sorry there is no GetYahooString , it is GetString !
|
|
|
|
|
Ehsan-de-Burge wrote:
Any Suggestion how to get rid of this ?
Yes, don't pass a CString to a function expecting char*.
The GetString() prototype suggests that it expects a char* for the result, i am assuming it expects the buffer to exist and does not alloc one itself.
You have initialized 'string' to "" which is at least 1 byte in size.
When you pass 'string' to GetString() it downcasts to the buffer CString is using and passes that to GetString().
If GetString() expects the buffer to exist then you haven't made it big enough, if it alloc's one ... well then what you are doing is wrong in more ways than one.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Hi guys,
I'm handling CBN_SELCHANGE message of a CComboBox object in my app. The calling function is said to be OnCbnSelchangeMycombo(). The message has been intercepted successfully whenever an item is selected. The problem I have is that if the combo box style is set as CBS_DROPDOWN, I am not able to correctly get the text of the selected item, the resulted string is an empty string. If the stype is CBS_DROPDOWNLIST, the return text is correct.
I tried to get the text using both GetWindowText() and UpdateData() , they return the same thing. Also, I notice the return string will be correct if I select an item using arrow keys. The string is only empty when I select the item by mouse click.
Does anybody know why?
Thanks alot.
|
|
|
|
|
You should use the CBS_SELENDOK message. While CB_SELCHANGE does what you want, you get this while a mouse is selecting a item from the list, so you may get multiple selectons before an actual item is selected by the user.
If you vote me down, my score will only get lower
|
|
|
|
|
Thanks Roger,
I tried to handle CBS_SELENDOK message and the return string is still an empty string. The handler function looks like below:
void CMyDlg::OnCbnSelendokMycombo()
{
UpdateData(TRUE);
CString szMyCombo;
m_MyCombo.GetWindowText(szMyCombo);
if (v_szMyCombo.IsEmpty())
return;
}
</code>
both szMyCombo and v_szMyCombo return empty strings. v_szMyCombo is the CString value variable for the combo box. Again, if I change the combo box style to "Drop List", the return string is correct.
Any other ideas?
|
|
|
|
|
Hi!!! I would like to ask you all, if you know how to Save an Image coming from the ClipBoard to a .jpg File... thanks alot!!!
|
|
|
|