|
You can use of CImage class:
#include AtlImage.h
CImage m;
m.Load(_T(""));
....
...
|
|
|
|
|
I have a dialog-based app which runs loads at windows startup, but problem is i don't want to showing up this dialog at every startup so i need it to start hidden.Plz help me
|
|
|
|
|
What kind of a program is that? What does it do? Perhaps you don't need a windowed application then?
However, to answer your query, you may use ShowWindow(SW_HIDE);
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Thanks for reply but i want to hide only at the time of loads at windows startup.
|
|
|
|
|
You never answered any of my questions. Why can't you send your app to tray instead, if at all it has an UI? If it doesn't need an UI, then why a dialog based app?
Again, to answer your query, with windows start-up, you could invoke your app with a command line parameter and check for it in the InitInstance() and then use ShowWindow(SW_HIDE);
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Ok i am trying to do that.Thanks
|
|
|
|
|
I understand your problem as this - how to identify whether the application is started during windows startup.
I think you've managed to start your application on startup, by adding under - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run . Well, in that case just pass a commandline argument /startup or something like that. So that when started, by checking the command line arguments, you can identify whether its started during windows startup or manually and can hide your main window accordingly.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Thanks Jijo raj
My problem is how to set commandline argument for hide application?
|
|
|
|
|
May I politely ask you to use Google?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
|
Well, let me ask you how do you manage to start the application during windows startup? via registry or by creating shortcut in startup directory?
in both cases, you could pass the command line together with exe path. for instance,
c:\hello\hello.exe /startup
Well, in your application, you have to parse and check for the command line string - /startup. You could use the function GetCommandLine() to read the command line string. This link[^] will be useful.
[Edit]
Check out this link[^] too for parsing command line.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
i am useing via registry.
|
|
|
|
|
MsmVc wrote: i am useing via registry.
okay, then you have to specify the your exe path in registry, like this
c:\Hello\Hello.exe /Startup
then, /Startup switch will be sent to your application as command line. Well, I've already explained about how to read the command line from your application.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Thanks a loat Jijo raj
I am able to do that but my problem is command line argument.How can i pass command line argument can you give me some line of code.Plz help me
|
|
|
|
|
Commandline arguments are the parameters that we pass to application while starting it up. You don't need to write any specific code for sending commandline argument to application.
Well, did you modify your registry startup entry as i suggested? Just do it and call GetCommandLine() from you application. And you'll be able to see the "/startup" in debugger.
Don't hesitate to ask, if you have more doubts about it.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
i have placed a buttons using Cxskinbutton.i want to remove a focus rectangle while pressing tab key.how i do that.
|
|
|
|
|
check whether the focus rectangle is drawn somewhere explicitly in the code. BTW someone did ask about getting the focus rectangle on the button yesterday but he was not able to get it... may be you to can exchange ideas..
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
Hi All,
I am currently making a VC++(MFC) app which will act as additional login screen. It will come up when user logs in to Windows XP machine and user has to use a username/pwd combination which will be given to him.
The business idea is for a Cyber Cafe where users login with their account details, and they can browse till they have "browsing time" in their accounts. Once they logout or their "browse time" is over, the login screen again appears facilitating the next user to login with his credentials.
I have created the MFC login screen(starting it as a windows service) and when user logs in successfully, I am placing the MFC program in the systray where user can login and see his remaining time, etc.
What I wanted from community is couple of design suggestions -
Q1. Is the idea of placing the app in the systray appropriate ? Can you advise some other approach which could come handy ?
Q2. Also, I am looking forward to have the authentication being done via a machine(a server) - which has all authentication info as well as browse time information stored in it. I was looking fwd to use Winsock API for this purpose. The client application(installed on all machines) will contact server app in following cases -
1) while logging in - to get authentication info, browse time info.
2) while logging out - to record time spent in browsing.
Is this network design appropriate - using client/server architecture and winsock API or can their be any improvements in the design ?
Thanks for the help!
Regards
Cage
|
|
|
|
|
I wanna make cursor IDC_HAND when mouse hover in my CMyButton(derived from CButton).
In CMyButton I deal with ON_WM_MOUSEMOVE message, see code below:
void CMyButton::OnMouseMove(UINT nFlags, CPoint point)
{
ASSERT(m_hWnd);
TRACKMOUSEEVENT tevent;
tevent.cbSize = sizeof(tevent);
tevent.dwHoverTime = 0;
tevent.hwndTrack = m_hWnd;
tevent.dwFlags = TME_LEAVE;
_TrackMouseEvent(&tevent);
SetCursor(LoadCursor(NULL, IDC_HAND));
CButton::OnMouseMove(nFlags, point);
if (FALSE == m_bHovered)
{
m_bHovered = TRUE;
this->Invalidate(TRUE);
}
}
Hope I state my problem clearly!
modified on Tuesday, December 2, 2008 1:43 AM
|
|
|
|
|
Did you try handling WM_SETCURSOR? This is much easier than trying to deal with mouse messages.
|
|
|
|
|
Thanks. It worked!
I vote you 5!^_^
|
|
|
|
|
Also, I think you need WINVER to be greater than or equal to 0x0500 to use IDC_HAND
|
|
|
|
|
I recently migrated from VS2003 to VC2008. I have only converted a few projects so far so my "sample size" is small. My problem is that dialog based MFC projects lose the 3D look that they had when compiled with VS2003. In VS2003 and earlier, 3D "just happened". You got it by default. Something seems to have changed in VS2008 and I can't work out what...
The problem can't be due to a quirk in my projects because it even happens with the most trivial project possible. Create a dialog based MFC app in VS2003, leave all the defaults, add a few controls, build and run. You get the 3D look. Then convert the project to VS2008. All the controls have gone flat. The problem is not a result of the conversion because projects initially built under VS2008 have the same behaviour.
Still, there must be a way to build for 3D because one of my converted projects has kept its 3D look. Also, among the sample apps that come with VS2008, there is at least one that is MFC dialog based and it too has a 3D look.
I've looked at dialog settings, compiler options, linker options, includes files, the rc file, but I can't work out what the difference is between apps that have and don't have the 3D look. Thanks for any clues...
|
|
|
|
|
Is it because VS2008 automatically applies a manifest to use Windows Themes for common controls, whereas VS 2003 doesn't?
|
|
|
|
|
Thanks for the hint. It's indeed something to do with the manifest. As long as I have the dependency on Microsoft.Windows.Common-Controls V6 in the manifest, I loose the 3D look under WinXP (not under Vista though). I throw it out and things are back to normal. Am I missing something?
|
|
|
|