|
Rocreprezent wrote:
Can someone help me do this. I can do it using a doubly linked list but have no clue how to do it with a singly. Thanks alot.
what u use comfortably with doubly link list and not with sigly link list,pls explain
-----------------------------
"I Think It will Work"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
How can I see when the computer is being shutdown. Is there a message sent somewhere and tell that the windows station is being shut down?
please tell me how can I know when my computer is being shut down programatically
gabby
|
|
|
|
|
The WM_QUERYENDSESSION message is sent when the user chooses to end the session or when an application calls the ExitWindows() function. If any application returns zero, the session is not ended. The system stops sending WM_QUERYENDSESSION messages as soon as one application returns zero.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
euacela wrote:
How can I see when the computer is being shutdown. Is there a message sent somewhere and tell that the windows station is being shut down?
Very Simple system post WM_QUERYENDSESSION message
in MFC You Handle this Message
DECLARE_MESSAGE_MAP(youclassname,you classbaseclassname)<br />
ON_WM_ENDSESSION() <br />
END_MESSAGE_MAP()<br />
<br />
and it handling Function name is<br />
afx_msg BOOL OnQueryEndSession( );
euacela wrote:
please tell me how can I know when my computer is being shut down programatically
USe Application Craeted By ME
http://www.codeproject.com/useritems/ShutDownAlarm.asp
-----------------------------
"I Think It will Work"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Hello,
for a vector, overloading the operator [] is easy, you return the data of the position given to the function operator[].
i'm trying to find out how to do it with a matrix.
i found the () approach here:
<url=http: www.parashift.com="" c++-faq-lite="" operator-overloading.html#faq-13.8="">http://www.parashift.com/c++-faq-lite/operator-overloading.html#faq-13.8
to sum it up,there you overload the (), and you access the matrix by doing for example mat(3,3)=2;
I want an implementation that works with mat[3][3]=2;.
i found this <url=http: www.devhood.com="" tutorials="" tutorial_details.aspx?tutorial_id="502">http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=502 , but i don't understand how it works.
i just need an answer of how it works. i need to answer a question, not to make some code work.
i'll really appreciate your help.
thanks!
|
|
|
|
|
Matrix::operator[] returns a different type of C++ object, a row. That's what you get from mat[3] . Then the row class also overloads operator[] and returns a value from the row.
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
"Linux is good. It can do no wrong. It is open source so must be right. It has penguins. I want to eat your brain."
-- Paul Watson, Linux Zombie
|
|
|
|
|
This article[^] which is a matrix calss overrides operator[] and a pseudo operator[][]
take a look.
If you vote me down, my score will only get lower
|
|
|
|
|
thanks roger, nice article
|
|
|
|
|
Hi there,
I want to receive shell notifications regarding copying, moving, drag & drop
operation on specific folders and files. I will use predefined callback
functions in a app where i will collect notifications (Blocking)
Should I use shell extensions, filter driver (to file system driver) or
something else. This need to be done using C++ ,Win-Api only.
Pls provide me appropriate guideline to that.
Thanks and Regards.
Abhi....
|
|
|
|
|
|
Hi Ravi,
I have tested above classes. Though they provides notification but
i need to make Shell operation blocking i.e. say If someone is copying
some files to a folder(watched by my App), My app will be notified via callback but actual operation of copying should not be completed untill app done with processing notification.
Do U think we need to install some hook or need to put a filter driver.
Thanks.
Abhi....
|
|
|
|
|
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.
|
|
|
|