Oh, I guess that's exactly what I need, thanks.
Kamis
Posts
-
how to detect system's idle state? -
how to detect system's idle state?Hello everyone! I want to implement one feature in my program so that it will ask to relogin after the system has been idle for a specified time interval, the same way as screen savers get activated when the system is idle for some time. Any ideas about the solution?
-
Communication between classesThanks
-
Communication between classesSituation is quite ordinary: I have a main window class(for example derived from CDialog) and call a modal dialog from it's method. Choosing some settings from within it affects data of the main window class. So what is the most elegant way to establish communication between these two dialogs? How is it implemented more often in practice? One solution I see is to pass a pointer of the main class as an argument to constructor or any other method of this "settings" dialog and manipulate all tha data directly. Or I can save all changes in some kind of mediums such as global variables or object with static members and then when this secondary dialog is about to be destroyed it sends message to the main window class in order to read data from these transitional variables and update it's data. Or perhaps there is another way to do it?
-
Disabled menu itemYeah, I was thinking about it but wondered if there was a simple way to implement it. Thanks anyway.
-
Disabled menu itemHow can I make so that disabled menu items are not highlighted when I put cursor on them?
-
Popup inside popupThanks a million
-
Popup inside popupHello. How can I do the following: when choosing some item from a popup menu (with a right button click) another popup is shown offering some things to do with that item. I don't need it to do classic way that is to use InsertMenu method with MF_POPUP flag but so that this additional menu is shown only on mouse click.
-
Emulating clipboard copy/pasteYou must have misunderstood me. The thing I want to do is for example I press Ctrl+Shift+P and text from the clipboard appears on the screen (in Edit Box, Notepad, Word, whatever has the focus). And vice versa I pick out some text with the mouse or keyboard press Ctrl+Shift+C and the text saves to clipboard. That's what I want.
-
Emulating clipboard copy/pasteHow can I emulate Ctrl+Ins or Shift+Ins (Ctrl+C Ctrl+V) key combinations. I've seen it in one program where it was possible to define your own keys to work with clipboard. How is it implemented?
-
Clearing memory on windows shutdownI'm writing a prog that works in the background all the time. So it is loaded on windows startup and unloaded on shutdown. The question is: do I have to perform all the clean up like freeing dynamically allocated memory or uninstalling the hook when windows is being restarted or shut down. If yes then what what message is sent to my application to inform that windows is going to finish it's work? I do not get WM_DESTROY or WM_CLOSE like in the case when I terminate the program myself. Thanks.
-
How to hide program on executionI need the main window of my program (created by DialogBox() function) to become hidden already on the startup. If I call ::ShowWindow(hWnd,SW_HIDE) when I receive WM_CREATE or WM_INITDIALOG messages, it doesn`t work because these messages are regeived before dialog is shown. So how can I do it? I can not write consele app because I will need to show the window eventually.
-
Disable key combinationReading all the articles about hooks I've found out how to monitor keyboard input but is there a way to disable key combinations on this level of interception? For example when windows is hooked by my program and user presses Shift+Insert I wouldn't like the text to be inserted from the clipboard but do some other actions. And vice versa how can I emulate different key combinations presses?
-
How can I put a breakpoint in DLL?It works! Thanks
-
How can I put a breakpoint in DLL?Thanks, but why isn't it possible to use the same syntax {,,dllname}Function for my DLLS?
-
How can I put a breakpoint in DLL?Thanks I`ll try that.
-
How can I put a breakpoint in DLL?My DLL. But what's the difference if it wasn't?
-
How can I put a breakpoint in DLL?How can I set DLL as the active project? Well I don't get what you mean. Can you explain more detailed please?
-
How can I put a breakpoint in DLL?for effecient debug
-
window doesn't get redrawnIt still doesn't work. Here's a scheme: // Main.cpp void CMainDialog::On_Visualize() // Create a modal dialog { ... OpenGL_Dialog my_gl; my_gl.DoModal(); ... } // OpenGL_Dialog.cpp BOOL OpenGL_Dialog::OnInitDialog() // Setting timer when creating dialog { CDialog::OnInitDialog(); ... draw_counter=0; SetTimer(1,10,NULL); } void OpenGL_Dialog::OnDestroy() // Kill timer when destroying { ... KillTimer(1); CDialog OnDestroy(); } void OpenGL_Dialog::OnPaint() { draw_counter++; // check CPaintDC dc(this); DrawGLScene2D; SwapBuffers(m_hgldc); } void OpenGL_Dialog::OnTimer(UINT nIDEvent) { switch(nIDEvent) { case 1: RedrawWindow(); break; ... } CDialog::OnTimer(nIDEvent); } void OpenGL_Dialog::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) { switch (nChar) { case 32: char buf[10]; itoa(draw_counter,buf,10); AfxMessageBox(buf); break; ... } CDialog::OnKeyDown(nChar, nRepCnt, nFlags); } Something like this. I wouldn't actually have placed drawing handling on timer but I need to respond to user input and other stuff. So striking space during the dialog's lifecycle I get the number of redrawings and this number is growing all the time. But in most cases the screen stays blank and nothing is drawn.