|
Read about shell copy hook handlers.
It is a type of COM object that can block file copies, like when explorer pops up and asks "Do you want to delete the program file?" or "Do you want to delete the read-only file?" etc. The shell hook handler can block the file copy, move, or delete operation as long as it goes through the user interface.
If a separate process uses DeleteFile() API call, then your handler will not be notified.
|
|
|
|
|
Hi all,
I want to make a control such as a button that can be resized and moved around in a VB form while the VB application is running.
something similar to designing the form but only difference is that it should be at runtime.
for example:
I have an application with a toolbar with various components in it, I select a component from it, and add it to my container, I should be able to move the component and resize it. similar functionality that the VB IDE provides.
I want to know how to create such components, does the container have to support some special features or I can implement such functionality directly into my component..
1.if my component can provide such functionality then how do I go about it.
2.if the container should support it then how do the container and the object communicate.
Thanks and Regards
Virat
|
|
|
|
|
Virat Gohil wrote:
VB
You might like to try the VB forum...
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 all
i've a loop in my program. since message loop must run for my program not to hang, i decided to implement it by using PostMessage. i did, but my program still hangs. i don't like to have more than one message loop in my program!
i wrote a test program. a button in a dialog posts a special custom message to the dialog. the message handler sets a static ctrl's text to an auto-incremental value and posts the same message again.
note that i don't use SendMessage, but it still stops responding. for example when i drag the dialog box's title, it doesn't move. it seems that it doesn't receive mouse events while it does receive the custom message and works.
what's the problem and how can i resolve it?
thanx
|
|
|
|
|
Even PostMessages are processed immediately as soon as the current message handler finishes, even before _PAINT and _TIMER messages (paint is delayed until the last posted message is gone)
(the main message loop is just a "get message, process message", so with a message posting itself, the application is completely busy)
The closest solution would be to replace the custom message with a SetTimer(0 ms)
Another option would be a worker thread, but you should do some derious reading on that topic before trying to get by with something you figured out.
we are here to help each other get through this thing, whatever it is Vonnegut jr.
sighist || Agile Programming | doxygen
|
|
|
|
|
|
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.
Software Zen: delete this;
|
|
|
|
|
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);
|
|
|
|