|
Waht was return value of SetWindowText?
|
|
|
|
|
appl is getting crashed and control is going into Setwindowtext
void CWnd::SetWindowText(LPCTSTR lpszString)
{
ASSERT(::IsWindow(m_hWnd));
if (m_pCtrlSite == NULL)
::SetWindowText(m_hWnd, lpszString);
else
m_pCtrlSite->SetWindowText(lpszString);
}
m_hwnd is showing as NULL
|
|
|
|
|
So I think your problem is of hwnd ptr2.
|
|
|
|
|
ok...
do u hv any other suggetion abt how can i implement this by some other method?
or can u give me some demo of this type of application?
i will b very much greatful to u
|
|
|
|
|
How did you create your child dialog?
|
|
|
|
|
child dialog means after clicking on button i will display 1 more dialog. i want to change title of this dialog at run time.
|
|
|
|
|
Are you wanting to set the window text of the 3rd dialog dynamically? In that case, you could pass it as a parameter to the constructor of the 3rd dialog class and have a string member variable initialized with that value and then call SetWindowText() in InitDialog() . That sounds viable?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
thanks Rajesh it is working now.
|
|
|
|
|
Anjali Patil wrote: ...i want to change title of this dialog(3rd dialog).
Call SetWindowText() from within its OnInitDialog() method.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi,
I have MDI application, which loads office files (word,excel,ppt) but while loading excel doc I was unable to user "Freez Panes" functionality. This is bcoz when we open any document thru MDI application, this MDI application will have its own "Window" menu with default sub menus ("New Window", "Cascade","Tile", "Arrage Icons") but it does not have "Freez Panes". I would like to know is there any way to implement such functionality.
I have tried to add another menu called "Freez Panes" but need to add functionality for it. Pls help.
Thanks
SNI
|
|
|
|
|
How to load bitmpas dynamically?
When i directly loaded into resources(IDB_BITMPA) my exe is occupying more size. Instead of that how can i load at run time from bitmap images (res\image.bmp)
|
|
|
|
|
If you're using Win32 API , you may use LoadImage [^], for instance
HANDLE hMyBmp = LoadImage(NULL, _T("res\\image.bmp"), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
On the other hand, if you're using MFC/ATL , have a look at CImage class documentation [^], the Load method looks promising.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
|
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.
|
|
|
|