|
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.
|
|
|
|
|
DanYELL wrote: Is there away to redo that code
in MainFrm.cpp so that the View remains and that data remains
from screen to screen?
Of course there is but there are other ways that are a better design. The Model View Controller[^] Design Pattern is preferred. MFC Document/View is much like MVC. In MVC the "Model" is a "Data Model". This can mean an Object structure that represents the Data for the application and it's relationships.
A primary design principle of MVC is that "Views" do not maintain the application data. This way the "View" classes uphold the "isolation" principle since they do not require any relationships. Of course the same is true for the "Serialization" code, it can exist in isolation from the "Views" and the "Controller" logic.
In MFC Doc/View the Document class can be used as the interface to the "Model". So if a "View" provides a user interface for the user to enter data, at the appropriate time the data is routed into the "Model" for storage. Then all the "Views" have access to the Data through the "Model". Note: "The appropriate time" is application dependent and associated to one or more events.
In some MFC applications the Document class "is" the Model. In others it just provides an entry point or "interface" into the Model. Regardless of any specific implementation the Document class can then access the Data for the purpose of Serialization (Save/Load).
So you need to know (analysis) when, what event(s), you should use to trigger routing the view(s) data through or into the CDocument class. Then when you need to "Save" the data is all available to the CDocument class for Serialization. When you "Load" the CDocument class handles Deserialization and initializes the data from the persisted storage. Then of course the "Views" can display the data by getting it from the CDocument class.
I hope that helps
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
hello,
is there any way to find out if a certain character (eg unicode U+30aa) is included in a font using the gdi+ framework (other than drawing the character and checking if you get the empty box) ? any hint to a gdi or win32 api function would also be fine. thanks.
martin
|
|
|
|
|
If your into OpenType font files, check out the "cmap" table.
From Microsoft Typography...
"Character codes that do not correspond to any glyph in the font should be mapped to glyph index 0"
OpenType Specification[^]
Just be forewarned, the file tables and structures are in Big-Endian which is a big pain in the tush.
|
|
|
|