|
After searching the internet some more I found the same answer. Following is the code, in case anyone else has this issue.
HWND hDlgWnd(NULL);
HRESULT hr;
IOleWindow *pOleWindow;
//Sometimes the progress dialog sticks around after stopping it,
//until the mouse pointer is moved over it or some other triggers.
//This process finds the hwnd of the progress dialog and hides it
//immediately.
if (SUCCEEDED(m_pprogressdlg->QueryInterface(IID_IOleWindow, reinterpret_cast<lpvoid> (&pOleWindow))))
{
hr = pOleWindow->GetWindow(&hDlgWnd);
if(FAILED(hr))
{
hDlgWnd = NULL;
}
pOleWindow->Release();
}
m_pprogressdlg->StopProgressDialog();
if (hDlgWnd)
::ShowWindow(hDlgWnd, SW_HIDE);
m_pprogressdlg.Release();
|
|
|
|
|
As I recall, that's basically what we did as well. I'll double-check this when I can get the code fragment from my co-worker.
|
|
|
|
|
Hi,
I use the function OnPaint() in a dialog-based mfc-application to draw a nice little bitmap. Although there is no click to minimize the dialog, it can be minimized by clicking 'Show Desktop' in the windows taskbar oder pressing 'Windowsbutton+d'.
The problem is: When I reactivate my application, the bitmap will not be drawn! It seems, the function OnDraw() is not called. Only after a mouseclick in the dialog, it will be drawn.
Is there another function I have to overwrite with the code for bitmap-loading? I do not know any. Which function is called when a minimized dialog is reactivated?
Thank you very much!!
Nick
|
|
|
|
|
Try WM_ACTIVATE.
Regards,
FarPointer
Blog:FARPOINTER
|
|
|
|
|
Hi, I'm developing a simple applications for child to use and this requires the disabling of the minimize, maximize, and close buttons on the top right hand corner. Also, the application needs to be maximized at all times. This was easily achievable by creating a window with only the WS_CAPTION passed as the Window Style and ShowWindow was used with SW_SHOWMAXIMIZED to maximize the application on when the program starts. The problem, however, is that the maximized window is still movable and double clicking on the title bar will un-maximize it. Is there a way around this, where I can prevent the movement of the window and prevent the un-maximizing of the window?
|
|
|
|
|
Handle the NC_LBUTTONDOWN and NC_LBUTTONDBLCLK messages. The handlers don't have to do anything, as long as the messages aren't passed along to DefWindowProc() .
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
VB > soccer
|
|
|
|
|
If you process such messages as WM_SYSCOMMAND, you could simply do nothing for a command you don't want to support, such as SC_RESTORE. Don't know if that message covers double-clicking on the title bar. You could even try processing WM_NCHITTEST and never returning HTCAPTION.
|
|
|
|
|
Thanks guys, I'll give both NC_LBUTTONDOWN,NC_LBUTTONDBLCLK, and WM_SYSCOMMAND a try and see how that goes.
|
|
|
|
|
Hi guys,
Basically I am getting unresolved external errors when trying to use the _strtime and _strdate functions. I have tried to include the following libraries in my project to aid the situation:
LIBC.LIB
LIBCMT.LIB
MSVCRT.LIB
But alas it doesnt work. Every single one of them conflict with one of the other libraries I have. These are the libraries, options and include files I have:
shlwapi.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:yes /pdb:"Debug/testing_project.pdb" /debug /machine:I386 /out:"C:\testing_project.exe" /pdbtype:sept
<code>
#include <windows.h>
#include <string>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <shlwapi.h>
#include <time.h>
<code>
Anyone able to sign some light on the issue and see what I could do to make this work?
Thanks,
Robbie
-- modified at 18:44 Wednesday 21st June, 2006
|
|
|
|
|
Can you tell what type of application are you working on and what version of Visual Studio?
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Well its a server-client logging program, and I just want to get a string literal of the date in the form:
06/06/06 12:00:00AM
As for the VS version, I'm using VC++ 6.0. Any ideas that could help me out Anshuman?
|
|
|
|
|
Our application is monitoring a set of files in a specific directory and need to know when one is opened by another program. I have looked at the windows APIs, NT and Windows internals books but haven't found anything.
In the terminal server environment where our app runs, there might be many copies of our program, each monitoring a different directory.
Any help is greatly appreciated.
dwickhamsr
|
|
|
|
|
|
Thanks for the pointer. I have that code and it does NOT tell when an existing file is opened for read.
|
|
|
|
|
|
Hi all, I've been wandering around the net this evening looking for inspiration. I am keen to get back into C++, I was never really fluent in it and have only taken a short uni course in it. There are a lot of tutorials on the net which is great. I couldn't find anything that inspires me to fire up the IDE and start coding. Basically I think I need a project suitable for a newbie that would help me get to grips with the language and keep me interested, something like a command line chat program perhaps. I particularly want to understand object oriented programming extremely well so I find it easier moving between languages.
I'm using VC++ 6.0 and even that I'm not all that familiar with.
Can anyone give me any guidance? If I was to look at a command line based chat program I would obviously need to learn about sockets etc. I don't know, I'm thinking for a newbie its not really a good idea, I just don't want to start with adding a few numbers together, been there - done that.
Any suggestions for a decent newbie project that would take me on a journey to being a decent C++ programmer?
Cheers in advance for any suggestions
|
|
|
|
|
Create a server-client chat based program. Who knows maybe you may be able to expand it into a multi-faceted gaming arena like yahoo games, zone.com, ICQ (ick...), AIM or MSN!
|
|
|
|
|
I am a self-taught programmer and my first several projects involved graphics of one sort or another. Here are examples of a few things I messed with : rotating 3D objects, Mandelbrot fractals, "spirograph" shapes, and displaying terrain data files in 3D. I picked graphics because I have always been interested in the topic and it is usually easy to see if you are doing it right.
Best of luck !
|
|
|
|
|
Ok, I decided that graphics might be a cool thing to do but I think its prob too in depth to start with. However I've sort of kept with the graphics thing. I decided to write a class that would display a character to a scale that the user defines.
Its not really of any particular use, just thought it might be good to start with.
For example, the user sets a character "x" with a scale of "1" this should then produce:
x x
x
x x
I also want to set the cursor to start at a user defined position on the console output window so I'm using:
void gotoxy(int x, int y)
{
HANDLE hConsoleOutput;
COORD dwCursorPosition;
dwCursorPosition.X = x;
dwCursorPosition.Y = y;
hConsoleOutput = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(hConsoleOutput,dwCursorPosition);
}
This funtion is privately scoped in my class and called like so:
char resizer::display_resized_word(){
gotoxy(pos_x, pos_y);
return character;
}
my cpp file uses it like so:
cout << character.display_resized_word() << " " << endl;
at the moment I've not implemented the resizing part and I've got a feeling it will be quite tricky. However the problem I'm having with this is that it produces an error:
test_resizer.obj : error LNK2001: unresolved external symbol "private: void __thiscall resizer::gotoxy(int,int)" (?gotoxy@resizer@@AAEXHH@Z)
Debug/word_scaler.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
Any ideas what this means?
|
|
|
|
|
Hey, I wander, why does this (below code) crash my computer when I run it in ring 0?
<br />
PUNICODE_STRING ValueName;<br />
memcmp(ValueName->Buffer, "_some_", 6);<br />
Thx, Glich.
|
|
|
|
|
|
Hi, thx for your help. How can I solve this problem? I am also sorry to say that I did not fully understand your last comment. Thx -Glich
|
|
|
|
|
For this project:
http://www.codeguru.com/Cpp/W-D/doc_view/viewmanagement/article.php/c3341
Any chance any one knows how to make it so that data is
retained when the user goes to a different screen?
?
Any response any one can give me will be greatly appreciated.
Sincerely,
Danielle Brina (an overworked graduate student)
|
|
|
|
|
DanYELL wrote: make it so that data is
retained when the user goes to a different screen?
Danielle, in MFC Document/View architecture each view has a GetDocument() method that returns a typed pointer to the current CDocument derived object. This document object provides access to the data that any view needs to display.
Does that help? Last modified: Wednesday, June 21, 2006 4:22:15 PM --
|
|
|
|
|
> Does that help?
Not particularly, but your the only one responding to any
message I post.
For that sample project, a View is deleted when the user
goes to another view. Consequently, any data that the user
might have typed in is gone. Is there away to redo that code
in MainFrm.cpp so that the View remains and that data remains
from screen to screen? If it did remain, I would have a
better chance at saving it.
save it.
|
|
|
|