|
From MSDN :
There are two ways to prevent a window from appearing on the shell's taskbar and in the task list window that appears when you press ALT+TAB.
Give the window the WS_EX_TOOLWINDOW extended style, and remove the WS_EX_APPWINDOW style. As a side effect, the window will have a smaller caption than a normal window.
Give the window the WS_POPUP style and make it owned by a hidden window.
If a window is created or shown such that it appears in the taskbar, then the window should be in the same state when it is destroyed or hidden. If the visibility on the taskbar is not synchronized, then the taskbar may end up with a blank button where it thinks the window should still appear.
Hope that helps
Live as if your were to die tomorrow. Learn as if you were to live forever.
-Mahatma Gandhi
|
|
|
|
|
Ok im coding a project for school. What it does is reads in
Name , Last name , ID number , Gender
( 4 parrallel arrays ...)
and when you are done modifying (adding a member , sorting , removing a member..etc)
it asks to update the existing text file (overwrite)
now i know about
#include <cstdlib>
and
system("DOS command");
but i would like to put when it is updated :
is it possible to print out to a file
obviously with the fstream headerfile
ofstream dataOut...or something
THOSE DOS commands?
as like to save them into a
typedef char array[90]...
array myString; ...etc
Or am i doing this all wrong..
Even tho i know those system commands are actually int's.. 0 's ir 1 's...
|
|
|
|
|
You want to put the time that the update happened ? This from the MSDN
#include <stdio.h>
#include <string.h>
#include <time.h>
void main( void )
{
struct tm *newtime;
char am_pm[] = "AM";
__time64_t long_time;
_time64( &long_time ); /* Get time as long integer. */
newtime = _localtime64( &long_time ); /* Convert to local time. */
if( newtime->tm_hour > 12 ) /* Set up extension. */
strcpy( am_pm, "PM" );
if( newtime->tm_hour > 12 ) /* Convert from 24-hour */
newtime->tm_hour -= 12; /* to 12-hour clock. */
if( newtime->tm_hour == 0 ) /*Set hour to 12 if midnight. */
newtime->tm_hour = 12;
printf( "%.19s %s\n", asctime( newtime ), am_pm );
}
Output
Fri Jan 22 10:03:48 AM
I don't recall if it's ctime or time, but you should not include time.h as it is deprecated. This will mean that the methods you want will be in namespace std.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Hello, everyone!
I want to enumerate all the files in a directory and get their names and the create time of each file.
Are there some sample codes that I can make a reference?
Best regards,
Geo
|
|
|
|
|
use CFileFind if you are using MFC or FindFirst and FindNext apis.
Programming is an art not a skill, every one can be a skilled programmer but not an artist.
|
|
|
|
|
Thanks, mr.prakash buddy!
I have resolve the trouble by the function you recommended.
Best regards,
Geo
|
|
|
|
|
How to use VideoSoft FlexArray Control and DBGrid Control! Who can tell me?
Or where can download?
|
|
|
|
|
what exaclty u need to do??
please be precise!!
Muhammad Shoaib Khan
http://geocities.com/lansolution
|
|
|
|
|
... like I can produce with Excel ?
I have a lot of lines a columns Of different length to format and then print the result on a printer.
How can I do that ?
Any idea appreciated ...
DD
|
|
|
|
|
Crystal Reports is one solution. Reusing Excel via its automation interfaces is another. Generating HTML and pass it to the printer via Shell/IE can also be done. Another solution is to use GDI directly. The options are many (about as many as there are report libraries).
--
You're entertaining at least.
|
|
|
|
|
thanks for the answer !
1) let's forget about Crystal Report, I have not enough money to buy it ...
2) Excel ... why not, but it supposes that all station using my application has Excel installed, and I am not sure I want to have a such dependence ...
3) HTML ... Is there an easy way to produce HTML code from VC++ or do I have to handle myself all HTML tags ? Can you be more precise on this "pass it to the printer via Shell/IE" or indicate me an article where I can read something on it
4) use GDI directly : this means drawing myself all lines and columns, insert all figures, change the fonts, etc ... I think I was more or less thinking to this kind of solution ... but isn't it to hard/tedious to do this ? I will see if I can find some articles on this
Thanks again for your help
DD
|
|
|
|
|
Qadddd wrote:
Can you be more precise on this "pass it to the printer via Shell/IE" or indicate me an article where I can read something on it
You can either load IE with the result HTML, or your could use the shell API function ShellExecute to print. A simple solution is to just load the report into IE - the user usually wants to preview reports and then print it.
As for generating HTML, I think you'll have to be on the creative side there. I'd build primitives (C++ classes) for generating low level HTML. One class per element basically - and build an HTML object model from there. I'm not sure, but I think MSHTML does this already. Consult the MSDN documentation for further info on that API. Ontop of MSHTML, you can build your own abstractions like ReportHeader, ReportFooter, ReportBody, etc. Abstractions that uses and composes the MSHTML objects in concise way. This combined with CSS can yield pretty good looking reports, but it'll cost you the knowledge of HTML and CSS + various APIs.
Qadddd wrote:
use GDI directly ... but isn't it to hard/tedious to do this ?
Uh huh. That's why there's a business for report generation tools.
--
You're entertaining at least.
|
|
|
|
|
Hello,
Finally I choose to play with GDI .
So I use these pDC->MoveTo(Startx, z) and pDC->LineTo((Startx + LTot), z) to draw the grid and these pDC->GetTextExtent(C61Title[0]) and pDC->TextOut(a, b, C61Title[0]) to put my value in the grid.
Now, in order to better differenciate the titles from the values, I would like to fill in grey the cells before writting my titles in ... do you have an idea of how I can do this ?
Thanks in advance
DD
|
|
|
|
|
When building an application, should I create a .cpp for every header file in which a class is defined, even if all the implementation resides in the header file? What are the inconvenients and advantages of doing - or not doing - this?
I'm asking because I've started a rather large project, and I have several classes implemented in their respective header files - 4x4 matrix, 3d vector classes, etc., to allow for their respective methods to be inlined. But since header files cannot be compiled, I have to include these headers in a .cpp to allow for compilation. But is it really worth it, since the .cpp contain nothing but an inclusion? Should I remove these files when I start actually creating objects in my application?
Cheers, blackmesa.
|
|
|
|
|
Generally speaking, only templates are implemented in header files only. Sometimes, if the classes are small and contain no static data, then the whole implementation may very well reside in the header file.
If the cpp file only contains an inclusion, then just remove it.
--
You're entertaining at least.
|
|
|
|
|
Hi, ive got this problem :
when i use this everything is ok :
LPHOSTENT hostent;
hostent = gethostbyname("localhost");
but with this :
LPHOSTENT hostent;
CString strIP="127.0.0.1"
hostent = gethostbyaddr (strIP,strIP.GetLength (),AF_INET);
i cant connect to the server (of course it does the same with other adresses then localhost
Can u tell me plz what im doing wrong ? And the third para in gethostbyadd. Does it have to be always AF_INET or there are some choices?
Thx in Advance.
|
|
|
|
|
What does WSAGetLastError() return after the failed call to gethostbyaddr() ?
--
You're entertaining at least.
|
|
|
|
|
unsigned long ulResult = inet_addr(strIP);
if (INADDR_NONE != ulResult)
{
hostent = gethostbyaddr((char *) &ulResult, sizeof(ulResult), AF_INET);
}
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Thanks
|
|
|
|
|
How to pass variable to Windows System?
#include <iostream>
#include <stdlib.h>
using namespace std;
int main(int argc, char *argv[])
{
char comp_name [20];
system("cls");
cout << "Please enter computer name: " ;
cin >> comp_name;
system("del \\comp_name\c$\WINNT\MS\SMS\CORE\BIN\SlowNet.exe");
return 0;
}
How can I pass comp_name to Windows command?
Thank you.
|
|
|
|
|
You need to construct the string correctly - what you're doing is trying to call system with a string literal - which doesn't take what you set comp_name to into account (here's a question for you, what would your "code" do if you had a variable called WINNT? )
What you need to do is construct a std::string with the relevant computer name:
string command_to_do;
command_to_do = "del \\";
command_to_do += comp_name;
command_to_do += "\c$\WINNT\MS\SMS\CORE\BIN\SlowNet.exe"
system(command_to_do.c_str());
(Untested code, so your milage may vary)
--
Ian Darling
"The moral of the story is that with a contrived example, you can prove anything." - Joel Spolsky
|
|
|
|
|
A \\ in the hand is worth more than a \ in the string.
--
You're entertaining at least.
|
|
|
|
|
Anonymous wrote:
system("del \\comp_name\c$\WINNT\MS\SMS\CORE\BIN\SlowNet.exe");
Lose the system() command and use DeleteFile() instead.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
How to pass variable to Windows System?
code:--------------------------------------------------------------------------------
#include <iostream>
#include <stdlib.h>
using namespace std;
int main(int argc, char *argv[])
{
char comp_name [20];
system("cls");
cout << "Please enter computer name: " ;
cin >> comp_name;
system("del \\comp_name\c$\WINNT\MS\SMS\CORE\BIN\SlowNet.exe");
return 0;
}
--------------------------------------------------------------------------------
How can I pass comp_name to Windows command?
Thank you.
|
|
|
|
|
The Copy Hook Handlers only can be used to approve the file operation, but are not informed of the success or failure of the operation. So they cannot be used to monitor file operations. Is there anyone can tell me how can I do it?
|
|
|
|